mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-07-30 22:43:08 +03:00
Merge pull request #5532 from ronald-cron-arm/tls13_and_use_psa_crypto
Make TLS 1.3 compatible with MBEDTLS_USE_PSA_CRYPTO
This commit is contained in:
@ -7484,12 +7484,40 @@ int mbedtls_ssl_get_handshake_transcript( mbedtls_ssl_context *ssl,
|
||||
size_t dst_len,
|
||||
size_t *olen )
|
||||
{
|
||||
((void) ssl);
|
||||
((void) md);
|
||||
((void) dst);
|
||||
((void) dst_len);
|
||||
psa_status_t status = PSA_ERROR_CORRUPTION_DETECTED;
|
||||
psa_hash_operation_t *hash_operation_to_clone;
|
||||
psa_hash_operation_t hash_operation = psa_hash_operation_init();
|
||||
|
||||
*olen = 0;
|
||||
return( MBEDTLS_ERR_SSL_FEATURE_UNAVAILABLE);
|
||||
|
||||
switch( md )
|
||||
{
|
||||
#if defined(MBEDTLS_SHA384_C)
|
||||
case MBEDTLS_MD_SHA384:
|
||||
hash_operation_to_clone = &ssl->handshake->fin_sha384_psa;
|
||||
break;
|
||||
#endif
|
||||
|
||||
#if defined(MBEDTLS_SHA256_C)
|
||||
case MBEDTLS_MD_SHA256:
|
||||
hash_operation_to_clone = &ssl->handshake->fin_sha256_psa;
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
goto exit;
|
||||
}
|
||||
|
||||
status = psa_hash_clone( hash_operation_to_clone, &hash_operation );
|
||||
if( status != PSA_SUCCESS )
|
||||
goto exit;
|
||||
|
||||
status = psa_hash_finish( &hash_operation, dst, dst_len, olen );
|
||||
if( status != PSA_SUCCESS )
|
||||
goto exit;
|
||||
|
||||
exit:
|
||||
return( psa_ssl_status_to_mbedtls( status ) );
|
||||
}
|
||||
#else /* MBEDTLS_USE_PSA_CRYPTO */
|
||||
|
||||
|
Reference in New Issue
Block a user