mirror of
https://github.com/cuberite/polarssl.git
synced 2025-12-11 08:18:49 -05:00
pk no longer needs pk_write for ECDSA with MBEDTLS_USE_PSA_CRYPTO
The dependency is still useful for RSA, for which PSA encodes keys with an ASN.1 structure. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
13caa94746
commit
bbccdd485c
@ -82,21 +82,9 @@
|
|||||||
|
|
||||||
/* The PK wrappers need pk_write functions to format RSA key objects
|
/* The PK wrappers need pk_write functions to format RSA key objects
|
||||||
* when they are dispatching to the PSA API. This happens under USE_PSA_CRYPTO,
|
* when they are dispatching to the PSA API. This happens under USE_PSA_CRYPTO,
|
||||||
* and also even without USE_PSA_CRYPTO for mbedtls_pk_sign_ext().
|
* and also even without USE_PSA_CRYPTO for mbedtls_pk_sign_ext(). */
|
||||||
* PSA crypto also needs pk_write to export RSA keys (otherwise the build
|
#if defined(MBEDTLS_PK_C) && defined(MBEDTLS_PSA_CRYPTO_C) && \
|
||||||
* goes through but psa_export_key() and psa_export_public_key() fail on
|
defined(MBEDTLS_RSA_C)
|
||||||
* RSA keys), and pk_parse to work with RSA keys in almost any way.
|
|
||||||
*/
|
|
||||||
#if defined(MBEDTLS_PSA_CRYPTO_C) && defined(MBEDTLS_RSA_C)
|
|
||||||
#define MBEDTLS_PK_C
|
|
||||||
#define MBEDTLS_PK_WRITE_C
|
|
||||||
#define MBEDTLS_PK_PARSE_C
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Under MBEDTLS_USE_PSA_CRYPTO, the pk module needs pk_write functions
|
|
||||||
* to pass ECC keys to PSA. */
|
|
||||||
#if defined(MBEDTLS_PK_C) && \
|
|
||||||
defined(MBEDTLS_USE_PSA_CRYPTO) && defined(MBEDTLS_ECP_C)
|
|
||||||
#define MBEDTLS_PK_WRITE_C
|
#define MBEDTLS_PK_WRITE_C
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user