Skip to contentSkip to conversation

crypto/openssl: update to OpenSSL 3.0 minimum version

PATCH Superseded Emma Finn 1 participant 1 message May 28

Subsystems (2)
lore
Share & tools
lore

Emma Finn

author
#0 lore raw

PATCH v2 1/1 crypto/openssl: update to OpenSSL 3.0 minimum version

Update the OpenSSL PMD to require OpenSSL 3.0.0 as the minimum supported version, removing all compatibility code for earlier versions (1.0.1, 1.1.0, 1.1.1).

---
*v2: skip build if openssl v3.0 dependency is not met.

---
 doc/guides/cryptodevs/openssl.rst            |   4 +-
 doc/guides/rel_notes/release_26_07.rst       |   5 +
 drivers/crypto/openssl/compat.h              | 203 ------
 drivers/crypto/openssl/meson.build           |   4 +-
 drivers/crypto/openssl/openssl_pmd_private.h |  30 -
 drivers/crypto/openssl/rte_openssl_pmd.c     | 648 +------------------
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 206 ------
 7 files changed, 21 insertions(+), 1079 deletions(-)
doc/guides/cryptodevs/openssl.rst +2 -2
index 9d94668a9a..b4e2a014e2 100644
@@ -74,9 +74,9 @@ To compile the OpenSSL PMD the openssl library must be installed. It will
 then be picked up by the Meson/Ninja build system.
 
 To ensure that you have the latest security fixes it is recommended that you
-use version 1.1.1g or newer.
+use the latest stable version of OpenSSL 3.x.
 
-* 1.1.1g, 2020-Apr-21. https://www.openssl.org/source/
+* OpenSSL 3.0.0 or newer: https://www.openssl.org/source/
 
 Initialization
 --------------
doc/guides/rel_notes/release_26_07.rst +5 -0
index 58d782f77e..989d54f7b7 100644
@@ -90,6 +90,11 @@ Removed Items
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* crypto/openssl: Removed support for OpenSSL 1.x versions from the OpenSSL crypto PMD.
+
+  The OpenSSL crypto PMD now requires OpenSSL 3.0 as the minimum version,
+  and all compatibility code for OpenSSL 1.0.1, 1.1.0, and 1.1.1 versions has been removed.
+
 
 API Changes
 -----------
drivers/crypto/openssl/compat.h +0 -203

221 lines not on this page · raw message

drivers/crypto/openssl/meson.build +2 -2
index af469a9827..0d82c42764 100644
@@ -7,10 +7,10 @@ if is_windows
     subdir_done()
 endif
 
-dep = dependency('libcrypto', required: false, method: 'pkg-config')
+dep = dependency('libcrypto', required: false, method: 'pkg-config', version: '>= 3.0.0')
 if not dep.found()
     build = false
-    reason = 'missing dependency, "libcrypto"'
+    reason = 'missing dependency, "libcrypto >= 3.0.0"'
 endif
 deps += 'bus_vdev'
 sources = files('rte_openssl_pmd.c', 'rte_openssl_pmd_ops.c')
drivers/crypto/openssl/openssl_pmd_private.h +0 -30
index d5a751600a..ab40012d61 100644
@@ -13,10 +13,8 @@
 #include <openssl/dh.h>
 #include <openssl/dsa.h>
 #include <openssl/ec.h>
-#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 #include <openssl/provider.h>
 #include <openssl/core_names.h>
-#endif
 
 #define CRYPTODEV_NAME_OPENSSL_PMD	crypto_openssl
 /**< Open SSL Crypto PMD device name */
@@ -84,13 +82,8 @@ struct evp_ctx_pair {
 	EVP_CIPHER_CTX *cipher;
 	union {
 		EVP_MD_CTX *auth;
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
 		EVP_MAC_CTX *hmac;
 		EVP_MAC_CTX *cmac;
-#else
-		HMAC_CTX *hmac;
-		CMAC_CTX *cmac;
-#endif
 	};
 };
 
@@ -153,24 +146,13 @@ struct __rte_cache_aligned openssl_session {
 				/**< pointer to EVP key */
 				const EVP_MD *evp_algo;
 				/**< pointer to EVP algorithm function */
-# if OPENSSL_VERSION_NUMBER >= 0x30000000L
 				EVP_MAC_CTX * ctx;
-# else
-				HMAC_CTX *ctx;
-# endif
 				/**< pointer to EVP context structure */
 			} hmac;
 
 			struct {
-# if OPENSSL_VERSION_NUMBER >= 0x30000000L
 				EVP_MAC_CTX * ctx;
 				/**< pointer to EVP context structure */
-# else
-				const EVP_CIPHER * evp_algo;
-				/**< pointer to EVP algorithm function */
-				CMAC_CTX *ctx;
-				/**< pointer to EVP context structure */
-# endif
 			} cmac;
 		};
 
@@ -198,9 +180,7 @@ struct __rte_cache_aligned openssl_asym_session {
 		struct rsa {
 			RSA *rsa;
 			uint32_t pad;
-#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 			EVP_PKEY_CTX * ctx;
-#endif
 		} r;
 		struct exp {
 			BIGNUM *exp;
@@ -216,38 +196,28 @@ struct __rte_cache_aligned openssl_asym_session {
 			uint32_t key_op;
 			BIGNUM *p;
 			BIGNUM *g;
-#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 			OSSL_PARAM_BLD * param_bld;
 			OSSL_PARAM_BLD *param_bld_peer;
-#endif
 		} dh;
 		struct {
 			DSA *dsa;
-#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 			OSSL_PARAM_BLD * param_bld;
 			BIGNUM *p;
 			BIGNUM *g;
 			BIGNUM *q;
 			BIGNUM *priv_key;
-#endif
 		} s;
 		struct {
 			uint8_t curve_id;
-#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 			EC_GROUP * group;
 			BIGNUM *priv_key;
-#endif
 		} ec;
 		struct {
-#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 			OSSL_PARAM * params;
-#endif
 		} sm2;
 		struct {
 			uint8_t curve_id;
-#if (OPENSSL_VERSION_NUMBER >= 0x30000000L)
 			OSSL_PARAM * params;
-#endif
 		} eddsa;
 		struct {
 			uint8_t type;
drivers/crypto/openssl/rte_openssl_pmd.c +12 -636

927 lines not on this page · raw message

drivers/crypto/openssl/rte_openssl_pmd_ops.c +0 -206

325 lines not on this page · raw message

Signature · 1 line
2.43.0