mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-21 15:41:00 +00:00
Add comment about version 1 PKCS8 keys not containing a public key
Signed-off-by: Jethro Beekman <jethro@fortanix.com>
This commit is contained in:
parent
0167244be4
commit
2e662c6f97
@ -590,6 +590,9 @@ static int pk_parse_key_rfc8410_der(mbedtls_ecp_keypair *eck,
|
|||||||
return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_PK_KEY_INVALID_FORMAT, ret);
|
return MBEDTLS_ERROR_ADD(MBEDTLS_ERR_PK_KEY_INVALID_FORMAT, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pk_parse_key_pkcs8_unencrypted_der() only supports version 1 PKCS8 keys,
|
||||||
|
// which never contain a public key. As such, derive the public key
|
||||||
|
// unconditionally.
|
||||||
if ((ret = pk_derive_public_key(eck, key, len, f_rng, p_rng)) != 0) {
|
if ((ret = pk_derive_public_key(eck, key, len, f_rng, p_rng)) != 0) {
|
||||||
mbedtls_ecp_keypair_free(eck);
|
mbedtls_ecp_keypair_free(eck);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user