summaryrefslogtreecommitdiff
path: root/vchat-ssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'vchat-ssl.c')
-rwxr-xr-xvchat-ssl.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/vchat-ssl.c b/vchat-ssl.c
index 41b0278..64886ca 100755
--- a/vchat-ssl.c
+++ b/vchat-ssl.c
@@ -137,8 +137,24 @@ int vc_connect_ssl( BIO **conn, vc_x509store_t *vc_store )
137 BIO_push( ssl_conn, *conn ); 137 BIO_push( ssl_conn, *conn );
138 *conn = ssl_conn; 138 *conn = ssl_conn;
139 fflush(stdout); 139 fflush(stdout);
140 if( BIO_do_handshake( *conn ) > 0 ) 140 if( BIO_do_handshake( *conn ) > 0 ) {
141 /* Show information about cipher used */
142 const SSL *sslp = NULL;
143 const SSL_CIPHER * cipher = NULL;
144
145 /* Get cipher object */
146 BIO_get_ssl(ssl_conn, &sslp);
147 cipher = SSL_get_current_cipher(sslp);
148 if (cipher) {
149 char cipher_desc[TMPSTRSIZE];
150 snprintf(tmpstr, TMPSTRSIZE, "[SSL CIPHER] %s", SSL_CIPHER_description(cipher, cipher_desc, TMPSTRSIZE));
151 writecf(FS_SERV, tmpstr);
152 } else {
153 snprintf(tmpstr, TMPSTRSIZE, "[SSL ERROR] Cipher not known / SSL object can't be queried!");
154 writecf(FS_ERR, tmpstr);
155 }
141 return 0; 156 return 0;
157 }
142 } 158 }
143 159
144 snprintf(tmpstr, TMPSTRSIZE, "[SSL ERROR] %s", ERR_error_string (ERR_get_error (), NULL)); 160 snprintf(tmpstr, TMPSTRSIZE, "[SSL ERROR] %s", ERR_error_string (ERR_get_error (), NULL));