From: Paul Eggert Date: Mon, 2 May 2022 16:01:08 +0000 (-0700) Subject: af_alg: port to Ubuntu 22.04 X-Git-Tag: v1.0~2301 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3d7075e2fb1bed02d0e978284aebb36eab24c791;p=gnulib.git 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 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. --- diff --git a/ChangeLog b/ChangeLog index 5749e2dc69..f0c9d331d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2022-05-02 Paul Eggert + + 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 + + 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. + 2022-05-01 Paul Eggert vasnprintf: Simplify. Reduce binary code size. diff --git a/lib/md5.h b/lib/md5.h index 5b92eac5ec..611c230b81 100644 --- a/lib/md5.h +++ b/lib/md5.h @@ -24,6 +24,9 @@ #include # if HAVE_OPENSSL_MD5 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include # 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 # if HAVE_OPENSSL_SHA1 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include # 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 # if HAVE_OPENSSL_SHA256 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include # 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 # endif diff --git a/lib/sm3.h b/lib/sm3.h index 5d606fe7d8..2efe800a12 100644 --- a/lib/sm3.h +++ b/lib/sm3.h @@ -31,6 +31,9 @@ # include # if HAVE_OPENSSL_SM3 +# ifndef OPENSSL_API_COMPAT +# define OPENSSL_API_COMPAT 0x10101000L /* FIXME: Use OpenSSL 1.1+ API. */ +# endif # include # endif