mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-28 08:37:25 +00:00
Avoid dependency of PK on MD
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
parent
d8a298e1fc
commit
a370e06e30
@ -24,6 +24,8 @@
|
||||
#include "pk_wrap.h"
|
||||
#include "pkwrite.h"
|
||||
|
||||
#include "md_internal.h"
|
||||
|
||||
#include "mbedtls/platform_util.h"
|
||||
#include "mbedtls/error.h"
|
||||
|
||||
@ -358,15 +360,14 @@ int mbedtls_pk_can_do_ext( const mbedtls_pk_context *ctx, psa_algorithm_t alg,
|
||||
*/
|
||||
static inline int pk_hashlen_helper( mbedtls_md_type_t md_alg, size_t *hash_len )
|
||||
{
|
||||
const mbedtls_md_info_t *md_info;
|
||||
|
||||
if( *hash_len != 0 )
|
||||
return( 0 );
|
||||
|
||||
if( ( md_info = mbedtls_md_info_from_type( md_alg ) ) == NULL )
|
||||
*hash_len = mbedtls_md_internal_get_size( md_alg );
|
||||
|
||||
if( *hash_len == 0 )
|
||||
return( -1 );
|
||||
|
||||
*hash_len = mbedtls_md_get_size( md_info );
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user