Use hash_info_get_size in ssl_tls12_client
This way the code does not rely on the MBEDTLS_MD_C define Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
a242e83b21
commit
0ce592169e
1 changed files with 6 additions and 5 deletions
|
@ -53,6 +53,8 @@
|
|||
#include "mbedtls/platform_util.h"
|
||||
#endif
|
||||
|
||||
#include "hash_info.h"
|
||||
|
||||
#if defined(MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED)
|
||||
int mbedtls_ssl_conf_has_static_psk( mbedtls_ssl_config const *conf )
|
||||
{
|
||||
|
@ -2453,14 +2455,13 @@ start_processing:
|
|||
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
|
||||
if( pk_alg == MBEDTLS_PK_RSASSA_PSS )
|
||||
{
|
||||
const mbedtls_md_info_t* md_info;
|
||||
mbedtls_pk_rsassa_pss_options rsassa_pss_options;
|
||||
rsassa_pss_options.mgf1_hash_id = md_alg;
|
||||
if( ( md_info = mbedtls_md_info_from_type( md_alg ) ) == NULL )
|
||||
{
|
||||
rsassa_pss_options.expected_salt_len =
|
||||
mbedtls_hash_info_get_size( md_alg );
|
||||
if( rsassa_pss_options.expected_salt_len == 0 )
|
||||
return( MBEDTLS_ERR_SSL_INTERNAL_ERROR );
|
||||
}
|
||||
rsassa_pss_options.expected_salt_len = mbedtls_md_get_size( md_info );
|
||||
|
||||
ret = mbedtls_pk_verify_ext( pk_alg, &rsassa_pss_options,
|
||||
peer_pk,
|
||||
md_alg, hash, hashlen,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue