[1/1] drivers: define OPENSSL_API_COMPAT
Checks
Commit Message
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
> -----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>
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>
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
> 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.
@@ -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>
@@ -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>
@@ -2,6 +2,8 @@
* Copyright(c) 2016-2017 Intel Corporation
*/
+#define OPENSSL_API_COMPAT 0x10100000L
+
#include <string.h>
#include <rte_common.h>
@@ -2,6 +2,8 @@
* Copyright(c) 2015-2022 Intel Corporation
*/
+#define OPENSSL_API_COMPAT 0x10100000L
+
#include <openssl/evp.h>
#include <rte_mempool.h>
@@ -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 */