Add preprocessor code, for compatibility with older mbedtls version, namely, now the inclusioin of header files in the private/ folder is conditional

Signed-off-by: Anton Matkin <[email protected]>
This commit is contained in:
Anton Matkin
2025-08-21 12:12:14 +02:00
parent cfd4b2cc53
commit 39b328e60b
13 changed files with 74 additions and 0 deletions
+4
View File
@@ -17,7 +17,11 @@
#if defined(MBEDTLS_BIGNUM_C)
#if MBEDTLS_VERSION_MAJOR >= 4
#include <mbedtls/private/bignum.h>
#else
#include <mbedtls/bignum.h>
#endif
#include <bignum_mod.h>
/** Allocate and populate a core MPI from a test case argument.
+4
View File
@@ -16,7 +16,11 @@
#include <psa/crypto_driver_common.h>
#include <psa/crypto.h>
#if MBEDTLS_MAJOR_VERSION >= 4
#include "mbedtls/private/cipher.h"
#else
#include "mbedtls/cipher.h"
#endif
typedef struct {
/* If non-null, on success, copy this to the output. */
+6
View File
@@ -51,7 +51,13 @@
#include <stdint.h>
#if defined(MBEDTLS_BIGNUM_C)
#if MBEDTLS_VERSION_MAJOR >= 4
#include "mbedtls/private/bignum.h"
#else
#include "mbedtls/bignum.h"
#endif
#endif
/** The type of test case arguments that contain binary data. */
+5
View File
@@ -17,7 +17,12 @@
#endif
#include <psa/crypto.h>
#if MBEDTLS_VERSION_MAJOR >= 4
#include <mbedtls/private/ctr_drbg.h>
#else
#include <mbedtls/ctr_drbg.h>
#endif
#if defined(MBEDTLS_PSA_CRYPTO_C)
/** Initialize the PSA Crypto subsystem. */