diff options
author | TheLemonMan <LemonBoy@users.noreply.github.com> | 2016-03-17 22:07:57 +0100 |
---|---|---|
committer | TheLemonMan <LemonBoy@users.noreply.github.com> | 2016-03-17 22:07:57 +0100 |
commit | 795b7de80891d51adfb912798ca954431cbf702b (patch) | |
tree | 8a3678eb35ac611e4acf929e8f7dd7b3e39dd530 /src | |
parent | 49bdd179b2663d3853b38673f93df97c994f0dae (diff) | |
parent | 8ab6bdf2ce884fa7363272805287c341b2b2fb01 (diff) | |
download | irssi-795b7de80891d51adfb912798ca954431cbf702b.zip |
Merge pull request #439 from horgh/ssl-errors
Clear error queue before SSL I/O operations
Diffstat (limited to 'src')
-rw-r--r-- | src/core/network-openssl.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/network-openssl.c b/src/core/network-openssl.c index 465c4154..a18e6fc7 100644 --- a/src/core/network-openssl.c +++ b/src/core/network-openssl.c @@ -289,6 +289,7 @@ static GIOStatus irssi_ssl_read(GIOChannel *handle, gchar *buf, gsize len, gsize const char *errstr; gchar *errmsg; + ERR_clear_error(); ret1 = SSL_read(chan->ssl, buf, len); if(ret1 <= 0) { @@ -334,6 +335,7 @@ static GIOStatus irssi_ssl_write(GIOChannel *handle, const gchar *buf, gsize len const char *errstr; gchar *errmsg; + ERR_clear_error(); ret1 = SSL_write(chan->ssl, (const char *)buf, len); if(ret1 <= 0) { @@ -471,6 +473,7 @@ static GIOChannel *irssi_ssl_get_iochannel(GIOChannel *handle, int port, SERVER_ if(!(fd = g_io_channel_unix_get_fd(handle))) return NULL; + ERR_clear_error(); ctx = SSL_CTX_new(SSLv23_client_method()); if (ctx == NULL) { g_error("Could not allocate memory for SSL context"); @@ -489,6 +492,7 @@ static GIOChannel *irssi_ssl_get_iochannel(GIOChannel *handle, int port, SERVER_ scert = convert_home(mycert); if (mypkey && *mypkey) spkey = convert_home(mypkey); + ERR_clear_error(); if (! SSL_CTX_use_certificate_file(ctx, scert, SSL_FILETYPE_PEM)) g_warning("Loading of client certificate '%s' failed: %s", mycert, ERR_reason_error_string(ERR_get_error())); else if (! SSL_CTX_use_PrivateKey_file(ctx, spkey ? spkey : scert, SSL_FILETYPE_PEM)) @@ -581,6 +585,7 @@ int irssi_ssl_handshake(GIOChannel *handle) X509 *cert; const char *errstr; + ERR_clear_error(); ret = SSL_connect(chan->ssl); if (ret <= 0) { err = SSL_get_error(chan->ssl, ret); |