1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-28 00:21:48 +03:00

Merge pull request #5428 from gstrauss/mbedtls_ssl_ciphersuite

Add accessors for ciphersuite info
This commit is contained in:
Manuel Pégourié-Gonnard
2022-01-24 11:13:31 +01:00
committed by GitHub
9 changed files with 79 additions and 5 deletions

View File

@ -2144,9 +2144,19 @@ int main( int argc, char *argv[] )
}
}
mbedtls_printf( " ok\n [ Protocol is %s ]\n [ Ciphersuite is %s ]\n",
mbedtls_ssl_get_version( &ssl ),
mbedtls_ssl_get_ciphersuite( &ssl ) );
{
int suite_id = mbedtls_ssl_get_ciphersuite_id_from_ssl( &ssl );
const mbedtls_ssl_ciphersuite_t *ciphersuite_info;
ciphersuite_info = mbedtls_ssl_ciphersuite_from_id( suite_id );
mbedtls_printf( " ok\n [ Protocol is %s ]\n"
" [ Ciphersuite is %s ]\n"
" [ Key size is %u ]\n",
mbedtls_ssl_get_version( &ssl ),
mbedtls_ssl_ciphersuite_get_name( ciphersuite_info ),
(unsigned int)
mbedtls_ssl_ciphersuite_get_cipher_key_bitlen( ciphersuite_info ) );
}
if( ( ret = mbedtls_ssl_get_record_expansion( &ssl ) ) >= 0 )
mbedtls_printf( " [ Record expansion is %d ]\n", ret );