summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/chat-commands.c14
-rw-r--r--src/core/network-openssl.c17
-rw-r--r--src/fe-common/core/completion.c13
-rw-r--r--src/fe-common/core/module-formats.h50
-rw-r--r--src/fe-text/term-terminfo.c7
5 files changed, 68 insertions, 33 deletions
diff --git a/src/core/chat-commands.c b/src/core/chat-commands.c
index e86fdf9d..d5a133f8 100644
--- a/src/core/chat-commands.c
+++ b/src/core/chat-commands.c
@@ -149,9 +149,9 @@ static SERVER_CONNECT_REC *get_server_connect(const char *data, int *plus_addr,
return conn;
}
-/* SYNTAX: CONNECT [-4 | -6] [-ssl] [-ssl_cert <cert>] [-ssl_pkey <pkey>] [-ssl_pass <password>]
- [-ssl_verify] [-ssl_cafile <cafile>] [-ssl_capath <capath>]
- [-ssl_ciphers <list>]
+/* SYNTAX: CONNECT [-4 | -6] [-tls] [-tls_cert <cert>] [-tls_pkey <pkey>] [-tls_pass <password>]
+ [-tls_verify] [-tls_cafile <cafile>] [-tls_capath <capath>]
+ [-tls_ciphers <list>] [-tls_pinned_cert <fingerprint>] [-tls_pinned_pubkey <fingerprint>]
[-!] [-noautosendcmd]
[-noproxy] [-network <network>] [-host <hostname>]
[-rawlog <file>]
@@ -250,10 +250,10 @@ static void cmd_server(const char *data, SERVER_REC *server, WI_ITEM_REC *item)
command_runsub("server", data, server, item);
}
-/* SYNTAX: SERVER CONNECT [-4 | -6] [-ssl] [-ssl_cert <cert>] [-ssl_pkey <pkey>]
- [-ssl_pass <password>] [-ssl_verify] [-ssl_cafile <cafile>]
- [-ssl_capath <capath>]
- [-ssl_ciphers <list>]
+/* SYNTAX: SERVER CONNECT [-4 | -6] [-tls] [-tls_cert <cert>] [-tls_pkey <pkey>]
+ [-tls_pass <password>] [-tls_verify] [-tls_cafile <cafile>]
+ [-tls_capath <capath>]
+ [-tls_ciphers <list>] [-tls_pinned_cert <fingerprint>] [-tls_pinned_pubkey <fingerprint>]
[-!] [-noautosendcmd]
[-noproxy] [-network <network>] [-host <hostname>]
[-rawlog <file>]
diff --git a/src/core/network-openssl.c b/src/core/network-openssl.c
index 2054f28a..7ec902fb 100644
--- a/src/core/network-openssl.c
+++ b/src/core/network-openssl.c
@@ -45,6 +45,19 @@
#define ASN1_STRING_data(x) ASN1_STRING_get0_data(x)
#endif
+/* OpenSSL 1.1.0 also introduced some useful additions to the api */
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined (LIBRESSL_VERSION_NUMBER)
+static int X509_STORE_up_ref(X509_STORE *vfy)
+{
+ int n;
+
+ n = CRYPTO_add(&vfy->references, 1, CRYPTO_LOCK_X509_STORE);
+ g_assert(n > 1);
+
+ return (n > 1) ? 1 : 0;
+}
+#endif
+
/* ssl i/o channel object */
typedef struct
{
@@ -510,6 +523,10 @@ static GIOChannel *irssi_ssl_get_iochannel(GIOChannel *handle, int port, SERVER_
g_free(scapath);
verify = TRUE;
} else if (store != NULL) {
+ /* Make sure to increment the refcount every time the store is
+ * used, that's essential not to get it free'd by OpenSSL when
+ * the SSL_CTX is destroyed. */
+ X509_STORE_up_ref(store);
SSL_CTX_set_cert_store(ctx, store);
}
diff --git a/src/fe-common/core/completion.c b/src/fe-common/core/completion.c
index 78b1b24b..e78fe7d5 100644
--- a/src/fe-common/core/completion.c
+++ b/src/fe-common/core/completion.c
@@ -321,6 +321,10 @@ GList *filename_complete(const char *path, const char *default_path)
g_return_val_if_fail(path != NULL, NULL);
+ if (path[0] == '\0') {
+ return NULL;
+ }
+
list = NULL;
/* get directory part of the path - expand ~/ */
@@ -350,7 +354,14 @@ GList *filename_complete(const char *path, const char *default_path)
g_free_and_null(dir);
}
- basename = g_path_get_basename(path);
+ len = strlen(path);
+ /* g_path_get_basename() returns the component before the last slash if
+ * the path ends with a directory separator, that's not what we want */
+ if (len > 0 && path[len - 1] == G_DIR_SEPARATOR) {
+ basename = g_strdup("");
+ } else {
+ basename = g_path_get_basename(path);
+ }
len = strlen(basename);
/* add all files in directory to completion list */
diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h
index 4e2f72d9..97ac60bb 100644
--- a/src/fe-common/core/module-formats.h
+++ b/src/fe-common/core/module-formats.h
@@ -12,21 +12,21 @@ enum {
TXT_DAYCHANGE,
TXT_TALKING_WITH,
TXT_REFNUM_TOO_LOW,
- TXT_ERROR_SERVER_STICKY,
- TXT_SET_SERVER_STICKY,
+ TXT_ERROR_SERVER_STICKY,
+ TXT_SET_SERVER_STICKY,
TXT_UNSET_SERVER_STICKY,
- TXT_WINDOW_NAME_NOT_UNIQUE,
- TXT_WINDOW_LEVEL,
- TXT_WINDOW_SET_IMMORTAL,
- TXT_WINDOW_UNSET_IMMORTAL,
- TXT_WINDOW_IMMORTAL_ERROR,
+ TXT_WINDOW_NAME_NOT_UNIQUE,
+ TXT_WINDOW_LEVEL,
+ TXT_WINDOW_SET_IMMORTAL,
+ TXT_WINDOW_UNSET_IMMORTAL,
+ TXT_WINDOW_IMMORTAL_ERROR,
TXT_WINDOWLIST_HEADER,
TXT_WINDOWLIST_LINE,
TXT_WINDOWLIST_FOOTER,
TXT_WINDOWS_LAYOUT_SAVED,
TXT_WINDOWS_LAYOUT_RESET,
- TXT_WINDOW_INFO_HEADER,
- TXT_WINDOW_INFO_FOOTER,
+ TXT_WINDOW_INFO_HEADER,
+ TXT_WINDOW_INFO_FOOTER,
TXT_WINDOW_INFO_REFNUM,
TXT_WINDOW_INFO_REFNUM_STICKY,
TXT_WINDOW_INFO_NAME,
@@ -34,22 +34,22 @@ enum {
TXT_WINDOW_INFO_IMMORTAL,
TXT_WINDOW_INFO_SIZE,
TXT_WINDOW_INFO_LEVEL,
- TXT_WINDOW_INFO_SERVER,
+ TXT_WINDOW_INFO_SERVER,
TXT_WINDOW_INFO_SERVER_STICKY,
- TXT_WINDOW_INFO_THEME,
+ TXT_WINDOW_INFO_THEME,
TXT_WINDOW_INFO_BOUND_ITEMS_HEADER,
TXT_WINDOW_INFO_BOUND_ITEM,
TXT_WINDOW_INFO_BOUND_ITEMS_FOOTER,
TXT_WINDOW_INFO_ITEMS_HEADER,
TXT_WINDOW_INFO_ITEM,
- TXT_WINDOW_INFO_ITEMS_FOOTER,
+ TXT_WINDOW_INFO_ITEMS_FOOTER,
TXT_FILL_2,
TXT_LOOKING_UP,
TXT_CONNECTING,
- TXT_RECONNECTING,
- TXT_CONNECTION_ESTABLISHED,
+ TXT_RECONNECTING,
+ TXT_CONNECTION_ESTABLISHED,
TXT_CANT_CONNECT,
TXT_CONNECTION_LOST,
TXT_LAG_DISCONNECTED,
@@ -100,7 +100,7 @@ enum {
TXT_CHANSETUP_LINE,
TXT_CHANSETUP_FOOTER,
- TXT_FILL_4,
+ TXT_FILL_4,
TXT_OWN_MSG,
TXT_OWN_MSG_CHANNEL,
@@ -162,7 +162,7 @@ enum {
TXT_MODULE_HEADER,
TXT_MODULE_LINE,
- TXT_MODULE_FOOTER,
+ TXT_MODULE_FOOTER,
TXT_MODULE_ALREADY_LOADED,
TXT_MODULE_NOT_LOADED,
TXT_MODULE_LOAD_ERROR,
@@ -183,7 +183,7 @@ enum {
TXT_NOT_JOINED,
TXT_CHAN_NOT_FOUND,
TXT_CHAN_NOT_SYNCED,
- TXT_ILLEGAL_PROTO,
+ TXT_ILLEGAL_PROTO,
TXT_NOT_GOOD_IDEA,
TXT_INVALID_NUMBER,
TXT_INVALID_TIME,
@@ -232,8 +232,8 @@ enum {
TXT_FILL_14,
- TXT_UNKNOWN_CHAT_PROTOCOL,
- TXT_UNKNOWN_CHATNET,
+ TXT_UNKNOWN_CHAT_PROTOCOL,
+ TXT_UNKNOWN_CHATNET,
TXT_NOT_TOGGLE,
TXT_PERL_ERROR,
TXT_BIND_HEADER,
@@ -245,15 +245,15 @@ enum {
TXT_CONFIG_RELOADED,
TXT_CONFIG_MODIFIED,
TXT_GLIB_ERROR,
- TXT_OVERWRITE_CONFIG,
- TXT_SET_TITLE,
- TXT_SET_ITEM,
- TXT_SET_UNKNOWN,
+ TXT_OVERWRITE_CONFIG,
+ TXT_SET_TITLE,
+ TXT_SET_ITEM,
+ TXT_SET_UNKNOWN,
TXT_SET_NOT_BOOLEAN,
TXT_NO_COMPLETIONS,
- TXT_COMPLETION_REMOVED,
+ TXT_COMPLETION_REMOVED,
TXT_COMPLETION_HEADER,
- TXT_COMPLETION_LINE,
+ TXT_COMPLETION_LINE,
TXT_COMPLETION_FOOTER,
TXT_CAPSICUM_ENABLED,
TXT_CAPSICUM_DISABLED,
diff --git a/src/fe-text/term-terminfo.c b/src/fe-text/term-terminfo.c
index bca37efc..6645cfb0 100644
--- a/src/fe-text/term-terminfo.c
+++ b/src/fe-text/term-terminfo.c
@@ -629,6 +629,13 @@ void term_stop(void)
{
terminfo_stop(current_term);
kill(getpid(), SIGTSTP);
+ /* this call needs to stay here in case the TSTP was ignored,
+ because then we never see a CONT to call the restoration
+ code. On the other hand we also cannot remove the CONT
+ handler because then nothing would restore the screen when
+ Irssi is killed with TSTP/STOP from external. */
+ terminfo_cont(current_term);
+ irssi_redraw();
}
static int input_utf8(const unsigned char *buffer, int size, unichar *result)