tls: added tls_cipher_name()

This commit is contained in:
Richard Aas 2016-03-07 13:25:47 +00:00
parent f62154f42a
commit e87b0df7a9
2 changed files with 17 additions and 0 deletions

View file

@ -42,6 +42,7 @@ int tls_peer_verify(const struct tls_conn *tc);
int tls_srtp_keyinfo(const struct tls_conn *tc, enum srtp_suite *suite,
uint8_t *cli_key, size_t cli_key_size,
uint8_t *srv_key, size_t srv_key_size);
const char *tls_cipher_name(const struct tls_conn *tc);
/* TCP */

View file

@ -644,3 +644,19 @@ int tls_srtp_keyinfo(const struct tls_conn *tc, enum srtp_suite *suite,
return ENOSYS;
#endif
}
/**
* Get cipher name of a TLS connection
*
* @param tc TLS Connection
*
* @return name of cipher actually used or NULL, if session is not established.
*/
const char *tls_cipher_name(const struct tls_conn *tc)
{
if (!tc)
return NULL;
return SSL_get_cipher_name(tc->ssl);
}