mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-01-30 15:32:58 +00:00
pk_wrap: fix algorithm selection in rsa_opaque_sign_wrap()
Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
d971b7834b
commit
4f3262de2d
@ -1508,10 +1508,11 @@ static int rsa_opaque_sign_wrap(mbedtls_pk_context *pk, mbedtls_md_type_t md_alg
|
||||
}
|
||||
|
||||
type = psa_get_key_type(&attributes);
|
||||
alg = psa_get_key_algorithm(&attributes);
|
||||
psa_reset_key_attributes(&attributes);
|
||||
|
||||
if (PSA_KEY_TYPE_IS_RSA(type)) {
|
||||
alg = PSA_ALG_RSA_PKCS1V15_SIGN(mbedtls_md_psa_alg_from_type(md_alg));
|
||||
alg = (alg & ~PSA_ALG_HASH_MASK) | mbedtls_md_psa_alg_from_type(md_alg);
|
||||
} else {
|
||||
return MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user