You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.2 KiB
53 lines
1.2 KiB
1 year ago
|
From 72b6a5497df8757987dfedd6263346154adb921e Mon Sep 17 00:00:00 2001
|
||
|
From: Juergen Repp <juergen_repp@web.de>
|
||
|
Date: Mon, 6 Mar 2023 12:16:05 +0100
|
||
|
Subject: [PATCH 17/17] kdfa.c Fix problem with FORTIFY_SOURCE on Fedora
|
||
|
|
||
|
The original kdfa implementation did produce an error caused by the flags
|
||
|
-flto -_FORTIFY_SOURCE=3 on Fedora rawhide.
|
||
|
This error can be avoided by switching off the optimization with pragma.
|
||
|
Fixes: #3210.
|
||
|
|
||
|
Signed-off-by: Juergen Repp <juergen_repp@web.de>
|
||
|
---
|
||
|
lib/tpm2_kdfa.c | 19 +++++++++++++++++++
|
||
|
1 file changed, 19 insertions(+)
|
||
|
|
||
|
diff --git a/lib/tpm2_kdfa.c b/lib/tpm2_kdfa.c
|
||
|
index 5eb8d558..e97c06f6 100644
|
||
|
--- a/lib/tpm2_kdfa.c
|
||
|
+++ b/lib/tpm2_kdfa.c
|
||
|
@@ -13,6 +13,15 @@
|
||
|
#include "tpm2_kdfa.h"
|
||
|
#include "tpm2_openssl.h"
|
||
|
|
||
|
+/*
|
||
|
+ * Disable optimization because of an error in FORTIFY_SOURCE
|
||
|
+ */
|
||
|
+
|
||
|
+#ifdef _FORTIFY_SOURCE
|
||
|
+#pragma GCC push_options
|
||
|
+#pragma GCC optimize ("O0")
|
||
|
+#endif
|
||
|
+
|
||
|
TSS2_RC tpm2_kdfa(TPMI_ALG_HASH hash_alg, TPM2B *key, char *label,
|
||
|
TPM2B *context_u, TPM2B *context_v, UINT16 bits,
|
||
|
TPM2B_MAX_BUFFER *result_key) {
|
||
|
@@ -139,3 +148,13 @@ err:
|
||
|
|
||
|
return rval;
|
||
|
}
|
||
|
+#ifdef _FORTIFY_SOURCE
|
||
|
+
|
||
|
+#endif
|
||
|
+
|
||
|
+#ifdef _FORTIFY_SOURCE
|
||
|
+#pragma GCC pop_options
|
||
|
+#endif
|
||
|
+
|
||
|
+
|
||
|
+
|
||
|
--
|
||
|
2.40.1
|
||
|
|