@@ -14,52 +14,49 @@ Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Signed-off-by: Vincent Fazio <vfazio@gmail.com>
[Bernd: rebased for git rev 5452af422edeff70fcae8ea99dd28a0922051d7b]
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
+[Fabrice: rebase for rev183-2024-03-27]
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
src/LibSupport.h | 21 +++------------------
src/TcpServerPosix.c | 1 +
src/makefile | 2 ++
3 files changed, 6 insertions(+), 18 deletions(-)
-diff --git a/src/LibSupport.h b/src/LibSupport.h
+diff --git a/src/tpm_radix.h b/src/tpm_radix.h
index 5055560..48b1e16 100644
---- a/src/LibSupport.h
-+++ b/src/LibSupport.h
-@@ -64,32 +64,9 @@
- #ifndef _LIB_SUPPORT_H_
- #define _LIB_SUPPORT_H_
-
--/* kgold added power and s390 */
+--- a/src/tpm_radix.h
++++ b/src/tpm_radix.h
+@@ -61,27 +61,9 @@
+ //** Introduction
+ // Common defines for supporting large numbers and cryptographic buffer sizing.
+ //*********************
-#ifndef RADIX_BITS
--# if defined(__x86_64__) || defined(__x86_64) \
-- || defined(__amd64__) || defined(__amd64) \
-- || defined(_WIN64) || defined(_M_X64) \
-- || defined(_M_ARM64) || defined(__aarch64__) \
-- || defined(__powerpc64__) || defined(__PPC64__) || defined(__ppc64__) \
-- || defined(__s390x__)
--# define RADIX_BITS 64
--# elif defined(__i386__) || defined(__i386) || defined(i386) \
-- || defined(_WIN32) || defined(_M_IX86) \
-- || defined(_M_ARM) || defined(__arm__) || defined(__thumb__) \
-- || defined(__powerpc__) || defined(__PPC__)
--# define RADIX_BITS 32
--# elif defined(__riscv) || defined(__riscv__)
--# if __riscv_xlen == 32
--# define RADIX_BITS 32
--# elif __riscv_xlen == 64
--# define RADIX_BITS 64
--# else
--# error Unsupported __riscv_xlen value
--# endif
--# else
--# error Unable to determine RADIX_BITS from compiler environment
--# endif
--#endif // RADIX_BITS
+-# if defined(__x86_64__) || defined(__x86_64) || defined(__amd64__) \
+- || defined(__amd64) || defined(_WIN64) || defined(_M_X64) || defined(_M_ARM64) \
+- || defined(__aarch64__) || defined(__PPC64__) || defined(__s390x__) \
+- || defined(__powerpc64__) || defined(__ppc64__)
+-# define RADIX_BITS 64
+-# elif defined(__i386__) || defined(__i386) || defined(i386) || defined(_WIN32) \
+- || defined(_M_IX86)
+-# define RADIX_BITS 32
+-# elif defined(_M_ARM) || defined(__arm__) || defined(__thumb__)
+-# define RADIX_BITS 32
+-# elif defined(__riscv)
+-// __riscv and __riscv_xlen are standardized by the RISC-V community and should be available
+-// on any compliant compiler.
+-//
+-// https://github.com/riscv-non-isa/riscv-toolchain-conventions
+-# define RADIX_BITS __riscv_xlen
+-# else
+-# error Unable to determine RADIX_BITS from compiler environment
+-# endif
+-#endif // RADIX_BITS
+#include <limits.h>
+
+#define RADIX_BITS LONG_BIT
- // These macros use the selected libraries to the proper include files.
- #define LIB_QUOTE(_STRING_) #_STRING_
+ #if RADIX_BITS == 64
+ # define RADIX_BYTES 8
diff --git a/src/TcpServerPosix.c b/src/TcpServerPosix.c
index cad0402..6293cdd 100644
--- a/src/TcpServerPosix.c
deleted file mode 100644
@@ -1,28 +0,0 @@
-From beea0f97b3c95ec69f3e269df1af87eb2cdd3c46 Mon Sep 17 00:00:00 2001
-From: Otto Hollmann <otto@hollmann.cz>
-Date: Tue, 12 Dec 2023 13:58:32 +0100
-Subject: [PATCH] Add support for OpenSSL 3.2.x
-
-Upstream: https://github.com/kgoldman/ibmswtpm2/pull/13
-Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
----
- src/TpmToOsslMath.h | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/src/TpmToOsslMath.h b/src/TpmToOsslMath.h
-index 0b18191..1271937 100644
---- a/src/TpmToOsslMath.h
-+++ b/src/TpmToOsslMath.h
-@@ -76,10 +76,10 @@
- * 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 > 0x30100ff0L
-+#if OPENSSL_VERSION_NUMBER > 0x30200ff0L
- // 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.1.x
-+// Currently safe for all 3.2.x
- # error Untested OpenSSL version
- #elif OPENSSL_VERSION_NUMBER >= 0x10100000L
- // from crypto/bn/bn_lcl.h
@@ -1,3 +1,3 @@
# Locally computed:
-sha256 da7799baa1d38cd9d2f491006de45d38805db9d5a77c38af6e78728bd318f93e ibm-sw-tpm2-5452af422edeff70fcae8ea99dd28a0922051d7b-git4.tar.gz
+sha256 239cea3ec99cb31fb25c1ba4fe9b98a862bb20daefefeba8908d370bedd42a31 ibm-sw-tpm2-rev183-2024-03-27-git4.tar.gz
sha256 dd2d31b560011ea673e197251e710e52669d911367d83cd3cfd018f8ed58bde9 LICENSE
@@ -4,7 +4,7 @@
#
################################################################################
-IBM_SW_TPM2_VERSION = 5452af422edeff70fcae8ea99dd28a0922051d7b
+IBM_SW_TPM2_VERSION = rev183-2024-03-27
IBM_SW_TPM2_SITE = https://git.code.sf.net/p/ibmswtpm2/tpm2
IBM_SW_TPM2_SITE_METHOD = git
IBM_SW_TPM2_LICENSE = BSD-3-Clause
- Refresh first patch - Drop second patch (fix differentl by https://sourceforge.net/p/ibmswtpm2/tpm2/ci/ebe82ac82fef97feddc558f3c3ad16baf67e6921/) Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> --- ...01-Use-LONG_BIT-to-define-RADIX_BITS.patch | 65 +++++++++---------- .../0002-Add-support-for-OpenSSL-3-2-x.patch | 28 -------- package/ibm-sw-tpm2/ibm-sw-tpm2.hash | 2 +- package/ibm-sw-tpm2/ibm-sw-tpm2.mk | 2 +- 4 files changed, 33 insertions(+), 64 deletions(-) delete mode 100644 package/ibm-sw-tpm2/0002-Add-support-for-OpenSSL-3-2-x.patch