tpm2-tools/0013-openssl-Remove-unnecessary-compatibility-function.patch

51 lines
1.2 KiB
Diff
Raw Normal View History

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