136 |
|
|
137 |
|
#ifdef HAVE_LIBCRYPTO |
138 |
|
char * |
139 |
< |
ssl_get_cipher(SSL *ssl) |
139 |
> |
ssl_get_cipher(const SSL *ssl) |
140 |
|
{ |
141 |
< |
static char buffer[128]; |
142 |
< |
const char *name = NULL; |
143 |
< |
int bits; |
144 |
< |
|
145 |
< |
switch (ssl->session->ssl_version) |
146 |
< |
{ |
147 |
< |
case SSL2_VERSION: |
148 |
< |
name = "SSLv2"; |
149 |
< |
break; |
150 |
< |
|
151 |
< |
case SSL3_VERSION: |
152 |
< |
name = "SSLv3"; |
153 |
< |
break; |
154 |
< |
|
155 |
< |
case TLS1_VERSION: |
156 |
< |
name = "TLSv1"; |
157 |
< |
break; |
158 |
< |
|
159 |
< |
default: |
160 |
< |
name = "UNKNOWN"; |
161 |
< |
} |
141 |
> |
static char buffer[IRCD_BUFSIZE / 4]; |
142 |
> |
int bits = 0; |
143 |
|
|
144 |
|
SSL_CIPHER_get_bits(SSL_get_current_cipher(ssl), &bits); |
145 |
|
|
146 |
< |
snprintf(buffer, sizeof(buffer), "%s %s-%d", |
147 |
< |
name, SSL_get_cipher(ssl), bits); |
146 |
> |
snprintf(buffer, sizeof(buffer), "%s %s-%d", SSL_get_version(ssl), |
147 |
> |
SSL_get_cipher(ssl), bits); |
148 |
|
|
149 |
|
return buffer; |
150 |
|
} |