fix ci fail without RSA_C
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
92339d25b4
commit
89107d1bc2
13
library/pk.c
13
library/pk.c
@ -544,11 +544,14 @@ int mbedtls_pk_sign_ext( mbedtls_pk_type_t pk_type,
|
||||
return( mbedtls_pk_sign( ctx, md_alg, hash, hash_len,
|
||||
sig, sig_size, sig_len, f_rng, p_rng ) );
|
||||
}
|
||||
|
||||
return( mbedtls_pk_psa_sign_ext( PSA_ALG_RSA_PSS(
|
||||
mbedtls_psa_translate_md( md_alg ) ),
|
||||
ctx->pk_ctx, hash, hash_len,
|
||||
sig, sig_size, sig_len ) );
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
return( mbedtls_pk_psa_rsa_sign_ext( PSA_ALG_RSA_PSS(
|
||||
mbedtls_psa_translate_md( md_alg ) ),
|
||||
ctx->pk_ctx, hash, hash_len,
|
||||
sig, sig_size, sig_len ) );
|
||||
#else /* MBEDTLS_RSA_C */
|
||||
return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE );
|
||||
#endif /* !MBEDTLS_RSA_C */
|
||||
|
||||
}
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
@ -197,10 +197,10 @@ static int rsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
int mbedtls_pk_psa_sign_ext( psa_algorithm_t psa_alg_md, void *pk_ctx,
|
||||
const unsigned char *hash, size_t hash_len,
|
||||
unsigned char *sig, size_t sig_size,
|
||||
size_t *sig_len )
|
||||
int mbedtls_pk_psa_rsa_sign_ext( psa_algorithm_t psa_alg_md, void *pk_ctx,
|
||||
const unsigned char *hash, size_t hash_len,
|
||||
unsigned char *sig, size_t sig_size,
|
||||
size_t *sig_len )
|
||||
{
|
||||
mbedtls_rsa_context * rsa = (mbedtls_rsa_context *) pk_ctx;
|
||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||
@ -269,10 +269,10 @@ static int rsa_sign_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
||||
return( MBEDTLS_ERR_PK_BAD_INPUT_DATA );
|
||||
#endif /* SIZE_MAX > UINT_MAX */
|
||||
|
||||
return( mbedtls_pk_psa_sign_ext( PSA_ALG_RSA_PKCS1V15_SIGN(
|
||||
mbedtls_psa_translate_md( md_alg ) ),
|
||||
ctx, hash, hash_len,
|
||||
sig, sig_size, sig_len ) );
|
||||
return( mbedtls_pk_psa_rsa_sign_ext( PSA_ALG_RSA_PKCS1V15_SIGN(
|
||||
mbedtls_psa_translate_md( md_alg ) ),
|
||||
ctx, hash, hash_len,
|
||||
sig, sig_size, sig_len ) );
|
||||
}
|
||||
#else
|
||||
static int rsa_sign_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
||||
|
@ -150,10 +150,12 @@ int mbedtls_pk_error_from_psa_ecdsa( psa_status_t status );
|
||||
int mbedtls_pk_error_from_psa_rsa( psa_status_t status );
|
||||
#endif
|
||||
|
||||
int mbedtls_pk_psa_sign_ext( psa_algorithm_t psa_alg_md, void *ctx,
|
||||
const unsigned char *hash, size_t hash_len,
|
||||
unsigned char *sig, size_t sig_size,
|
||||
size_t *sig_len );
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
int mbedtls_pk_psa_rsa_sign_ext( psa_algorithm_t psa_alg_md, void *ctx,
|
||||
const unsigned char *hash, size_t hash_len,
|
||||
unsigned char *sig, size_t sig_size,
|
||||
size_t *sig_len );
|
||||
#endif /* MBEDTLS_RSA_C */
|
||||
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user