diff mbox series

[1/1] drivers: define OPENSSL_API_COMPAT

Message ID 20220510150635.61975-1-heinrich.schuchardt@canonical.com (mailing list archive)
State Accepted
Delegated to: akhil goyal
Headers show
Series [1/1] drivers: define OPENSSL_API_COMPAT | expand

Checks

Context Check Description
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/iol-x86_64-unit-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional fail Functional Testing issues
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Heinrich Schuchardt May 10, 2022, 3:06 p.m. UTC
The API of the OpenSSL library has changed with version 3.0. This results
in a lot of compiler warnings like

    ../dpdk/drivers/crypto/ccp/ccp_crypto.c:182:9:
    warning: ‘SHA256_Transform’ is deprecated:
    Since OpenSSL 3.0 [-Wdeprecated-declarations]

As many Linux distributions still use elder OpenSSL libraries we cannot
change the used API now. Instead define OPENSSL_API_COMPAT to indicate
that we are using the OpenSSL 1.1.0 API.

OPENSSL_API_COMPAT is introduced in *.c files and not in *.h files as some
*.c files directly include OpenSSL headers.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 drivers/crypto/ccp/ccp_crypto.c              | 2 ++
 drivers/crypto/openssl/rte_openssl_pmd.c     | 2 ++
 drivers/crypto/openssl/rte_openssl_pmd_ops.c | 2 ++
 drivers/crypto/qat/qat_sym.c                 | 2 ++
 drivers/crypto/qat/qat_sym_session.c         | 2 ++
 5 files changed, 10 insertions(+)

Comments

Daxue Gao May 13, 2022, 10:02 a.m. UTC | #1
> -----Original Message-----
> From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Sent: 2022年5月10日 23:07
> To: Zhang, Roy Fan <roy.fan.zhang@intel.com>
> Cc: Chandubabu Namburu <chandu@amd.com>; dev@dpdk.org; Heinrich
> Schuchardt <heinrich.schuchardt@canonical.com>
> Subject: [PATCH 1/1] drivers: define OPENSSL_API_COMPAT
> 
> The API of the OpenSSL library has changed with version 3.0. This results in a lot
> of compiler warnings like
> 
>     ../dpdk/drivers/crypto/ccp/ccp_crypto.c:182:9:
>     warning: ‘SHA256_Transform’ is deprecated:
>     Since OpenSSL 3.0 [-Wdeprecated-declarations]
> 
> As many Linux distributions still use elder OpenSSL libraries we cannot change
> the used API now. Instead define OPENSSL_API_COMPAT to indicate that we are
> using the OpenSSL 1.1.0 API.
> 
> OPENSSL_API_COMPAT is introduced in *.c files and not in *.h files as some *.c
> files directly include OpenSSL headers.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
Tested-by: Daxue Gao <daxuex.gao@intel.com>
David Marchand May 17, 2022, 12:03 p.m. UTC | #2
On Tue, May 10, 2022 at 5:06 PM Heinrich Schuchardt
<heinrich.schuchardt@canonical.com> wrote:
>
> The API of the OpenSSL library has changed with version 3.0. This results
> in a lot of compiler warnings like
>
>     ../dpdk/drivers/crypto/ccp/ccp_crypto.c:182:9:
>     warning: ‘SHA256_Transform’ is deprecated:
>     Since OpenSSL 3.0 [-Wdeprecated-declarations]
>
> As many Linux distributions still use elder OpenSSL libraries we cannot
> change the used API now. Instead define OPENSSL_API_COMPAT to indicate
> that we are using the OpenSSL 1.1.0 API.
>
> OPENSSL_API_COMPAT is introduced in *.c files and not in *.h files as some
> *.c files directly include OpenSSL headers.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

Thanks for the fix, I got a new shiny laptop running Fedora 36 and hit
this issue.
That may be something we want to backport, and I would then Cc: stable@dpdk.org.

Tested-by: David Marchand <david.marchand@redhat.com>
Kai Ji May 17, 2022, 4:30 p.m. UTC | #3
Acked-by: Ji, Kai <kai.ji@intel.com>

> -----Original Message-----
> From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> Sent: Tuesday, May 10, 2022 4:07 PM
> To: Zhang, Roy Fan <roy.fan.zhang@intel.com>
> Cc: Chandubabu Namburu <chandu@amd.com>; dev@dpdk.org; Heinrich
> Schuchardt <heinrich.schuchardt@canonical.com>
> Subject: [PATCH 1/1] drivers: define OPENSSL_API_COMPAT
> 
> The API of the OpenSSL library has changed with version 3.0. This results in a lot
> of compiler warnings like
> 
>     ../dpdk/drivers/crypto/ccp/ccp_crypto.c:182:9:
>     warning: ‘SHA256_Transform’ is deprecated:
>     Since OpenSSL 3.0 [-Wdeprecated-declarations]
> 
> As many Linux distributions still use elder OpenSSL libraries we cannot change the
> used API now. Instead define OPENSSL_API_COMPAT to indicate that we are
> using the OpenSSL 1.1.0 API.
> 
> OPENSSL_API_COMPAT is introduced in *.c files and not in *.h files as some *.c
> files directly include OpenSSL headers.
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
> 2.34.1
Akhil Goyal May 26, 2022, 4:18 p.m. UTC | #4
> On Tue, May 10, 2022 at 5:06 PM Heinrich Schuchardt
> <heinrich.schuchardt@canonical.com> wrote:
> >
> > The API of the OpenSSL library has changed with version 3.0. This results
> > in a lot of compiler warnings like
> >
> >     ../dpdk/drivers/crypto/ccp/ccp_crypto.c:182:9:
> >     warning: ‘SHA256_Transform’ is deprecated:
> >     Since OpenSSL 3.0 [-Wdeprecated-declarations]
> >
> > As many Linux distributions still use elder OpenSSL libraries we cannot
> > change the used API now. Instead define OPENSSL_API_COMPAT to indicate
> > that we are using the OpenSSL 1.1.0 API.
> >
> > OPENSSL_API_COMPAT is introduced in *.c files and not in *.h files as some
> > *.c files directly include OpenSSL headers.
> >
> > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> 
> Thanks for the fix, I got a new shiny laptop running Fedora 36 and hit
> this issue.
> That may be something we want to backport, and I would then Cc:
> stable@dpdk.org.
> 
> Tested-by: David Marchand <david.marchand@redhat.com>
Applied to dpdk-next-crypto

Thanks.
diff mbox series

Patch

diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index 4ed91a7436..4bab18323b 100644
--- a/drivers/crypto/ccp/ccp_crypto.c
+++ b/drivers/crypto/ccp/ccp_crypto.c
@@ -2,6 +2,8 @@ 
  *   Copyright(c) 2018 Advanced Micro Devices, Inc. All rights reserved.
  */
 
+#define OPENSSL_API_COMPAT 0x10100000L
+
 #include <dirent.h>
 #include <fcntl.h>
 #include <stdio.h>
diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c
index d80e1052e2..4f331af157 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd.c
@@ -2,6 +2,8 @@ 
  * Copyright(c) 2016-2017 Intel Corporation
  */
 
+#define OPENSSL_API_COMPAT 0x10100000L
+
 #include <rte_common.h>
 #include <rte_hexdump.h>
 #include <rte_cryptodev.h>
diff --git a/drivers/crypto/openssl/rte_openssl_pmd_ops.c b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
index 1cb07794bd..87c395a836 100644
--- a/drivers/crypto/openssl/rte_openssl_pmd_ops.c
+++ b/drivers/crypto/openssl/rte_openssl_pmd_ops.c
@@ -2,6 +2,8 @@ 
  * Copyright(c) 2016-2017 Intel Corporation
  */
 
+#define OPENSSL_API_COMPAT 0x10100000L
+
 #include <string.h>
 
 #include <rte_common.h>
diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c
index ca8c9a8124..3a6c9dcc0a 100644
--- a/drivers/crypto/qat/qat_sym.c
+++ b/drivers/crypto/qat/qat_sym.c
@@ -2,6 +2,8 @@ 
  * Copyright(c) 2015-2022 Intel Corporation
  */
 
+#define OPENSSL_API_COMPAT 0x10100000L
+
 #include <openssl/evp.h>
 
 #include <rte_mempool.h>
diff --git a/drivers/crypto/qat/qat_sym_session.c b/drivers/crypto/qat/qat_sym_session.c
index 9d6a19c0be..737a180810 100644
--- a/drivers/crypto/qat/qat_sym_session.c
+++ b/drivers/crypto/qat/qat_sym_session.c
@@ -2,6 +2,8 @@ 
  * Copyright(c) 2015-2022 Intel Corporation
  */
 
+#define OPENSSL_API_COMPAT 0x10100000L
+
 #include <openssl/sha.h>	/* Needed to calculate pre-compute values */
 #include <openssl/aes.h>	/* Needed to calculate pre-compute values */
 #include <openssl/md5.h>	/* Needed to calculate pre-compute values */