mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
OpenSSL: Add tls_connection_get_cipher_suite()
This can be used to fetch the 16-bit TLS cipher suite identifier. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
063d28ec83
commit
94714ec341
@ -659,4 +659,11 @@ void tls_connection_remove_session(struct tls_connection *conn);
|
||||
*/
|
||||
int tls_get_tls_unique(struct tls_connection *conn, u8 *buf, size_t max_len);
|
||||
|
||||
/**
|
||||
* tls_connection_get_cipher_suite - Get current TLS cipher suite
|
||||
* @conn: Connection context data from tls_connection_init()
|
||||
* Returns: TLS cipher suite of the current connection or 0 on error
|
||||
*/
|
||||
u16 tls_connection_get_cipher_suite(struct tls_connection *conn);
|
||||
|
||||
#endif /* TLS_H */
|
||||
|
@ -5354,3 +5354,14 @@ int tls_get_tls_unique(struct tls_connection *conn, u8 *buf, size_t max_len)
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
|
||||
u16 tls_connection_get_cipher_suite(struct tls_connection *conn)
|
||||
{
|
||||
const SSL_CIPHER *cipher;
|
||||
|
||||
cipher = SSL_get_current_cipher(conn->ssl);
|
||||
if (!cipher)
|
||||
return 0;
|
||||
return SSL_CIPHER_get_protocol_id(cipher);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user