Skip to content

Commit 15318bc

Browse files
committed
lib-ssl-iostream: Return NULL from ssl_iostream_get_security_string when not handshaked
1 parent 3af7099 commit 15318bc

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/lib-ssl-iostream/iostream-openssl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ openssl_iostream_get_security_string(struct ssl_iostream *ssl_io)
860860
int bits, alg_bits;
861861

862862
if (!ssl_io->handshaked)
863-
return "";
863+
return NULL;
864864

865865
cipher = SSL_get_current_cipher(ssl_io->ssl);
866866
bits = SSL_CIPHER_get_bits(cipher, &alg_bits);

src/lib-ssl-iostream/iostream-ssl.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ const char *ssl_iostream_get_compression(struct ssl_iostream *ssl_io);
131131
provided.
132132
*/
133133
const char *ssl_iostream_get_server_name(struct ssl_iostream *ssl_io);
134+
/* Returns textual representation of the security parameters for the connection,
135+
or NULL if handshake has not been done. */
134136
const char *ssl_iostream_get_security_string(struct ssl_iostream *ssl_io);
135137

136138
/* Returns ClientHello based JA3 string. Will return NULL

0 commit comments

Comments
 (0)