Implement x509_profile_check_key() for TinyCrypt-based PK context

This commit is contained in:
Hanno Becker 2019-08-21 15:25:22 +01:00
parent 06e2bf6d01
commit d931ad2aca

View file

@ -597,6 +597,16 @@ static int x509_profile_check_key( const mbedtls_x509_crt_profile *profile,
}
#endif
#if defined(MBEDTLS_USE_TINYCRYPT)
if( pk_alg == MBEDTLS_PK_ECKEY )
{
if( ( profile->allowed_curves & MBEDTLS_UECC_DP_SECP256R1 ) != 0 )
return( 0 );
return( -1 );
}
#endif /* MBEDTLS_USE_TINYCRYPT */
#if defined(MBEDTLS_ECP_C)
if( pk_alg == MBEDTLS_PK_ECDSA ||
pk_alg == MBEDTLS_PK_ECKEY ||