fix various issues
Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
parent
848ecce990
commit
406cf27cb5
@ -537,7 +537,7 @@ int mbedtls_pk_sign( mbedtls_pk_context *ctx, mbedtls_md_type_t md_alg,
|
||||
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
/**
|
||||
* \brief Make signature with input pk type. not the type of \p ctx .
|
||||
* \brief Make signature given a signature type.
|
||||
*
|
||||
* \param pk_type Signature type.
|
||||
* \param ctx The PK context to use. It must have been set up
|
||||
|
@ -277,13 +277,11 @@ static inline psa_key_type_t mbedtls_psa_parse_tls_ecc_group(
|
||||
}
|
||||
#endif /* MBEDTLS_ECP_C */
|
||||
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
/* Expose whatever RNG the PSA subsystem uses to applications using the
|
||||
* mbedtls_xxx API. The declarations and definitions here need to be
|
||||
* consistent with the implementation in library/psa_crypto_random_impl.h.
|
||||
* See that file for implementation documentation. */
|
||||
#if defined(MBEDTLS_PSA_CRYPTO_C)
|
||||
|
||||
|
||||
/* The type of a `f_rng` random generator function that many library functions
|
||||
* take.
|
||||
@ -363,6 +361,6 @@ extern mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state;
|
||||
|
||||
#endif /* !defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) */
|
||||
|
||||
#endif /* defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3) */
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
#endif /* MBEDTLS_PSA_UTIL_H */
|
||||
|
@ -545,14 +545,10 @@ int mbedtls_pk_sign_ext( mbedtls_pk_type_t pk_type,
|
||||
sig, sig_size, sig_len, f_rng, p_rng ) );
|
||||
}
|
||||
|
||||
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
|
||||
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 ) );
|
||||
#else /* MBEDTLS_X509_RSASSA_PSS_SUPPORT */
|
||||
return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE );
|
||||
#endif /* !MBEDTLS_X509_RSASSA_PSS_SUPPORT */
|
||||
|
||||
}
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
@ -251,7 +251,7 @@ cleanup:
|
||||
ret = mbedtls_pk_error_from_psa( status );
|
||||
return( ret );
|
||||
}
|
||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
static int rsa_sign_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
||||
|
@ -155,6 +155,6 @@ int mbedtls_pk_psa_sign_ext( psa_algorithm_t psa_alg_md, void *ctx,
|
||||
unsigned char *sig, size_t sig_size,
|
||||
size_t *sig_len );
|
||||
|
||||
#endif /* MBEDTLS_USE_PSA_CRYPTO */
|
||||
#endif /* MBEDTLS_PSA_CRYPTO_C */
|
||||
|
||||
#endif /* MBEDTLS_PK_WRAP_H */
|
||||
|
@ -1129,7 +1129,6 @@ static int ssl_tls13_write_certificate_verify_body( mbedtls_ssl_context *ssl,
|
||||
pk_type = MBEDTLS_PK_ECDSA;
|
||||
break;
|
||||
#endif /* MBEDTLS_ECDSA_C */
|
||||
#if defined(MBEDTLS_X509_RSASSA_PSS_SUPPORT)
|
||||
case MBEDTLS_TLS1_3_SIG_RSA_PSS_RSAE_SHA256:
|
||||
md_alg = MBEDTLS_MD_SHA256;
|
||||
pk_type = MBEDTLS_PK_RSASSA_PSS;
|
||||
@ -1142,7 +1141,6 @@ static int ssl_tls13_write_certificate_verify_body( mbedtls_ssl_context *ssl,
|
||||
md_alg = MBEDTLS_MD_SHA512;
|
||||
pk_type = MBEDTLS_PK_RSASSA_PSS;
|
||||
break;
|
||||
#endif /* MBEDTLS_X509_RSASSA_PSS_SUPPORT */
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user