Updates to cleanup fixes for #3294

Minor updates to changelog for more concise wording and fixed styling
in other files as needed.

Signed-off-by: John Durkop <john.durkop@fermatsoftware.com>
This commit is contained in:
John Durkop 2020-08-24 08:29:39 -07:00
parent c14be901eb
commit af5363c24e
2 changed files with 6 additions and 10 deletions

View file

@ -1,8 +1,4 @@
Bugfix Bugfix
* Add guards in pk_wrap.c to ensure if ECDSA is not defined, errors are * Fix build failure in configurations where MBEDTLS_USE_PSA_CRYPTO is
returned. Remove warnings in pk.c for unused variables. Add new test enabled but ECDSA is disabled. Contributed by jdurkop. Fixes #3294.
(test_depends_pkalgs_psa) to all.sh to confirm when USE_PSA_CRYPTO
is defined that features are working properly. Fixes issue reported in
#3294 where undefined reference errors occur when using USE_PSA_CRYPTO
and removing ECDSA support.

View file

@ -34,7 +34,7 @@
#include "mbedtls/ecp.h" #include "mbedtls/ecp.h"
#endif #endif
#if defined(MBEDTLS_ECDSA_C) || defined(MBEDTLS_USE_PSA_CRYPTO) #if defined(MBEDTLS_ECDSA_C)
#include "mbedtls/ecdsa.h" #include "mbedtls/ecdsa.h"
#endif #endif
@ -1012,8 +1012,8 @@ static int pk_opaque_sign_wrap( void *ctx, mbedtls_md_type_t md_alg,
((void) sig_len); ((void) sig_len);
((void) f_rng); ((void) f_rng);
((void) p_rng); ((void) p_rng);
return( PSA_ERROR_NOT_SUPPORTED ); return( MBEDTLS_ERR_PK_FEATURE_UNAVAILABLE );
#else #else /* !MBEDTLS_ECDSA_C */
const psa_key_handle_t *key = (const psa_key_handle_t *) ctx; const psa_key_handle_t *key = (const psa_key_handle_t *) ctx;
psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT; psa_key_attributes_t attributes = PSA_KEY_ATTRIBUTES_INIT;
psa_algorithm_t alg = PSA_ALG_ECDSA( mbedtls_psa_translate_md( md_alg ) ); psa_algorithm_t alg = PSA_ALG_ECDSA( mbedtls_psa_translate_md( md_alg ) );
@ -1044,7 +1044,7 @@ static int pk_opaque_sign_wrap( void *ctx, mbedtls_md_type_t md_alg,
/* transcode it to ASN.1 sequence */ /* transcode it to ASN.1 sequence */
return( pk_ecdsa_sig_asn1_from_psa( sig, sig_len, buf_len ) ); return( pk_ecdsa_sig_asn1_from_psa( sig, sig_len, buf_len ) );
#endif #endif /* !MBEDTLS_ECDSA_C */
} }
const mbedtls_pk_info_t mbedtls_pk_opaque_info = { const mbedtls_pk_info_t mbedtls_pk_opaque_info = {