1 /* 2 * SPDX-License-Identifier: Apache-2.0 3 * 4 * Copyright (c) 2021 Arm Limited 5 */ 6 7 #ifndef __BOOTUTIL_CRYPTO_COMMON_H__ 8 #define __BOOTUTIL_CRYPTO_COMMON_H__ 9 10 /* The check below can be performed even for those cases 11 * where MCUBOOT_USE_MBED_TLS has not been defined 12 */ 13 #include "mbedtls/version.h" 14 #if MBEDTLS_VERSION_NUMBER >= 0x03000000 15 #define MBEDTLS_CONTEXT_MEMBER(X) MBEDTLS_PRIVATE(X) 16 #else 17 #define MBEDTLS_CONTEXT_MEMBER(X) X 18 #endif 19 20 /* Newer versions of Mbed TLS have removed the private accessor requirement for 21 * the ASN1 fields. 22 */ 23 #if (MBEDTLS_VERSION_NUMBER >= 0x03000000) && (MBEDTLS_VERSION_NUMBER < 0x03010000) 24 #define ASN1_CONTEXT_MEMBER(X) MBEDTLS_PRIVATE(X) 25 #else 26 #define ASN1_CONTEXT_MEMBER(X) X 27 #endif 28 29 #endif /* __BOOTUTIL_CRYPTO_COMMON_H__ */ 30