Blame SOURCES/0002-FAPI-Remove-useless-code-get_engine.patch

6a14f3
From 53a5ba5c8476097fb5145cee4bed61b82d0cc225 Mon Sep 17 00:00:00 2001
6a14f3
From: Juergen Repp <juergen.repp@sit.fraunhofer.de>
6a14f3
Date: Mon, 7 Jun 2021 09:47:30 +0200
6a14f3
Subject: [PATCH 02/23] FAPI: Remove useless code get_engine.
6a14f3
6a14f3
The function did always return NULL. So the default engine was used.
6a14f3
Fixes #2085
6a14f3
6a14f3
Signed-off-by: Juergen Repp <juergen.repp@sit.fraunhofer.de>
6a14f3
---
6a14f3
 src/tss2-fapi/fapi_crypto.c | 22 +---------------------
6a14f3
 1 file changed, 1 insertion(+), 21 deletions(-)
6a14f3
6a14f3
diff --git a/src/tss2-fapi/fapi_crypto.c b/src/tss2-fapi/fapi_crypto.c
6a14f3
index c50b5f0a..9c7e566c 100644
6a14f3
--- a/src/tss2-fapi/fapi_crypto.c
6a14f3
+++ b/src/tss2-fapi/fapi_crypto.c
6a14f3
@@ -56,9 +56,6 @@ typedef struct _IFAPI_CRYPTO_CONTEXT {
6a14f3
     size_t hashSize;
6a14f3
 } IFAPI_CRYPTO_CONTEXT;
6a14f3
 
6a14f3
-/** A singleton crypto engine for hash operations */
6a14f3
-static ENGINE *engine = NULL;
6a14f3
-
6a14f3
 /**
6a14f3
  * Returns the signature scheme that is currently used in the FAPI context.
6a14f3
  *
6a14f3
@@ -228,23 +225,6 @@ ifapi_bn2binpad(const BIGNUM *bn, unsigned char *bin, int binSize)
6a14f3
     return 1;
6a14f3
 }
6a14f3
 
6a14f3
-/**
6a14f3
- * Returns the singleton hash engine for the use in ifapi_hash operations. If
6a14f3
- * it does not yet exist, this function creates it.
6a14f3
- *
6a14f3
- * @retval A singleton hash engine
6a14f3
- */
6a14f3
-static ENGINE *
6a14f3
-get_engine()
6a14f3
-{
6a14f3
-    /* If an engine is present, it is returned */
6a14f3
-    if (engine)
6a14f3
-        return engine;
6a14f3
-    /* Otherwise, engine is created and returned */
6a14f3
-    engine = ENGINE_by_id(NULL);
6a14f3
-    return engine;
6a14f3
-}
6a14f3
-
6a14f3
 /**
6a14f3
  * Returns a suitable openSSL hash algorithm identifier for a given TSS hash
6a14f3
  * algorithm identifier.
6a14f3
@@ -1558,7 +1538,7 @@ ifapi_crypto_hash_start(IFAPI_CRYPTO_CONTEXT_BLOB **context,
6a14f3
     }
6a14f3
 
6a14f3
     if (1 != EVP_DigestInit_ex(mycontext->osslContext,
6a14f3
-                               mycontext->osslHashAlgorithm, get_engine())) {
6a14f3
+                               mycontext->osslHashAlgorithm, NULL)) {
6a14f3
         goto_error(r, TSS2_FAPI_RC_GENERAL_FAILURE, "Error EVP_DigestInit_ex",
6a14f3
                    cleanup);
6a14f3
     }
6a14f3
-- 
6a14f3
2.34.3
6a14f3