mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-07 06:42:56 +03:00
pkparse: always check all private keys on import
This allows to remove explicit calls to mbedtls_ecp_check_privkey() in pkparse.c. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
@@ -666,14 +666,6 @@ static int pk_parse_key_rfc8410_der(mbedtls_pk_context *pk,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* When MBEDTLS_PK_USE_PSA_EC_DATA the key is checked while importing it
|
||||
* into PSA. */
|
||||
#if !defined(MBEDTLS_PK_USE_PSA_EC_DATA)
|
||||
if ((ret = mbedtls_ecp_check_privkey(&eck->grp, &eck->d)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
#endif /* !MBEDTLS_PK_USE_PSA_EC_DATA */
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* MBEDTLS_PK_HAVE_RFC8410_CURVES */
|
||||
@@ -1310,12 +1302,6 @@ static int pk_parse_key_sec1_der(mbedtls_pk_context *pk,
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(MBEDTLS_PK_USE_PSA_EC_DATA)
|
||||
if ((ret = mbedtls_ecp_check_privkey(&eck->grp, &eck->d)) != 0) {
|
||||
return ret;
|
||||
}
|
||||
#endif /* !MBEDTLS_PK_USE_PSA_EC_DATA */
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif /* MBEDTLS_PK_HAVE_ECC_KEYS */
|
||||
|
Reference in New Issue
Block a user