aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorValerio Setti <valerio.setti@nordicsemi.no>2024-04-18 06:54:32 +0200
committerValerio Setti <valerio.setti@nordicsemi.no>2024-04-18 18:47:34 +0200
commit89f5af84affc07f01d2bae3797a2bd97dd3786b7 (patch)
tree226c5c8bcfe6f2faddc08e95b3ac43f7f8b36ec1 /include
parent68deadd455a9f37ec74bdf37f131dd0f456668a2 (diff)
downloadmbedtls-89f5af84affc07f01d2bae3797a2bd97dd3786b7.zip
mbedtls-89f5af84affc07f01d2bae3797a2bd97dd3786b7.tar.gz
mbedtls-89f5af84affc07f01d2bae3797a2bd97dd3786b7.tar.bz2
adjust_legacy_crypto: enable ASN1_[PARSE|WRITE]_C when RSA_C
RSA needs ASN1 functions to parse/write private and public keys, but there is no guards in the code for that. So we need to enable ASN1 support whenever RSA is enabled. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
Diffstat (limited to 'include')
-rw-r--r--include/mbedtls/config_adjust_legacy_crypto.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mbedtls/config_adjust_legacy_crypto.h b/include/mbedtls/config_adjust_legacy_crypto.h
index 9b06041..e477c07 100644
--- a/include/mbedtls/config_adjust_legacy_crypto.h
+++ b/include/mbedtls/config_adjust_legacy_crypto.h
@@ -293,6 +293,14 @@
#define MBEDTLS_ECP_LIGHT
#endif
+/* Backward compatibility: after #8740 the RSA module offers functions to parse
+ * and write RSA private/public keys without relying on the PK one. Of course
+ * this needs ASN1 support to do so, so we enable it here. */
+#if defined(MBEDTLS_RSA_C)
+#define MBEDTLS_ASN1_PARSE_C
+#define MBEDTLS_ASN1_WRITE_C
+#endif
+
/* MBEDTLS_PK_PARSE_EC_COMPRESSED is introduced in Mbed TLS version 3.5, while
* in previous version compressed points were automatically supported as long
* as PK_PARSE_C and ECP_C were enabled. As a consequence, for backward