]> Savannah Git Hosting - gnulib.git/commitdiff
af_alg: port to Ubuntu 22.04
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 2 May 2022 16:01:08 +0000 (09:01 -0700)
committerBruno Haible <bruno@clisp.org>
Wed, 31 Aug 2022 23:02:42 +0000 (01:02 +0200)
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.

ChangeLog
lib/md5.h
lib/sha1.h
lib/sha256.h
lib/sha512.h
lib/sm3.h

index 6ce809d9b50c85aa00f0735e65debbdb5ebde686..9907522ce2953db26a7ba3b8c40e8c1144a83547 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2022-05-02  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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.
+
 2022-04-30  Bruno Haible  <bruno@clisp.org>
 
        string: Avoid syntax error on glibc systems with GCC 11.
index 5b92eac5ec8203daeab921370666983209144f90..611c230b8176b434bfe1331c48c4721f82a61034 100644 (file)
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -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
 
index 098678d8da6a9a779fa0e9891b895e1270b461be..bc3470a508dae4823941b320878c560262836806 100644 (file)
@@ -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
 
index dc9d87e615fd34a9d1266708dbc5231bfb7de4bc..533173a59e8c176963bfd3aac0c89399ff1006da 100644 (file)
@@ -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
 
index f38819faf0fd1fbb2f6c2dd289feedb028ceaac8..1eb18702278f68729f5c3de1cbef36cbf99cb190 100644 (file)
@@ -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
 
index 5d606fe7d8e13b3d6d741d4f12d0487f75ab184f..2efe800a123de063d72a737b9b75ebc1df71fe52 100644 (file)
--- a/lib/sm3.h
+++ b/lib/sm3.h
@@ -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