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
1 changed files with 5 additions and 4 deletions
|
@ -24,6 +24,8 @@
|
||||||
#include "pk_wrap.h"
|
#include "pk_wrap.h"
|
||||||
#include "pkwrite.h"
|
#include "pkwrite.h"
|
||||||
|
|
||||||
|
#include "md_internal.h"
|
||||||
|
|
||||||
#include "mbedtls/platform_util.h"
|
#include "mbedtls/platform_util.h"
|
||||||
#include "mbedtls/error.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 )
|
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 )
|
if( *hash_len != 0 )
|
||||||
return( 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 );
|
return( -1 );
|
||||||
|
|
||||||
*hash_len = mbedtls_md_get_size( md_info );
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue