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

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