Remove Gnulib explicit_bzero module

It’s no longer needed, as it is now merely a thin layer around
C23-style memset_explicit and we might as well just call the
C23 standard function; that’s more forward-looking.
* admin/merge-gnulib (GNULIB_MODULES):
Remove explicit_bzero, and add memset_explicit.
* lib/explicit_bzero.c, m4/explicit_bzero.m4:
Remove these files, which were copied from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/gnutls.c (gnutls_symmetric_aead):
Use memset_explicit instead of explicit_bzero.
This commit is contained in:
Paul Eggert 2022-12-18 00:21:30 -08:00
parent bda755bf92
commit 185bfc1af7
6 changed files with 5 additions and 65 deletions

View file

@ -33,13 +33,14 @@ GNULIB_MODULES='
crypto/md5 crypto/md5-buffer
crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer
d-type diffseq double-slash-root dtoastr dtotimespec dup2
environ execinfo explicit_bzero faccessat
environ execinfo faccessat
fchmodat fcntl fcntl-h fdopendir file-has-acl
filemode filename filevercmp flexmember fpieee
free-posix fstatat fsusage fsync futimens
getloadavg getopt-gnu getrandom gettime gettimeofday gitlog-to-changelog
ieee754-h ignore-value intprops largefile libgmp lstat
manywarnings memmem-simple mempcpy memrchr minmax mkostemp mktime
manywarnings memmem-simple mempcpy memrchr memset_explicit
minmax mkostemp mktime
nanosleep nproc nstrftime
pathmax pipe2 pselect pthread_sigmask
qcopy-acl readlink readlinkat regex

View file

@ -1,27 +0,0 @@
/* Erasure of sensitive data, generic implementation.
Copyright (C) 2016-2022 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1 of the
License, or (at your option) any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
#include <config.h>
#include <string.h>
/* Set LEN bytes of S to 0. The compiler will not delete a call to
this function, even if S is dead after the call. */
void
explicit_bzero (void *s, size_t len)
{
memset_explicit (s, 0, len);
}

View file

@ -93,7 +93,6 @@
# dup2 \
# environ \
# execinfo \
# explicit_bzero \
# faccessat \
# fchmodat \
# fcntl \
@ -126,6 +125,7 @@
# memmem-simple \
# mempcpy \
# memrchr \
# memset_explicit \
# minmax \
# mkostemp \
# mktime \
@ -264,7 +264,6 @@ GL_COND_OBJ_DIRFD_CONDITION = @GL_COND_OBJ_DIRFD_CONDITION@
GL_COND_OBJ_DUP2_CONDITION = @GL_COND_OBJ_DUP2_CONDITION@
GL_COND_OBJ_EUIDACCESS_CONDITION = @GL_COND_OBJ_EUIDACCESS_CONDITION@
GL_COND_OBJ_EXECINFO_CONDITION = @GL_COND_OBJ_EXECINFO_CONDITION@
GL_COND_OBJ_EXPLICIT_BZERO_CONDITION = @GL_COND_OBJ_EXPLICIT_BZERO_CONDITION@
GL_COND_OBJ_FACCESSAT_CONDITION = @GL_COND_OBJ_FACCESSAT_CONDITION@
GL_COND_OBJ_FCHMODAT_CONDITION = @GL_COND_OBJ_FCHMODAT_CONDITION@
GL_COND_OBJ_FCNTL_CONDITION = @GL_COND_OBJ_FCNTL_CONDITION@
@ -1860,16 +1859,6 @@ EXTRA_DIST += execinfo.in.h
endif
## end gnulib module execinfo
## begin gnulib module explicit_bzero
ifeq (,$(OMIT_GNULIB_MODULE_explicit_bzero))
ifneq (,$(GL_COND_OBJ_EXPLICIT_BZERO_CONDITION))
libgnu_a_SOURCES += explicit_bzero.c
endif
endif
## end gnulib module explicit_bzero
## begin gnulib module faccessat
ifeq (,$(OMIT_GNULIB_MODULE_faccessat))

View file

@ -1,17 +0,0 @@
dnl Copyright 2017-2022 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([gl_FUNC_EXPLICIT_BZERO],
[
AC_REQUIRE([gl_STRING_H_DEFAULTS])
dnl Persuade glibc <string.h> to declare explicit_bzero.
AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])
AC_CHECK_FUNCS_ONCE([explicit_bzero])
if test $ac_cv_func_explicit_bzero = no; then
HAVE_EXPLICIT_BZERO=0
fi
])

View file

@ -82,7 +82,6 @@ AC_DEFUN([gl_EARLY],
# Code from module errno:
# Code from module euidaccess:
# Code from module execinfo:
# Code from module explicit_bzero:
# Code from module extensions:
# Code from module extern-inline:
# Code from module faccessat:
@ -286,9 +285,6 @@ AC_DEFUN([gl_INIT],
gl_CONDITIONAL_HEADER([execinfo.h])
AC_PROG_MKDIR_P
gl_CONDITIONAL([GL_COND_OBJ_EXECINFO], [$GL_GENERATE_EXECINFO_H])
gl_FUNC_EXPLICIT_BZERO
gl_CONDITIONAL([GL_COND_OBJ_EXPLICIT_BZERO], [test $HAVE_EXPLICIT_BZERO = 0])
gl_STRING_MODULE_INDICATOR([explicit_bzero])
AC_REQUIRE([gl_EXTERN_INLINE])
gl_FUNC_FACCESSAT
gl_CONDITIONAL([GL_COND_OBJ_FACCESSAT],
@ -1252,7 +1248,6 @@ AC_DEFUN([gl_FILE_LIST], [
lib/euidaccess.c
lib/execinfo.c
lib/execinfo.in.h
lib/explicit_bzero.c
lib/faccessat.c
lib/fchmodat.c
lib/fcntl.c
@ -1437,7 +1432,6 @@ AC_DEFUN([gl_FILE_LIST], [
m4/errno_h.m4
m4/euidaccess.m4
m4/execinfo.m4
m4/explicit_bzero.m4
m4/extensions.m4
m4/extern-inline.m4
m4/faccessat.m4

View file

@ -2282,7 +2282,7 @@ gnutls_symmetric_aead (bool encrypting, gnutls_cipher_algorithm_t gca,
Lisp_Object output;
if (GNUTLS_E_SUCCESS <= ret)
output = make_unibyte_string (storage, storage_length);
explicit_bzero (storage, storage_length);
memset_explicit (storage, 0, storage_length);
gnutls_aead_cipher_deinit (acipher);
if (ret < GNUTLS_E_SUCCESS)