mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-25 21:05:37 +00:00
Add OAEP placeholders in asymmetric encrypt/decrypt
Replace PSS placeholders by OAEP placeholders. PSS is a signature algorithm, not an encryption algorithm. Fix typo in PSA_ALG_IS_RSA_OAEP_MGF1.
This commit is contained in:
parent
8b18a4fef3
commit
625b01c9c3
|
@ -336,7 +336,7 @@ typedef uint32_t psa_algorithm_t;
|
||||||
#define PSA_ALG_RSA_OAEP_MGF1(hash_alg) \
|
#define PSA_ALG_RSA_OAEP_MGF1(hash_alg) \
|
||||||
(PSA_ALG_RSA_OAEP_MGF1_RAW | ((hash_alg) & PSA_ALG_HASH_MASK))
|
(PSA_ALG_RSA_OAEP_MGF1_RAW | ((hash_alg) & PSA_ALG_HASH_MASK))
|
||||||
#define PSA_ALG_IS_RSA_OAEP_MGF1(alg) \
|
#define PSA_ALG_IS_RSA_OAEP_MGF1(alg) \
|
||||||
(((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_OAEP_MGF1_RAW)
|
(((alg) & ~PSA_ALG_HASH_MASK) == PSA_ALG_RSA_OAEP_MGF1_BASE)
|
||||||
#define PSA_ALG_RSA_GET_HASH(alg) \
|
#define PSA_ALG_RSA_GET_HASH(alg) \
|
||||||
(((alg) & PSA_ALG_HASH_MASK) | PSA_ALG_CATEGORY_HASH)
|
(((alg) & PSA_ALG_HASH_MASK) | PSA_ALG_CATEGORY_HASH)
|
||||||
|
|
||||||
|
|
|
@ -1458,7 +1458,7 @@ psa_status_t psa_asymmetric_encrypt( psa_key_slot_t key,
|
||||||
else
|
else
|
||||||
#endif /* MBEDTLS_PKCS1_V15 */
|
#endif /* MBEDTLS_PKCS1_V15 */
|
||||||
#if defined(MBEDTLS_PKCS1_V21)
|
#if defined(MBEDTLS_PKCS1_V21)
|
||||||
if( alg == PSA_ALG_RSA_PSS_MGF1 )
|
if( PSA_ALG_IS_RSA_OAEP_MGF1( alg ) )
|
||||||
{
|
{
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
}
|
}
|
||||||
|
@ -1535,7 +1535,7 @@ psa_status_t psa_asymmetric_decrypt( psa_key_slot_t key,
|
||||||
else
|
else
|
||||||
#endif /* MBEDTLS_PKCS1_V15 */
|
#endif /* MBEDTLS_PKCS1_V15 */
|
||||||
#if defined(MBEDTLS_PKCS1_V21)
|
#if defined(MBEDTLS_PKCS1_V21)
|
||||||
if( alg == PSA_ALG_RSA_PSS_MGF1 )
|
if( PSA_ALG_IS_RSA_OAEP_MGF1( alg ) )
|
||||||
{
|
{
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue