bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] af_alg: port to Ubuntu 22.04


From: Paul Eggert
Subject: [PATCH] af_alg: port to Ubuntu 22.04
Date: Mon, 2 May 2022 09:04:13 -0700

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    | 18 ++++++++++++++++++
 lib/md5.h    |  3 +++
 lib/sha1.h   |  3 +++
 lib/sha256.h |  3 +++
 lib/sha512.h |  3 +++
 lib/sm3.h    |  3 +++
 6 files changed, 33 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 5749e2dc69..f0c9d331d4 100644
--- 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-05-01  Paul Eggert  <eggert@cs.ucla.edu>
 
        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 <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
 
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 <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
 
-- 
2.34.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]