diff options
author | erdgeist <de@gsmk.de> | 2014-04-15 14:42:24 +0200 |
---|---|---|
committer | erdgeist <de@gsmk.de> | 2014-04-15 14:42:24 +0200 |
commit | 66a81e9382c8503a48db8f82aeb59b6c612c4964 (patch) | |
tree | 78c9d53aa810154d5ef0f9215d86357b364c2643 /vchat-ssl.c | |
parent | 7e81cd818c751e0f75b2c637e37356485e1e71ef (diff) | |
parent | 19375e6c61bfe3bf643786b0e7318c528e4b22a0 (diff) |
Display cipher list, thanks to count
Diffstat (limited to 'vchat-ssl.c')
-rwxr-xr-x | vchat-ssl.c | 18 |
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)); |