]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
crypto/af_alg: Deprecate.
authorCollin Funk <collin.funk1@gmail.com>
Tue, 23 Jun 2026 01:03:40 +0000 (18:03 -0700)
committerCollin Funk <collin.funk1@gmail.com>
Tue, 23 Jun 2026 01:03:40 +0000 (18:03 -0700)
* modules/crypto/af_alg (Status, Notice): New sections.
(configure.ac): Add a module indicator.
* lib/md5-stream.c (md5_stream): Only use the AF_ALG API if the module
indicator is defined.
* lib/sha1-stream.c (sha1_stream): Likewise.
* lib/sha256-stream.c (shaxxx_stream): Likewise.
* lib/sha3-stream.c (sha3_xxx_stream): Likewise.
* lib/sha512-stream.c (shaxxx_stream): Likewise.
* modules/crypto/md5 (Depends-on): Remove crypto/af_alg dependency.
* modules/crypto/sha1 (Depends-on): Likewise.
* modules/crypto/sha256 (Depends-on): Likewise.
* modules/crypto/sha3 (Depends-on): Likewise.
* modules/crypto/sha512 (Depends-on): Likewise.
* NEWS: Mention the deprecation.

13 files changed:
ChangeLog
NEWS
lib/md5-stream.c
lib/sha1-stream.c
lib/sha256-stream.c
lib/sha3-stream.c
lib/sha512-stream.c
modules/crypto/af_alg
modules/crypto/md5
modules/crypto/sha1
modules/crypto/sha256
modules/crypto/sha3
modules/crypto/sha512

index 6ee89378ea07f9cac6062ee067e87fed88b6f078..58eb4f8609b62711feaf25b145d22216298a4244 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,21 @@
+2026-06-22  Collin Funk  <collin.funk1@gmail.com>
+
+       crypto/af_alg: Deprecate.
+       * modules/crypto/af_alg (Status, Notice): New sections.
+       (configure.ac): Add a module indicator.
+       * lib/md5-stream.c (md5_stream): Only use the AF_ALG API if the module
+       indicator is defined.
+       * lib/sha1-stream.c (sha1_stream): Likewise.
+       * lib/sha256-stream.c (shaxxx_stream): Likewise.
+       * lib/sha3-stream.c (sha3_xxx_stream): Likewise.
+       * lib/sha512-stream.c (shaxxx_stream): Likewise.
+       * modules/crypto/md5 (Depends-on): Remove crypto/af_alg dependency.
+       * modules/crypto/sha1 (Depends-on): Likewise.
+       * modules/crypto/sha256 (Depends-on): Likewise.
+       * modules/crypto/sha3 (Depends-on): Likewise.
+       * modules/crypto/sha512 (Depends-on): Likewise.
+       * NEWS: Mention the deprecation.
+
 2026-06-20  Paul Eggert  <eggert@cs.ucla.edu>
 
        gethrxtime: don’t use nanouptime, microuptime
diff --git a/NEWS b/NEWS
index 8456732c43c56deabcaa7ac7c2f8d6629002eaf6..6eef535dfa594fd606230d2eca36d71d250a70c7 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -78,6 +78,14 @@ User visible incompatible changes
 
 Date        Modules         Changes
 
+2026-06-22  crypto/af_alg   This module has been deprecated following the
+                            deprecation of the AF_ALG API in Linux 7.2.  If your
+                            package requires optimized hash algorithms, place
+                            gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat]) in
+                            your configure.ac to use OpenSSL when
+                            possible.  Alternatively, use 'crypto/gc'
+                            which uses libgcrypt when possible.
+
 2026-06-08  strerror        The return type of the strerror function is now
                             'const char *' on most platforms.  You may need to
                             adjust assignments of the form
