diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-07-16 16:22:33 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-07-16 16:29:12 -0700 |
commit | 59f6972134f312863dc761bf66a954a8036d0d86 (patch) | |
tree | cd479a7fe59b72985f98e57c4b4d861c01cf5bc8 /m4 | |
parent | 252444aaa3a7cb9fc70289a5a3920f8a9d848109 (diff) | |
download | emacs-59f6972134f312863dc761bf66a954a8036d0d86.tar.gz |
Use explicit_bzero to clear GnuTLS keys
* admin/merge-gnulib (GNULIB_MODULES): Add explicit_bzero.
* lib/explicit_bzero.c, m4/explicit_bzero.m4: New files.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/gnutls.c (clear_storage): New function.
(gnutls_symmetric_aead): Use it instead of memset.
Diffstat (limited to 'm4')
-rw-r--r-- | m4/explicit_bzero.m4 | 22 | ||||
-rw-r--r-- | m4/gnulib-comp.m4 | 9 |
2 files changed, 31 insertions, 0 deletions
diff --git a/m4/explicit_bzero.m4 b/m4/explicit_bzero.m4 new file mode 100644 index 00000000000..f9dc678207a --- /dev/null +++ b/m4/explicit_bzero.m4 @@ -0,0 +1,22 @@ +dnl Copyright 2017 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_HEADER_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 +]) + +AC_DEFUN([gl_PREREQ_EXPLICIT_BZERO], +[ + AC_CHECK_FUNCS([explicit_memset]) +]) diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index 107645df4fd..038d78aafea 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 @@ -72,6 +72,7 @@ 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: @@ -210,6 +211,12 @@ AC_DEFUN([gl_INIT], gl_UNISTD_MODULE_INDICATOR([environ]) gl_HEADER_ERRNO_H gl_EXECINFO_H + gl_FUNC_EXPLICIT_BZERO + if test $HAVE_EXPLICIT_BZERO = 0; then + AC_LIBOBJ([explicit_bzero]) + gl_PREREQ_EXPLICIT_BZERO + fi + gl_STRING_MODULE_INDICATOR([explicit_bzero]) AC_REQUIRE([gl_EXTERN_INLINE]) gl_FUNC_FACCESSAT if test $HAVE_FACCESSAT = 0; then @@ -837,6 +844,7 @@ AC_DEFUN([gl_FILE_LIST], [ lib/euidaccess.c lib/execinfo.c lib/execinfo.in.h + lib/explicit_bzero.c lib/faccessat.c lib/fcntl.c lib/fcntl.in.h @@ -967,6 +975,7 @@ 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 |