1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-13 03:09:51 +03:00
aports/community/ibmswtpm2/openssl-3.5.patch
mio 09236d7f99 community/ibmswtpm2: support OpenSSL 3.5
Fix build error with openssl 3.5:

```
In file included from BnValues.h:324,
                 from Global.h:80,
                 from Tpm.h:78,
                 from ACTCommands.c:62:
TpmToOsslMath.h:83:5: error: #error Untested OpenSSL version
   83 | #   error Untested OpenSSL version
      |     ^~~~~
```
2025-04-27 07:21:06 +00:00

47 lines
2 KiB
Diff

The source code comment regarding supported OpenSSL versions states:
Check the bignum_st definition in crypto/bn/bn_lcl.h or
crypto/bn/bn_local.h and either update the version check or
provide the new definition for this version.
The definition of bignum_st has not changed in OpenSSL 3.1, 3.2, 3.3, 3.4 or 3.5.
Hence, we can update the version string to support OpenSSL 3.5.
Support for OpenSSL 3.4 is already included in the upstream Git as well.
See:
* https://sourceforge.net/p/ibmswtpm2/tpm2/ci/15501bf4973d334ca9420fa2fb0f0fe1800871e0
* https://sourceforge.net/p/ibmswtpm2/tpm2/ci/ebe82ac82fef97feddc558f3c3ad16baf67e6921
* https://sourceforge.net/p/ibmswtpm2/tpm2/ci/89a4cb9cf827af330603c3f4703d8ea7f11a383f
* https://sourceforge.net/p/ibmswtpm2/tpm2/ci/f27b517d27001bab423391190abce315bc19354c
diff -upr b/TpmToOsslMath.h a/TpmToOsslMath.h
--- b/TpmToOsslMath.h 2024-04-28 13:16:12.446802752 +0200
+++ a/TpmToOsslMath.h 2024-04-28 13:16:43.116886262 +0200
@@ -54,7 +54,7 @@
/* arising in any way out of use or reliance upon this specification or any */
/* information herein. */
/* */
-/* (c) Copyright IBM Corp. and others, 2016 - 2022 */
+/* (c) Copyright IBM Corp. and others, 2016 - 2023 */
/* */
/********************************************************************************/
@@ -72,10 +72,14 @@
#define SYMMETRIC_ALIGNMENT RADIX_BYTES
-#if OPENSSL_VERSION_NUMBER > 0x300000ffL
+/*
+ * As of release 3.0.0, OPENSSL_VERSION_NUMBER is a combination of the
+ * major (M), minor (NN) and patch (PP) version into a single integer 0xMNN00PP0L
+ */
+#if OPENSSL_VERSION_NUMBER > 0x30500ff0L
// Check the bignum_st definition in crypto/bn/bn_lcl.h or crypto/bn/bn_local.h and either update
// the version check or provide the new definition for this version.
-// Currently safe for all 3.0.n.a
+// Currently safe for all 3.5.x
# error Untested OpenSSL version
#elif OPENSSL_VERSION_NUMBER >= 0x10100000L
// from crypto/bn/bn_lcl.h
Only in a: TpmToOsslMath.h.orig