From 0dcca172bbe4128746ae199472b9a58d23ec9e9c Mon Sep 17 00:00:00 2001 From: Jan Bruckner Date: Thu, 8 Oct 2026 11:35:07 +0200 Subject: [PATCH 1/2] Add linkage guard to constant_time.h Signed-off-by: Jan Bruckner --- ChangeLog.d/add-linkage-guard.txt | 3 +++ include/mbedtls/constant_time.h | 8 ++++++++ 2 files changed, 11 insertions(+) create mode 100644 ChangeLog.d/add-linkage-guard.txt diff --git a/ChangeLog.d/add-linkage-guard.txt b/ChangeLog.d/add-linkage-guard.txt new file mode 100644 index 0000000000..3e710a6fe1 --- /dev/null +++ b/ChangeLog.d/add-linkage-guard.txt @@ -0,0 +1,3 @@ +Bugfix + Add extern "C" guard to constant_time.h. Fixes https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/930. + diff --git a/include/mbedtls/constant_time.h b/include/mbedtls/constant_time.h index d31bff677e..6ebcfbeb0b 100644 --- a/include/mbedtls/constant_time.h +++ b/include/mbedtls/constant_time.h @@ -11,6 +11,10 @@ #include +#ifdef __cplusplus +extern "C" { +#endif + /** Constant-time buffer comparison without branches. * * This is equivalent to the standard memcmp function, but is likely to be @@ -33,4 +37,8 @@ int mbedtls_ct_memcmp(const void *a, const void *b, size_t n); +#ifdef __cplusplus +} +#endif + #endif /* MBEDTLS_CONSTANT_TIME_H */ From 622b850ac5f25542ee5b3643231a57a7dce79de9 Mon Sep 17 00:00:00 2001 From: Jan Bruckner Date: Thu, 15 Oct 2026 15:10:28 +0200 Subject: [PATCH 2/2] Add linebreak to changelog entry Signed-off-by: Jan Bruckner --- ChangeLog.d/add-linkage-guard.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog.d/add-linkage-guard.txt b/ChangeLog.d/add-linkage-guard.txt index 3e710a6fe1..8a9ed51874 100644 --- a/ChangeLog.d/add-linkage-guard.txt +++ b/ChangeLog.d/add-linkage-guard.txt @@ -1,3 +1,4 @@ Bugfix - Add extern "C" guard to constant_time.h. Fixes https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/930. + * Add extern "C" guard to constant_time.h. Fixes + https://github.com/Mbed-TLS/TF-PSA-Crypto/issues/930.