Skip to content

Commit

Permalink
ssl_tls12_populate_transform using PSA_ALG_AEAD
Browse files Browse the repository at this point in the history
- ssl_tls12_populate_transform using PSA_ALG_AEAD_WITH_SHORTENED_TAG()
  instead of calling mbedtls_ssl_cipher_to_psa()

Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com>
  • Loading branch information
gstrauss committed Nov 15, 2022
1 parent 92d69b9 commit ae71576
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/ssl_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -7492,12 +7492,14 @@ static int ssl_tls12_populate_transform( mbedtls_ssl_transform *transform,

if( ssl_mode == MBEDTLS_SSL_MODE_AEAD )
{
transform->taglen =
ciphersuite_info->flags & MBEDTLS_CIPHERSUITE_SHORT_TAG ? 8 : 16;
transform->taglen = 16;
if ( ciphersuite_info->flags & MBEDTLS_CIPHERSUITE_SHORT_TAG )
{
transform->taglen = 8;
#if defined(MBEDTLS_USE_PSA_CRYPTO)
mbedtls_ssl_cipher_to_psa( ciphersuite_info->cipher, transform->taglen,
&alg, &key_type, &key_bits );
alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG( alg, 8 );
#endif /* MBEDTLS_USE_PSA_CRYPTO */
}
}
#if defined(MBEDTLS_SSL_SOME_SUITES_USE_CBC_ETM)
else
Expand Down

0 comments on commit ae71576

Please sign in to comment.