index ffe077f52ab106770247a7b08f795c73b3ee5386..a406d17b53c0d35d8a621ed2b784fbdbd75386cb 100644 (file)
@@ -30,7 +30,9 @@
 # include "unlocked-io.h"
 #endif
 
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
 
 #ifdef _LIBC
 # include <endian.h>
 int
 md5_stream (FILE *stream, void *resblock)
 {
+#if GNULIB_AF_ALG
   switch (afalg_stream (stream, "md5", resblock, MD5_DIGEST_SIZE))
     {
     case 0: return 0;
     case -EIO: return 1;
     }
+#endif
 
   char *buffer = malloc (BLOCKSIZE);
   if (!buffer)
index c6e2c836e9248c6b623825c2fdc70e6d505b8c86..3de4a0156abd3af828ed3a58af2af87ab1c4fb10 100644 (file)
@@ -32,7 +32,9 @@
 # include "unlocked-io.h"
 #endif
 
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
 
 #define BLOCKSIZE 32768
 #if BLOCKSIZE % 64 != 0
 int
 sha1_stream (FILE *restrict stream, void *restrict resblock)
 {
+#if GNULIB_AF_ALG
   switch (afalg_stream (stream, "sha1", resblock, SHA1_DIGEST_SIZE))
     {
     case 0: return 0;
     case -EIO: return 1;
     }
+#endif
 
   char *buffer = malloc (BLOCKSIZE);
   if (!buffer)
index cde823a5979abc1d2b04f1f9036c45c3abc935d5..a2c0e20677fbae1b095f71686e392b6cb06ef367 100644 (file)
@@ -31,7 +31,9 @@
 # include "unlocked-io.h"
 #endif
 
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
 
 #define BLOCKSIZE 32768
 #if BLOCKSIZE % 64 != 0
@@ -49,11 +51,13 @@ shaxxx_stream (FILE *restrict stream, char const *restrict alg,
                void *(*finish_ctx) (struct sha256_ctx *restrict,
                                     void *restrict))
 {
+#if GNULIB_AF_ALG
   switch (afalg_stream (stream, alg, resblock, hashlen))
     {
     case 0: return 0;
     case -EIO: return 1;
     }
+#endif
 
   char *buffer = malloc (BLOCKSIZE);
   if (!buffer)
index 7bc3a7d7fe684fed550eb425fdec6fdac7a152c7..fcbce936ce62793c0b3975172081e5a8afe109f2 100644 (file)
@@ -27,7 +27,9 @@
 # include "unlocked-io.h"
 #endif
 
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
 
 #define BLOCKSIZE 31824
 #if (BLOCKSIZE % 144 != 0 && BLOCKSIZE % 136 != 0 && BLOCKSIZE % 104 != 0 \
@@ -44,11 +46,13 @@ sha3_xxx_stream (FILE *restrict stream, char const *restrict alg,
                  void *restrict resblock,
                  ssize_t hashlen, bool (*init_ctx) (struct sha3_ctx *))
 {
+#if GNULIB_AF_ALG
   switch (afalg_stream (stream, alg, resblock, hashlen))
     {
     case 0: return 0;
     case -EIO: return 1;
     }
+#endif
 
   char *buffer = malloc (BLOCKSIZE);
   if (!buffer)
index 8901eb40aaa339fc9a66d52897629f4425e5cd1c..dfa4a7dcfd77157a85af1b950d5f8de1b0fb21f4 100644 (file)
@@ -31,7 +31,9 @@
 # include "unlocked-io.h"
 #endif
 
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
 
 #define BLOCKSIZE 32768
 #if BLOCKSIZE % 128 != 0
@@ -49,11 +51,13 @@ shaxxx_stream (FILE *restrict stream, char const *restrict alg,
                void *(*finish_ctx) (struct sha512_ctx *restrict,
                                     void *restrict))
 {
+#if GNULIB_AF_ALG
   switch (afalg_stream (stream, alg, resblock, hashlen))
     {
     case 0: return 0;
     case -EIO: return 1;
     }
+#endif
 
   char *buffer = malloc (BLOCKSIZE);
   if (!buffer)
index 86384c4775023ffc58ca67ab34281406dceb9f6a..579bae3542f9d28ea383111bf02af8b0490a0f61 100644 (file)
@@ -1,6 +1,12 @@
 Description:
 Compute message digest using kernel-supported cryptography algorithms.
 
+Status:
+deprecated
+
+Notice:
+This module is deprecated because AF_ALG was deprecated in Linux 7.2.
+
 Files:
 lib/af_alg.h
 lib/af_alg.c
@@ -18,6 +24,7 @@ sys_stat-h
 
 configure.ac:
 gl_AF_ALG
+gl_MODULE_INDICATOR([af_alg])
 
 Makefile.am:
 lib_SOURCES += af_alg.c
index ea9722ed3b0a4fe1485a2a1cee977bb9af0f14a0..dcc6fb31eaf671bf8d1ce9d574a11d685d9adb31 100644 (file)
@@ -5,7 +5,6 @@ Files:
 lib/md5-stream.c
 
 Depends-on:
-crypto/af_alg
 crypto/md5-buffer
 
 configure.ac:
index 96e5c8fe181064feb2b170762f59b9c0067bb6af..0ad4564d598d3bcf4f30eef986bdc8b173730947 100644 (file)
@@ -5,7 +5,6 @@ Files:
 lib/sha1-stream.c
 
 Depends-on:
-crypto/af_alg
 crypto/sha1-buffer
 
 configure.ac:
index 68bc1900e36dbd795fc5836a03ebfcb2580f7ee6..8385b49a2cedd6703effa81ce3a326e9010bc541 100644 (file)
@@ -5,7 +5,6 @@ Files:
 lib/sha256-stream.c
 
 Depends-on:
-crypto/af_alg
 crypto/sha256-buffer
 
 configure.ac:
index 50e2ead34f1654755c8e2cd4b233b091cdbebd45..a3a4a32aac036b051f758ee07dcf29cad342d68e 100644 (file)
@@ -5,7 +5,6 @@ Files:
 lib/sha3-stream.c
 
 Depends-on:
-crypto/af_alg
 crypto/sha3-buffer
 free-posix
 
index 37a09e181da9cc8a82930cc0aa5dad7c79392a28..6d51e648ffd3139ea3682c9b16404ee51477ece4 100644 (file)
@@ -5,7 +5,6 @@ Files:
 lib/sha512-stream.c
 
 Depends-on:
-crypto/af_alg
 crypto/sha512-buffer
 
 configure.ac: