tpm2-tools/0013-openssl-Remove-unnecessary-compatibility-function.patch
Štěpán Horáček d8b5733ac7 tpm2-tools: Fix segfault and add support for OpenSSL 3
The segfault was caused by calling tpm2 command on ppc64le without any
additional arguments.

Resolves: rhbz#1989617

Signed-off-by: Štěpán Horáček <shoracek@redhat.com>
2021-10-05 12:20:18 +02:00

51 lines
1.2 KiB
Diff

From d295e6214ec4562b3940ac4a88178a260e656929 Mon Sep 17 00:00:00 2001
From: Petr Gotthard <petr.gotthard@centrum.cz>
Date: Sun, 15 Aug 2021 13:50:36 +0200
Subject: [PATCH 12/17] openssl: Remove unnecessary compatibility function
This was required for OpenSSL < 1.1.0 only.
Signed-off-by: Petr Gotthard <petr.gotthard@centrum.cz>
---
lib/tpm2_openssl.c | 24 ------------------------
1 file changed, 24 deletions(-)
diff --git a/lib/tpm2_openssl.c b/lib/tpm2_openssl.c
index 9cc362af..ea1d6c3b 100644
--- a/lib/tpm2_openssl.c
+++ b/lib/tpm2_openssl.c
@@ -14,30 +14,6 @@
#include "tpm2_openssl.h"
#include "tpm2_systemdeps.h"
-/* compatibility function for OpenSSL versions < 1.1.0 */
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
-static int BN_bn2binpad(const BIGNUM *a, unsigned char *to, int tolen) {
- int r;
- int topad;
- int islen;
-
- islen = BN_num_bytes(a);
-
- if (tolen < islen)
- return -1;
-
- topad = tolen - islen;
-
- memset(to, 0x00, topad);
- r = BN_bn2bin(a, to + topad);
- if (r == 0) {
- return -1;
- }
-
- return tolen;
-}
-#endif
-
int tpm2_openssl_halgid_from_tpmhalg(TPMI_ALG_HASH algorithm) {
switch (algorithm) {
--
2.31.1