diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-05-02 09:01:08 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-05-02 09:03:46 -0700 |
commit | 3d7075e2fb1bed02d0e978284aebb36eab24c791 (patch) | |
tree | 2b28c92ed86fbf3250eae119beaae019f166d2f2 /lib | |
parent | bd11400942d63de12371988dca8144925de9e2c3 (diff) | |
download | gnulib-3d7075e2fb1bed02d0e978284aebb36eab24c791.tar.gz |
af_alg: port to Ubuntu 22.04
Without this patch, maintainer builds of coreutils fail on Ubuntu
22.04 with diagnostics like "./lib/gl_openssl.h:79:1: error:
'MD5_Init' is deprecated: Since OpenSSL 3.0
[-Werror=deprecated-declarations]". From
<https://wiki.openssl.org/index.php/OpenSSL_1.1.0_Changes>
it appears that Gnulib needs to either define OPENSSL_API_COMPAT
to a version less than 3.0, or use a compatibility layer, or
assume OpenSSL 1.1.0 or later. The simplest workaround is to
define OPENSSL_API_COMPAT for 1.1.1, the oldest OpenSSL release
still supported. A better fix would be to rewrite the code to
assume OpenSSL 1.1.1 or later, and stop using the older API.
* lib/md5.h, lib/sha1.h, lib/sha256.h, lib/sha512.h, lib/sm3.h:
Define OPENSSL_API_COMPAT to 0x10101000L to suppress
the deprecation warnings on Ubuntu 22.04.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/md5.h | 3 | ||||
-rw-r--r-- | lib/sha1.h | 3 | ||||
-rw-r--r-- | lib/sha256.h | 3 | ||||
-rw-r--r-- | lib/sha512.h | 3 | ||||
-rw-r--r-- | lib/sm3.h | 3 |
5 files changed, 15 insertions, 0 deletions
@@ -24,6 +24,9 @@ #include <stdint.h> # if HAVE_OPENSSL_MD5 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include <openssl/md5.h> # endif diff --git a/lib/sha1.h b/lib/sha1.h index 098678d8da..bc3470a508 100644 --- a/lib/sha1.h +++ b/lib/sha1.h @@ -23,6 +23,9 @@ # include <stdint.h> # if HAVE_OPENSSL_SHA1 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include <openssl/sha.h> # endif diff --git a/lib/sha256.h b/lib/sha256.h index dc9d87e615..533173a59e 100644 --- a/lib/sha256.h +++ b/lib/sha256.h @@ -22,6 +22,9 @@ # include <stdint.h> # if HAVE_OPENSSL_SHA256 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include <openssl/sha.h> # endif diff --git a/lib/sha512.h b/lib/sha512.h index f38819faf0..1eb1870227 100644 --- a/lib/sha512.h +++ b/lib/sha512.h @@ -22,6 +22,9 @@ # include "u64.h" # if HAVE_OPENSSL_SHA512 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include <openssl/sha.h> # endif @@ -31,6 +31,9 @@ # include <stdint.h> # if HAVE_OPENSSL_SM3 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include <openssl/sm3.h> # endif |