Skip to content

Commit

Permalink
integration-tests: Enable access to mbedtls "private" fields
Browse files Browse the repository at this point in the history
Define the macro `MBEDTLS_ALLOW_PRIVATE_ACCESS` to avoid the build
failures caused while accessing private members of Mbed TLS structure
with Mbed TLS 3.6.0.

Signed-off-by: Devaraj Ranganna <[email protected]>
  • Loading branch information
urutva committed May 22, 2024
1 parent aa39f0b commit f87c60e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ set(PATCH_FILES
"${PATCH_FILES_DIRECTORY}/0001-Reduce-the-TRANSPORT_TEST_BUFFER_WRITABLE_LENGTH.patch"
"${PATCH_FILES_DIRECTORY}/0002-closefile-validsignature-test-Fix-test-bugs.patch"
"${PATCH_FILES_DIRECTORY}/0003-Increase-keep-alive-interval.patch"
"${PATCH_FILES_DIRECTORY}/0004-Enable-access-to-mbedtls-private-fields.patch"
)
iot_reference_arm_corstone3xx_apply_patches("${freertos_libraries_integration_tests_SOURCE_DIR}" "${PATCH_FILES}")

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From c5a51e721331175a3ea3f42093c4336ad2697889 Mon Sep 17 00:00:00 2001
From: Devaraj Ranganna <[email protected]>
Date: Tue, 21 May 2024 12:56:39 +0000
Subject: [PATCH] Enable access to mbedtls "private" fields

Define the macro `MBEDTLS_ALLOW_PRIVATE_ACCESS` so that, the Mbed TLS structure
fields that are marked as private are still accessible.

Signed-off-by: Devaraj Ranganna <[email protected]>
---
src/pkcs11/core_pkcs11_test.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/src/pkcs11/core_pkcs11_test.c b/src/pkcs11/core_pkcs11_test.c
index 71bad5a..6dcc8b5 100644
--- a/src/pkcs11/core_pkcs11_test.c
+++ b/src/pkcs11/core_pkcs11_test.c
@@ -32,6 +32,11 @@
#include <stdlib.h>
#include <string.h>

+/**
+ * @brief Declaring MBEDTLS_ALLOW_PRIVATE_ACCESS allows access to mbedtls "private" fields.
+ */
+#define MBEDTLS_ALLOW_PRIVATE_ACCESS
+
/* corePKCS11 includes. */
#include "core_pki_utils.h"
#include "core_pkcs11.h"
--
2.43.2

0 comments on commit f87c60e

Please sign in to comment.