lkml.org 
[lkml]   [2021]   [Mar]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH RESEND 2/3] x86/sgx: Fix compatibility issue with OPENSSL < 1.1.0
Date
The `RSA_get0_key` function only got introduced in OpenSSL 1.1.0. This makes compilation fail with older versions.

Signed-off-by: Raoul Strackx <raoul.strackx@fortanix.com>
---
tools/testing/selftests/sgx/sigstruct.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/sgx/sigstruct.c b/tools/testing/selftests/sgx/sigstruct.c
index dee7a3d..aac9cbc 100644
--- a/tools/testing/selftests/sgx/sigstruct.c
+++ b/tools/testing/selftests/sgx/sigstruct.c
@@ -128,8 +128,11 @@ static bool check_crypto_errors(void)
static inline const BIGNUM *get_modulus(RSA *key)
{
const BIGNUM *n;
-
+#if OPENSSL_VERSION_NUMBER >= 0x10100000L
RSA_get0_key(key, &n, NULL, NULL);
+#else
+ n = key->n;
+#endif
return n;
}

--
2.7.4
\
 
 \ /
  Last update: 2021-03-31 14:53    [W:0.035 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site