From md.monjur at gatech.edu Tue Oct 2 01:10:10 2018 From: md.monjur at gatech.edu (Alam, Md Monjur) Date: Mon, 1 Oct 2018 23:10:10 +0000 Subject: Libgcrypt Android Compatibility Message-ID: Hi, I am a PhD student at Georgia Tech and working on cryptanalysis on libgcrypt libraries for academic research purpose. I Can build the libgcrypt library at ARM core embedded device (with Linux OS). I want the same with Android OS. Does libgcrypt support for Android? Is there any tool-chain to produce libgcrypt.so which can run on Unix based terminal of Android Cell phone? I can use adb to execute my C based application (encrypt/decrypt) linked with libgcrypt.so. But, I need to build libgcrypt.so that would be compatible to run on Android. It would be highly appreciate if you kindly send me any configuration and tell me how to do? Thanks Monjur -------------- next part -------------- An HTML attachment was scrubbed... URL: From wk at gnupg.org Fri Oct 5 12:08:41 2018 From: wk at gnupg.org (Werner Koch) Date: Fri, 05 Oct 2018 12:08:41 +0200 Subject: Libgcrypt Android Compatibility In-Reply-To: (Md Monjur Alam's message of "Mon, 1 Oct 2018 23:10:10 +0000") References: Message-ID: <87lg7cyac6.fsf@wheatstone.g10code.de> On Tue, 2 Oct 2018 01:10, md.monjur at gatech.edu said: > I Can build the libgcrypt library at ARM core embedded device (with > Linux OS). I want the same with Android OS. Does libgcrypt support for > Android? Is there any tool-chain to produce libgcrypt.so which can run Yes. However, for build instructions I would suggest to leap over to https://guardianproject.info who ported GnuPG and thus also Libgcrypt to Android. All their changes should be upstream despite that their GnuPG project is currently unmaintained. You should still find information on how to setup a tool chain and build gnupg and thus Libgcrypt. If you have any build problem using the current Libgcrypt replease please report here and we will try to help. Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From cvs at cvs.gnupg.org Tue Oct 16 07:48:34 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 16 Oct 2018 07:48:34 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-87-g0f2c6ce Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 0f2c6ce2c9504c6df435463243edaa669e57b109 (commit) from 86e5e06a97ae13b8bbf6923ecc76e02b9c429b46 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0f2c6ce2c9504c6df435463243edaa669e57b109 Author: NIIBE Yutaka Date: Tue Oct 16 14:46:55 2018 +0900 build: Let configure create the VERSION file. * autogen.sh: Update from libgpg-error. * configure.ac: Use mym4_versoin to create VERSION file. * Makefile.am (dist-hook): Do not create VERSION file. (EXTRA_DIST): Add VERSION. -- GnuPG-bug-id: 3283 Signed-off-by: NIIBE Yutaka diff --git a/.gitignore b/.gitignore index 5d481aa..704d3ca 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ po/messages.mo /libtool /stamp-h1 /Makefile.in +/VERSION cipher/Makefile.in cipher/gost-s-box cipher/gost-sb.h diff --git a/Makefile.am b/Makefile.am index f97af7f..21e91ac 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,14 +38,12 @@ EXTRA_DIST = autogen.sh autogen.rc README.GIT LICENSES \ ChangeLog-2011 build-aux/ChangeLog-2011 doc/ChangeLog-2011 \ m4/ChangeLog-2011 cipher/ChangeLog-2011 src/ChangeLog-2011 \ random/ChangeLog-2011 tests/ChangeLog-2011 mpi/ChangeLog-2011 \ - build-aux/git-log-footer build-aux/git-log-fix + build-aux/git-log-footer build-aux/git-log-fix VERSION DISTCLEANFILES = -# Add all the files listed in "distfiles" files to the distribution, -# apply version number s to some files and create a VERSION file which -# we need for the Prereq: patch file trick. +# Add all the files listed in "distfiles" files to the distribution dist-hook: gen-ChangeLog @set -e; \ for file in `cd $(top_srcdir); \ @@ -56,8 +54,6 @@ dist-hook: gen-ChangeLog || cp -p $(top_srcdir)/$$dir/$$i $(distdir)/$$dir/$$i; \ done ; \ done - @set -e; \ - echo "$(VERSION)" > $(distdir)/VERSION distcheck-hook: set -e; ( \ diff --git a/autogen.sh b/autogen.sh index 471193c..9b36158 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,6 +1,6 @@ #! /bin/sh # autogen.sh -# Copyright (C) 2003, 2014 g10 Code GmbH +# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -15,7 +15,7 @@ # configure it for the respective package. It is maintained as part of # GnuPG and source copied by other packages. # -# Version: 2014-01-10 +# Version: 2018-07-10 configure_ac="configure.ac" @@ -41,7 +41,7 @@ fatal () { info () { if [ -z "${SILENT}" ]; then - echo "autogen.sh:" "$*" + echo "autogen.sh:" "$*" >&2 fi } @@ -70,6 +70,8 @@ MSGMERGE=${GETTEXT_PREFIX}${MSGMERGE:-msgmerge}${GETTEXT_SUFFIX} DIE=no FORCE= SILENT= +PRINT_HOST=no +PRINT_BUILD=no tmp=$(dirname "$0") tsdir=$(cd "${tmp}"; pwd) @@ -77,7 +79,18 @@ if [ -n "${AUTOGEN_SH_SILENT}" ]; then SILENT=" --silent" fi if test x"$1" = x"--help"; then - echo "usage: ./autogen.sh [--silent] [--force] [--build-TYPE] [ARGS]" + echo "usage: ./autogen.sh [OPTIONS] [ARGS]" + echo " Options:" + echo " --silent Silent operation" + echo " --force Pass --force to autoconf" + echo " --find-version Helper for configure.ac" + echo " --git-build Run all commands to build from a Git" + echo " --print-host Print only the host triplet" + echo " --print-build Print only the build platform triplet" + echo " --build-TYPE Configure to cross build for TYPE" + echo "" + echo " ARGS are passed to configure in --build-TYPE mode." + echo " Configuration for this script is expected in autogen.rc" exit 0 fi if test x"$1" = x"--silent"; then @@ -88,6 +101,14 @@ if test x"$1" = x"--force"; then FORCE=" --force" shift fi +if test x"$1" = x"--print-host"; then + PRINT_HOST=yes + shift +fi +if test x"$1" = x"--print-build"; then + PRINT_BUILD=yes + shift +fi # Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces @@ -133,6 +154,15 @@ amd64_toolprefixes= myhost="" myhostsub="" case "$1" in + --find-version) + myhost="find-version" + SILENT=" --silent" + shift + ;; + --git-build) + myhost="git-build" + shift + ;; --build-w32) myhost="w32" shift @@ -161,6 +191,25 @@ esac die_p +# **** GIT BUILD **** +# This is a helper to build from git. +if [ "$myhost" = "git-build" ]; then + tmp="$(pwd)" + cd "$tsdir" || fatal "error cd-ing to $tsdir" + ./autogen.sh || fatal "error running ./autogen.sh" + cd "$tmp" || fatal "error cd-ing back to $tmp" + die_p + "$tsdir"/configure || fatal "error running $tsdir/configure" + die_p + make || fatal "error running make" + die_p + make check || fatal "error running male check" + die_p + exit 0 +fi +# **** end GIT BUILD **** + + # Source our configuration if [ -f "${tsdir}/autogen.rc" ]; then . "${tsdir}/autogen.rc" @@ -172,16 +221,78 @@ if [ -f "$HOME/.gnupg-autogen.rc" ]; then . "$HOME/.gnupg-autogen.rc" fi + +# **** FIND VERSION **** +# This is a helper for the configure.ac M4 magic +# Called +# ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO] +# returns a complete version string with automatic beta numbering. +if [ "$myhost" = "find-version" ]; then + package="$1" + major="$2" + minor="$3" + micro="$4" + + if [ -z "$package" -o -z "$major" -o -z "$minor" ]; then + echo "usage: ./autogen.sh --find-version PACKAGE MAJOR MINOR [MICRO]" >&2 + exit 1 + fi + + if [ -z "$micro" ]; then + matchstr1="$package-$major.[0-9]*" + matchstr2="$package-$major-base" + vers="$major.$minor" + else + matchstr1="$package-$major.$minor.[0-9]*" + matchstr2="$package-$major.$minor-base" + vers="$major.$minor.$micro" + fi + + beta=no + if [ -e .git ]; then + ingit=yes + tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null) + tmp=$(echo "$tmp" | sed s/^"$package"//) + if [ -n "$tmp" ]; then + tmp=$(echo "$tmp" | sed s/^"$package"// \ + | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') + else + tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \ + | awk -F- '$4!=0{print"-beta"$4}') + fi + [ -n "$tmp" ] && beta=yes + rev=$(git rev-parse --short HEAD | tr -d '\n\r') + rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null))) + else + ingit=no + beta=yes + tmp="-unknown" + rev="0000000" + rvd="0" + fi + + echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:" + exit 0 +fi +# **** end FIND VERSION **** + + +if [ ! -f "$tsdir/build-aux/config.guess" ]; then + fatal "$tsdir/build-aux/config.guess not found" + exit 1 +fi +build=`$tsdir/build-aux/config.guess` +if [ $PRINT_BUILD = yes ]; then + echo "$build" + exit 0 +fi + + + # ****************** # W32 build script # ****************** if [ "$myhost" = "w32" ]; then - if [ ! -f "$tsdir/build-aux/config.guess" ]; then - fatal "$tsdir/build-aux/config.guess not found" - exit 1 - fi - build=`$tsdir/build-aux/config.guess` - case $myhostsub in ce) w32root="$w32ce_root" @@ -222,6 +333,10 @@ if [ "$myhost" = "w32" ]; then fi die_p fi + if [ $PRINT_HOST = yes ]; then + echo "$host" + exit 0 + fi if [ -f "$tsdir/config.log" ]; then if ! head $tsdir/config.log | grep "$host" >/dev/null; then @@ -232,7 +347,8 @@ if [ "$myhost" = "w32" ]; then $tsdir/configure --enable-maintainer-mode ${SILENT} \ --prefix=${w32root} \ - --host=${host} --build=${build} \ + --host=${host} --build=${build} SYSROOT=${w32root} \ + PKG_CONFIG_LIBDIR=${w32root}/lib/pkgconfig \ ${configure_opts} ${extraoptions} "$@" rc=$? exit $rc @@ -242,13 +358,6 @@ fi # ***** AMD64 cross build script ******* # Used to cross-compile for AMD64 (for testing) if [ "$myhost" = "amd64" ]; then - shift - if [ ! -f $tsdir/build-aux/config.guess ]; then - echo "$tsdir/build-aux/config.guess not found" >&2 - exit 1 - fi - build=`$tsdir/build-aux/config.guess` - [ -z "$amd64root" ] && amd64root="$HOME/amd64root" info "Using $amd64root as standard install directory" replace_sysroot @@ -269,6 +378,10 @@ if [ "$myhost" = "amd64" ]; then echo "Stop." >&2 exit 1 fi + if [ $PRINT_HOST = yes ]; then + echo "$host" + exit 0 + fi if [ -f "$tsdir/config.log" ]; then if ! head $tsdir/config.log | grep "$host" >/dev/null; then @@ -341,13 +454,16 @@ fi # Check the git setup. if [ -d .git ]; then - CP="cp -a" - [ -z "${SILENT}" ] && CP="$CP -v" + CP="cp -p" + # If we have a GNU cp we can add -v + if cp --version >/dev/null 2>/dev/null; then + [ -z "${SILENT}" ] && CP="$CP -v" + fi if [ -f .git/hooks/pre-commit.sample -a ! -f .git/hooks/pre-commit ] ; then [ -z "${SILENT}" ] && cat <VERSION]) +AC_INIT([mym4_package],[mym4_version], [https://bugs.gnupg.org]) # LT Version numbers, remember to change them just *before* a release. +# (Code changed: REVISION++) +# (Interfaces added/removed/changed: CURRENT++, REVISION=0) +# (Interfaces added: AGE++) +# (Interfaces removed: AGE=0) +# # (Interfaces removed: CURRENT++, AGE=0, REVISION=0) # (Interfaces added: CURRENT++, AGE++, REVISION=0) # (No interfaces changed: REVISION++) LIBGCRYPT_LT_CURRENT=23 LIBGCRYPT_LT_AGE=3 LIBGCRYPT_LT_REVISION=0 +################################################ +AC_SUBST(LIBGCRYPT_LT_CURRENT) +AC_SUBST(LIBGCRYPT_LT_AGE) +AC_SUBST(LIBGCRYPT_LT_REVISION) # If the API is changed in an incompatible way: increment the next counter. # @@ -69,9 +74,6 @@ LIBGCRYPT_CONFIG_API_VERSION=1 # unnecessary error code defines in src/gcrypt-int.h. NEED_GPG_ERROR_VERSION=1.25 -PACKAGE=$PACKAGE_NAME -VERSION=$PACKAGE_VERSION - AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([src/libgcrypt.vers]) AM_INIT_AUTOMAKE([serial-tests dist-bzip2]) @@ -123,18 +125,6 @@ AH_VERBATIM([_REENTRANT], ]) -AC_SUBST(LIBGCRYPT_LT_CURRENT) -AC_SUBST(LIBGCRYPT_LT_AGE) -AC_SUBST(LIBGCRYPT_LT_REVISION) -AC_SUBST(PACKAGE) -AC_SUBST(VERSION) -AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package]) -AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version of this package]) -VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_version_major \ - mym4_version_minor mym4_version_micro) -AC_SUBST(VERSION_NUMBER) - - ###################### ## Basic checks. ### (we need some results later on (e.g. $GCC) ###################### @@ -156,6 +146,10 @@ AC_PROG_AWK AC_GNU_SOURCE +VERSION_NUMBER=m4_esyscmd(printf "0x%02x%02x%02x" mym4_major \ + mym4_minor mym4_micro) +AC_SUBST(VERSION_NUMBER) + # We need to compile and run a program on the build machine. A # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in # the AC archive is broken for autoconf 2.57. Given that there is no @@ -2642,9 +2636,11 @@ AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION", [GIT commit id revision used to build this package]) changequote(,)dnl -BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'` +BUILD_VERSION=`echo "$PACKAGE_VERSION" | sed 's/\([0-9.]*\).*/\1./'` changequote([,])dnl -BUILD_FILEVERSION="${BUILD_FILEVERSION}mym4_revision_dec" +BUILD_VERSION="${BUILD_VERSION}mym4_revision_dec" +BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,` +AC_SUBST(BUILD_VERSION) AC_SUBST(BUILD_FILEVERSION) AC_ARG_ENABLE([build-timestamp], ----------------------------------------------------------------------- Summary of changes: .gitignore | 1 + Makefile.am | 8 +-- autogen.sh | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++-------- configure.ac | 72 +++++++++++++------------- 4 files changed, 178 insertions(+), 65 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From jancar.jj at gmail.com Thu Oct 18 11:51:57 2018 From: jancar.jj at gmail.com (=?UTF-8?B?SsOhbiBKYW7EjcOhcg==?=) Date: Thu, 18 Oct 2018 11:51:57 +0200 Subject: ECDH loads parameters as signed Message-ID: Hi all, while trying to get libgcrypt to do ECDH I think I came up to a bug, or at least a bit of unexpected behavior. See the attached test.c for a proof-of-concept that fails/loops indefinitely, but should work. The issue is that ecc_encrypt_raw/ecc_decrypt_raw extract the domain parameters from the keys using the signed option in sexp_extract_param. This means that if keys are generated, then exported into unsigned MPIs from the S-exps, then again built into S-exps using the unsigned notation %M, and passed into ecc_encrypt_raw/ecc_decrypt_raw, they will still be considered signed if their highest bit is set. This is a problem for most curves that have such primes/parameters. The attached patch fixes this problem and the proof-of-concept works. Cheers, J?n Jan??r -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-ecc-Fix-loading-of-parameters-in-ecdh.patch Type: text/x-patch Size: 1534 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test.c Type: text/x-csrc Size: 3061 bytes Desc: not available URL: From cvs at cvs.gnupg.org Tue Oct 23 22:59:45 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Tue, 23 Oct 2018 22:59:45 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-90-ge2da4e8 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via e2da4e8dee4b371804f3b2659b53431fb6380d93 (commit) via 9f2c7ec4d8b07e82663ad084c90c016d3c3b80c2 (commit) via 282f238f7788267768e823c0976aff15aeaff103 (commit) from 0f2c6ce2c9504c6df435463243edaa669e57b109 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit e2da4e8dee4b371804f3b2659b53431fb6380d93 Author: Werner Koch Date: Tue Oct 23 22:58:09 2018 +0200 ecc: Fix potential unintended freeing of an internal param. * cipher/ecc-curves.c (_gcry_ecc_get_mpi): Fix c+p error -- GnuPG-bug-id: 4208 Signed-off-by: Werner Koch diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index 86d0b4e..75d7161 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -1206,7 +1206,7 @@ _gcry_ecc_get_mpi (const char *name, mpi_ec_t ec, int copy) if (!strcmp (name, "q.x") && ec->Q && ec->Q->x) return mpi_is_const (ec->Q->x) && !copy? ec->Q->x : mpi_copy (ec->Q->x); if (!strcmp (name, "q.y") && ec->Q && ec->Q->y) - return mpi_is_const (ec->G->y) && !copy? ec->Q->y : mpi_copy (ec->Q->y); + return mpi_is_const (ec->Q->y) && !copy? ec->Q->y : mpi_copy (ec->Q->y); /* If the base point has been requested, return it in standard encoding. */ commit 9f2c7ec4d8b07e82663ad084c90c016d3c3b80c2 Author: Werner Koch Date: Tue Oct 23 22:51:40 2018 +0200 sexp: Fix uninitialized use of a var in the error case. * src/sexp.c (_gcry_sexp_vextract_param): Initialize L1. -- GnuPG-bug-id: 4212 Signed-off-by: Werner Koch diff --git a/src/gcrypt.h.in b/src/gcrypt.h.in index d2dfe80..36bbf20 100644 --- a/src/gcrypt.h.in +++ b/src/gcrypt.h.in @@ -1318,7 +1318,7 @@ gpg_error_t gcry_md_extract (gcry_md_hd_t hd, int algo, void *buffer, size_t length); /* Convenience function to calculate the hash from the data in BUFFER - of size LENGTH using the algorithm ALGO avoiding the creating of a + of size LENGTH using the algorithm ALGO avoiding the creation of a hash object. The hash is returned in the caller provided buffer DIGEST which must be large enough to hold the digest of the given algorithm. */ diff --git a/src/sexp.c b/src/sexp.c index 9d89268..f2a164c 100644 --- a/src/sexp.c +++ b/src/sexp.c @@ -2232,7 +2232,7 @@ _gcry_sexp_vextract_param (gcry_sexp_t sexp, const char *path, gcry_mpi_t *array[20]; char arrayisdesc[20]; int idx; - gcry_sexp_t l1; + gcry_sexp_t l1 = NULL; int mode = '+'; /* Default to GCRYMPI_FMT_USG. */ gcry_sexp_t freethis = NULL; commit 282f238f7788267768e823c0976aff15aeaff103 Author: Werner Koch Date: Thu Jun 14 10:39:53 2018 +0200 doc: Fix example for gcry_sexp_extract_param -- diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi index 4cae489..4f4f973 100644 --- a/doc/gcrypt.texi +++ b/doc/gcrypt.texi @@ -4472,14 +4472,15 @@ an @code{gcry_mpi_t} variable is expected that must be set to is expected. For example @example - _gcry_sexp_extract_param (key, NULL, "n/x+e d-'foo'", - &mpi_n, &mpi_x, &mpi_e, &mpi_foo, NULL) + gcry_sexp_extract_param (key, NULL, "n/x+e d-'foo'", + &mpi_n, &mpi_x, &mpi_e, &mpi_d, &mpi_foo, NULL) @end example stores the parameter 'n' from @var{key} as an unsigned MPI into @var{mpi_n}, the parameter 'x' as an opaque MPI into @var{mpi_x}, the -parameter 'e' again as an unsigned MPI into @var{mpi_e}, and the -parameter 'foo' as a signed MPI. +parameters 'e' and 'd' again as an unsigned MPI into @var{mpi_e} and + at var{mpi_d} and finally the parameter 'foo' as a signed MPI into + at var{mpi_foo}. @var{path} is an optional string used to locate a token. The exclamation mark separated tokens are used via ----------------------------------------------------------------------- Summary of changes: cipher/ecc-curves.c | 2 +- doc/gcrypt.texi | 9 +++++---- src/gcrypt.h.in | 2 +- src/sexp.c | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Wed Oct 24 08:26:10 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Wed, 24 Oct 2018 08:26:10 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-95-gc60eabb Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via c60eabb11435665fa84a3a82b2a15f48870cc4d7 (commit) via 7da887d69d72ea0ea0d106054c48a8c03e242a18 (commit) via 97194b422bc89a6137f4e218d4cdee118c63e96e (commit) via 5b1febb5e40d92072bef425bd9e63f7a07edd57e (commit) via 0f4545b441b6fbdd6e9c4e95f5f2a367483e78ad (commit) from e2da4e8dee4b371804f3b2659b53431fb6380d93 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit c60eabb11435665fa84a3a82b2a15f48870cc4d7 Author: NIIBE Yutaka Date: Wed Oct 24 15:13:40 2018 +0900 build: Compatibility to pkg-config. * src/libgcrypt-config.in: Support --variable and --modversion. Signed-off-by: NIIBE Yutaka diff --git a/src/libgcrypt-config.in b/src/libgcrypt-config.in index f7a13af..6b3b356 100644 --- a/src/libgcrypt-config.in +++ b/src/libgcrypt-config.in @@ -96,7 +96,19 @@ while test $# -gt 0; do --exec-prefix) echo_exec_prefix=yes ;; - --version) + --variable=*) + case "${1#*=}" in + prefix) echo "$prefix" ;; + exec_prefix) echo "$exec_prefix" ;; + host) echo "$my_host" ;; + api_version) echo "$api_version" ;; + symmetric_ciphers) echo "$symmetric_ciphers" ;; + asymmetric_ciphers) echo "$asymmetric_ciphers" ;; + digests) echo "$digests" ;; + esac + exit 0 + ;; + --modversion|--version) echo_version=yes ;; --api-version) commit 7da887d69d72ea0ea0d106054c48a8c03e242a18 Author: NIIBE Yutaka Date: Wed Oct 24 15:07:18 2018 +0900 build: Make libgcrypt.m4 use gpg-error-config. * src/libgcrypt.m4: Use gpg-error-config. -- With the option --with-libgcrypt-prefix, it still keeps using libgcrypt-config script. Signed-off-by: NIIBE Yutaka diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4 index c67cfec..df6469d 100644 --- a/src/libgcrypt.m4 +++ b/src/libgcrypt.m4 @@ -1,5 +1,5 @@ # libgcrypt.m4 - Autoconf macros to detect libgcrypt -# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH +# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2014-10-02 +# Last-changed: 2018-10-24 dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, @@ -29,6 +29,7 @@ dnl is added to the gpg_config_script_warn variable. dnl AC_DEFUN([AM_PATH_LIBGCRYPT], [ AC_REQUIRE([AC_CANONICAL_HOST]) + AC_REQUIRE([AM_PATH_GPG_ERROR]) AC_ARG_WITH(libgcrypt-prefix, AC_HELP_STRING([--with-libgcrypt-prefix=PFX], [prefix where LIBGCRYPT is installed (optional)]), @@ -44,15 +45,16 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], fi ;; '') + LIBGCRYPT_CONFIG="$GPG_ERROR_CONFIG libgcrypt" ;; *) + LIBGCRYPT_CONFIG="$GPG_ERROR_CONFIG libgcrypt" AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.]) ;; esac fi fi - AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) tmp=ifelse([$1], ,1:1.2.0,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` @@ -71,7 +73,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` + libgcrypt_config_version=`CC=$CC $LIBGCRYPT_CONFIG --modversion` major=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $libgcrypt_config_version | \ @@ -103,7 +105,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then - tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` + tmp=`CC=$CC $LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then AC_MSG_CHECKING([LIBGCRYPT API version]) if test "$req_libgcrypt_api" -eq "$tmp" ; then @@ -116,15 +118,15 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], fi fi if test $ok = yes; then - LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` - LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` + LIBGCRYPT_CFLAGS=`CC=$CC $LIBGCRYPT_CONFIG --cflags` + LIBGCRYPT_LIBS=`CC=$CC $LIBGCRYPT_CONFIG --libs` ifelse([$2], , :, [$2]) - libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` + libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` if test x"$libgcrypt_config_host" != xnone ; then if test x"$libgcrypt_config_host" != x"$host" ; then AC_MSG_WARN([[ *** -*** The config script $LIBGCRYPT_CONFIG was +*** The config script "$LIBGCRYPT_CONFIG" was *** built for $libgcrypt_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-libgcrypt-prefix commit 97194b422bc89a6137f4e218d4cdee118c63e96e Author: NIIBE Yutaka Date: Wed Oct 24 14:57:53 2018 +0900 build: Provide libgcrypt.pc, generated by configure. * configure.ac: Generate src/libgcrypt.pc. * src/Makefile.am (pkgconfigdir, pkgconfig_DATA): New. (EXTRA_DIST): Add libgcrypt.pc.in. * src/libgcrypt-config.in: Use @PACKAGE_VERSION at . * src/libgcrypt.pc.in: New. Signed-off-by: NIIBE Yutaka diff --git a/configure.ac b/configure.ac index 7658f6c..cdce339 100644 --- a/configure.ac +++ b/configure.ac @@ -2670,6 +2670,7 @@ doc/Makefile src/Makefile src/gcrypt.h src/libgcrypt-config +src/libgcrypt.pc src/versioninfo.rc tests/Makefile ]) diff --git a/src/Makefile.am b/src/Makefile.am index 3cc4a55..82d6e8a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,8 +20,11 @@ ## Process this file with automake to produce Makefile.in +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = libgcrypt.pc + EXTRA_DIST = libgcrypt-config.in libgcrypt.m4 libgcrypt.vers \ - gcrypt.h.in libgcrypt.def + gcrypt.h.in libgcrypt.def libgcrypt.pc.in bin_SCRIPTS = libgcrypt-config m4datadir = $(datadir)/aclocal diff --git a/src/libgcrypt-config.in b/src/libgcrypt-config.in index c052638..f7a13af 100644 --- a/src/libgcrypt-config.in +++ b/src/libgcrypt-config.in @@ -14,7 +14,7 @@ # General. prefix="@prefix@" exec_prefix="@exec_prefix@" -version="@VERSION@" +version="@PACKAGE_VERSION@" includedir="@includedir@" libdir="@libdir@" gpg_error_libs="@GPG_ERROR_LIBS@" diff --git a/src/libgcrypt.pc.in b/src/libgcrypt.pc.in new file mode 100644 index 0000000..5472da5 --- /dev/null +++ b/src/libgcrypt.pc.in @@ -0,0 +1,17 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ +host=@LIBGCRYPT_CONFIG_HOST@ +api_version=@LIBGCRYPT_CONFIG_API_VERSION@ +symmetric_ciphers="@LIBGCRYPT_CIPHERS@" +asymmetric_ciphers="@LIBGCRYPT_PUBKEY_CIPHERS@" +digests="@LIBGCRYPT_DIGESTS@" + +Name: libgcrypt +Description: General purpose cryptographic library +Requires: gpg-error +Version: @PACKAGE_VERSION@ +Cflags: @LIBGCRYPT_CONFIG_CFLAGS@ +Libs: @LIBGCRYPT_CONFIG_LIB@ +URL: https://www.gnupg.org/software/libgcrypt/index.html commit 5b1febb5e40d92072bef425bd9e63f7a07edd57e Author: NIIBE Yutaka Date: Wed Oct 24 14:33:23 2018 +0900 build: Update gpg-error.m4 from libgpg-error. * m4/gpg-error.m4: Update from libgpg-error 1.33. Signed-off-by: NIIBE Yutaka diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index 1661204..9f26fa4 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -70,7 +70,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpg_error_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - gpg_error_config_version=`$GPG_ERROR_CONFIG $gpg_error_config_args --version` + gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --version` major=`echo $gpg_error_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $gpg_error_config_version | \ @@ -86,13 +86,15 @@ AC_DEFUN([AM_PATH_GPG_ERROR], fi fi if test $ok = yes; then - GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --cflags` - GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --libs` - GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null` - GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null` + GPG_ERROR_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --cflags` + GPG_ERROR_LIBS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --libs` + GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --variable=mtcflags 2>/dev/null` + GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS" + GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --variable=mtlibs 2>/dev/null` + GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS" AC_MSG_RESULT([yes ($gpg_error_config_version)]) ifelse([$2], , :, [$2]) - gpg_error_config_host=`$GPG_ERROR_CONFIG $gpg_error_config_args --host 2>/dev/null || echo none` + gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --variable=host 2>/dev/null || echo none` if test x"$gpg_error_config_host" != xnone ; then if test x"$gpg_error_config_host" != x"$host" ; then AC_MSG_WARN([[ @@ -100,7 +102,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR], *** The config script $GPG_ERROR_CONFIG was *** built for $gpg_error_config_host and thus may not match the *** used host $host. -*** You may want to use the configure option --with-gpg-error-prefix +*** You may want to use the configure option --with-libgpg-error-prefix *** to specify a matching config script or use \$SYSROOT. ***]]) gpg_config_script_warn="$gpg_config_script_warn libgpg-error" commit 0f4545b441b6fbdd6e9c4e95f5f2a367483e78ad Author: NIIBE Yutaka Date: Wed Oct 24 14:29:45 2018 +0900 build: Don't default to underscore=yes for cross-build. * acinclude.m4: Don't set ac_cv_sys_symbol_underscore for cross build. -- It made sense in the past when cross compile were basically for a.out system, but nowadays, it's better not to assume that. Signed-off-by: NIIBE Yutaka diff --git a/acinclude.m4 b/acinclude.m4 index fc208c5..6f7789d 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -111,14 +111,10 @@ case "${host}" in ac_cv_sys_symbol_underscore=yes ;; *) - if test "$cross_compiling" = yes; then - if test "x$ac_cv_sys_symbol_underscore" = x ; then - ac_cv_sys_symbol_underscore=yes - fi - else + if test "$cross_compiling" != yes; then tmp_do_check="yes" fi - ;; + ;; esac if test "$tmp_do_check" = "yes"; then AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE]) ----------------------------------------------------------------------- Summary of changes: acinclude.m4 | 8 ++------ configure.ac | 1 + m4/gpg-error.m4 | 16 +++++++++------- src/Makefile.am | 5 ++++- src/libgcrypt-config.in | 16 ++++++++++++++-- src/libgcrypt.m4 | 20 +++++++++++--------- src/libgcrypt.pc.in | 17 +++++++++++++++++ 7 files changed, 58 insertions(+), 25 deletions(-) create mode 100644 src/libgcrypt.pc.in hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Wed Oct 24 08:35:19 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Wed, 24 Oct 2018 08:35:19 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-96-g0e07137 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 0e071372fc0e6fed4a449955ed0789803ba5e709 (commit) from c60eabb11435665fa84a3a82b2a15f48870cc4d7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0e071372fc0e6fed4a449955ed0789803ba5e709 Author: NIIBE Yutaka Date: Wed Oct 24 15:34:57 2018 +0900 build: Fix libgcrypt.pc. * src/libgcrypt.pc.in: Fix typo. Signed-off-by: NIIBE Yutaka diff --git a/src/libgcrypt.pc.in b/src/libgcrypt.pc.in index 5472da5..ec68fa2 100644 --- a/src/libgcrypt.pc.in +++ b/src/libgcrypt.pc.in @@ -13,5 +13,5 @@ Description: General purpose cryptographic library Requires: gpg-error Version: @PACKAGE_VERSION@ Cflags: @LIBGCRYPT_CONFIG_CFLAGS@ -Libs: @LIBGCRYPT_CONFIG_LIB@ +Libs: @LIBGCRYPT_CONFIG_LIBS@ URL: https://www.gnupg.org/software/libgcrypt/index.html ----------------------------------------------------------------------- Summary of changes: src/libgcrypt.pc.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Wed Oct 24 10:03:41 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 24 Oct 2018 10:03:41 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-97-g149ceb3 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 149ceb3cae03d0385341d32430aa5ae57de90007 (commit) from 0e071372fc0e6fed4a449955ed0789803ba5e709 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 149ceb3cae03d0385341d32430aa5ae57de90007 Author: Werner Koch Date: Wed Oct 24 09:50:17 2018 +0200 ecc: Fix possible memory leakage in parameter check of eddsa. * cipher/ecc-eddsa.c (_gcry_ecc_eddsa_verify): Fix mem leak. -- GnuPG-bug-id: 4209 Signed-off-by: Werner Koch diff --git a/cipher/ecc-eddsa.c b/cipher/ecc-eddsa.c index 813e030..89b708a 100644 --- a/cipher/ecc-eddsa.c +++ b/cipher/ecc-eddsa.c @@ -760,7 +760,10 @@ _gcry_ecc_eddsa_verify (gcry_mpi_t input, ECC_public_key *pkey, pkey->E.p, pkey->E.a, pkey->E.b); b = ctx->nbits/8; if (b != 256/8) - return GPG_ERR_INTERNAL; /* We only support 256 bit. */ + { + rc = GPG_ERR_INTERNAL; /* We only support 256 bit. */ + goto leave; + } /* Decode and check the public key. */ rc = _gcry_ecc_eddsa_decodepoint (pk, ctx, &Q, &encpk, &encpklen); ----------------------------------------------------------------------- Summary of changes: cipher/ecc-eddsa.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Wed Oct 24 11:55:47 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 24 Oct 2018 11:55:47 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-99-gf74687f Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via f74687fd43f5772a372f54031d5a9527597f4ce4 (commit) via e57e75ea517f32109b508113f18298fc69fd1192 (commit) from 149ceb3cae03d0385341d32430aa5ae57de90007 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f74687fd43f5772a372f54031d5a9527597f4ce4 Author: Werner Koch Date: Wed Oct 24 11:55:34 2018 +0200 Fix memory leak in secmem in out of core conditions. * src/secmem.c (_gcry_secmem_malloc_internal): Release pool descriptor if the pool could not be allocated. -- GnuPG-bug-id: 4211 Signed-off-by: Werner Koch diff --git a/src/secmem.c b/src/secmem.c index 79c135f..3e091d8 100644 --- a/src/secmem.c +++ b/src/secmem.c @@ -658,7 +658,10 @@ _gcry_secmem_malloc_internal (size_t size, int xhint) pool->size = auto_expand? auto_expand : STANDARD_POOL_SIZE; pool->mem = malloc (pool->size); if (!pool->mem) - return NULL; /* Not enough memory available for a new pool. */ + { + free (pool); + return NULL; /* Not enough memory available for a new pool. */ + } /* Initialize first memory block. */ mb = (memblock_t *) pool->mem; mb->size = pool->size - BLOCK_HEAD_SIZE; commit e57e75ea517f32109b508113f18298fc69fd1192 Author: Werner Koch Date: Wed Oct 24 11:50:46 2018 +0200 ecc: Fix memory leak in the error case of ecc_encrypt_raw * cipher/ecc.c (ecc_encrypt_raw): Add proper error cleanup in the main block. -- GnuPG-bug-id: 4210 Signed-off-by: Werner Koch diff --git a/cipher/ecc.c b/cipher/ecc.c index 4e3e5b1..3f221a2 100644 --- a/cipher/ecc.c +++ b/cipher/ecc.c @@ -1392,6 +1392,7 @@ ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms) unsigned char *rawmpi; unsigned int rawmpilen; + rc = 0; x = mpi_new (0); if (ec->model == MPI_EC_MONTGOMERY) y = NULL; @@ -1418,7 +1419,7 @@ ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms) if (!(flags & PUBKEY_FLAG_DJB_TWEAK)) { /* It's not for X25519, then, the input data was simply wrong. */ rc = GPG_ERR_INV_DATA; - goto leave; + goto leave_main; } } if (y) @@ -1443,7 +1444,7 @@ ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms) if (_gcry_mpi_ec_get_affine (x, y, &R, ec)) { rc = GPG_ERR_INV_DATA; - goto leave; + goto leave_main; } if (y) mpi_e = _gcry_ecc_ec2os (x, y, pk.E.p); @@ -1461,11 +1462,12 @@ ecc_encrypt_raw (gcry_sexp_t *r_ciph, gcry_sexp_t s_data, gcry_sexp_t keyparms) } } - + leave_main: mpi_free (x); mpi_free (y); - point_free (&R); + if (rc) + goto leave; } if (!rc) ----------------------------------------------------------------------- Summary of changes: cipher/ecc.c | 10 ++++++---- src/secmem.c | 5 ++++- 2 files changed, 10 insertions(+), 5 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Wed Oct 24 12:06:43 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 24 Oct 2018 12:06:43 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-100-g0cfd41c Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 0cfd41c662792cd5707a7bd738c341c29abdb4e7 (commit) from f74687fd43f5772a372f54031d5a9527597f4ce4 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 0cfd41c662792cd5707a7bd738c341c29abdb4e7 Author: Werner Koch Date: Wed Oct 24 12:06:07 2018 +0200 doc: Update yat2m.c from upstream (libgpg-error) -- GnuPG-bug-id: 4102 Signed-off-by: Werner Koch diff --git a/doc/yat2m.c b/doc/yat2m.c index 7599081..3c7b363 100644 --- a/doc/yat2m.c +++ b/doc/yat2m.c @@ -1,5 +1,5 @@ /* yat2m.c - Yet Another Texi 2 Man converter - * Copyright (C) 2005, 2013, 2015, 2016 g10 Code GmbH + * Copyright (C) 2005, 2013, 2015, 2016, 2017 g10 Code GmbH * Copyright (C) 2006, 2008, 2011 Free Software Foundation, Inc. * * This program is free software; you can redistribute it and/or modify @@ -128,7 +128,11 @@ #define PGM "yat2m" -#define VERSION "1.0" +#ifdef PACKAGE_VERSION +# define VERSION PACKAGE_VERSION +#else +# define VERSION "1.0" +#endif /* The maximum length of a line including the linefeed and one extra character. */ @@ -353,7 +357,7 @@ ascii_strupr (char *string) const char * isodatestring (void) { - static char buffer[11+5]; + static char buffer[36]; struct tm *tp; time_t atime; @@ -482,6 +486,9 @@ evaluate_conditions (const char *fname, int lnr) { int i; + (void)fname; + (void)lnr; + /* for (i=0; i < condition_stack_idx; i++) */ /* inf ("%s:%d: stack[%d] %s %s %c", */ /* fname, lnr, i, condition_stack[i]->isset? "set":"clr", */ @@ -729,7 +736,8 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len, { "asis", 7 }, { "anchor", 7 }, { "cartouche", 1 }, - { "xref", 0, "see: [", "]" }, + { "ref", 0, "[", "]" }, + { "xref", 0, "See: [", "]" }, { "pxref", 0, "see: [", "]" }, { "uref", 0, "(\\fB", "\\fR)" }, { "footnote",0, " ([", "])" }, @@ -746,7 +754,7 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len, { "subsection", 6, "\n.SS " }, { "chapheading", 0}, { "item", 2, ".TP\n.B " }, - { "itemx", 2, ".TP\n.B " }, + { "itemx", 2, ".TQ\n.B " }, { "table", 3 }, { "itemize", 3 }, { "bullet", 0, "* " }, @@ -793,6 +801,8 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len, { if ((*table_level)-- > 1) fputs (".RE\n", fp); + else + fputs (".P\n", fp); } else if (n >= 7 && !memcmp (s, "example", 7) && (!n || s[7] == ' ' || s[7] == '\t' || s[7] == '\n')) @@ -850,18 +860,20 @@ proc_texi_cmd (FILE *fp, const char *command, const char *rest, size_t len, } else { - size_t len = s - (rest + 1); + size_t rlen = s - (rest + 1); macro_t m; for (m = variablelist; m; m = m->next) - if (strlen (m->name) == len - &&!strncmp (m->name, rest+1, len)) - break; + { + if (strlen (m->name) == rlen + && !strncmp (m->name, rest+1, rlen)) + break; + } if (m) fputs (m->value, fp); else inf ("texinfo variable '%.*s' is not set", - (int)len, rest+1); + (int)rlen, rest+1); } } break; @@ -1475,6 +1487,7 @@ int main (int argc, char **argv) { int last_argc = -1; + const char *s; opt_source = "GNU"; opt_release = ""; @@ -1513,13 +1526,13 @@ main (int argc, char **argv) " -I DIR also search in include DIR\n" " -D gpgone the only usable define\n\n" "With no FILE, or when FILE is -, read standard input.\n\n" - "Report bugs to ."); + "Report bugs to ."); exit (0); } else if (!strcmp (*argv, "--version")) { puts (PGM " " VERSION "\n" - "Copyright (C) 2005 g10 Code GmbH\n" + "Copyright (C) 2005, 2017 g10 Code GmbH\n" "This program comes with ABSOLUTELY NO WARRANTY.\n" "This is free software, and you are welcome to redistribute it\n" "under certain conditions. See the file COPYING for details."); @@ -1608,6 +1621,11 @@ main (int argc, char **argv) if (argc > 1) die ("usage: " PGM " [OPTION] [FILE] (try --help for more information)\n"); + /* Take care of supplied timestamp for reproducible builds. See + * https://reproducible-builds.org/specs/source-date-epoch/ */ + if (!opt_date && (s = getenv ("SOURCE_DATE_EPOCH")) && *s) + opt_date = s; + /* Start processing. */ if (argc && strcmp (*argv, "-")) { ----------------------------------------------------------------------- Summary of changes: doc/yat2m.c | 42 ++++++++++++++++++++++++++++++------------ 1 file changed, 30 insertions(+), 12 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Wed Oct 24 12:30:12 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Wed, 24 Oct 2018 12:30:12 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-102-g03bb25e Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 03bb25ee7ed6f1076bf788ab981ca68672880daa (commit) via b0ad66e48c46b79af69349606e276cf0a6b9a020 (commit) from 0cfd41c662792cd5707a7bd738c341c29abdb4e7 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 03bb25ee7ed6f1076bf788ab981ca68672880daa Author: Werner Koch Date: Wed Oct 24 12:24:44 2018 +0200 build: Add release make target * Makefile.am (release, sign-release): New targets. Signed-off-by: Werner Koch diff --git a/Makefile.am b/Makefile.am index 21e91ac..24c362a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,8 +14,17 @@ # 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, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA +# License along with this program; if not, see . +# SPDX-License-Identifier: LGPL-2.1-or-later + +# Location of the released tarball archives. Note that this is an +# internal archive and before uploading this to the public server, +# manual tests should be run and the git release tagged and pushed. +# Adjust as needed. +RELEASE_ARCHIVE_DIR = wk at vigenere:tarballs/libgpg-error/ +# The key used to sign the released sources. Adjust as needed. +RELEASE_SIGNING_KEY = D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 + ACLOCAL_AMFLAGS = -I m4 DISTCHECK_CONFIGURE_FLAGS = --disable-random-daemon --enable-doc \ @@ -88,3 +97,50 @@ gen-ChangeLog: stowinstall: $(MAKE) $(AM_MAKEFLAGS) install prefix=/usr/local/stow/libgcrypt + +# Macro to help the release target. +RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) + +release: + +(set -e;\ + if [ "$(abs_top_builddir)" = "$(abs_top_srcdir)" ]; then \ + echo "error: build directory must not be the source directory" >&2;\ + exit 2;\ + fi ;\ + echo "/* Build started at $$(date -uIseconds) */" ;\ + cd $(top_srcdir); \ + ./autogen.sh --force; \ + cd $(abs_top_builddir); \ + rm -rf dist; mkdir dist ; cd dist ; \ + $(abs_top_srcdir)/configure --enable-maintainer-mode; \ + $(MAKE) distcheck; \ + echo "/* Build finished at $$(date -uIseconds) */" ;\ + echo "/*" ;\ + echo " * Please run the final step interactivly:" ;\ + echo " * make sign-release" ;\ + echo " */" ;\ + ) 2>&1 | tee "$(RELEASE_NAME).buildlog" + +sign-release: + +(set -e; \ + cd dist; \ + files1="$(RELEASE_NAME).tar.bz2 \ + $(RELEASE_NAME).tar.gz" ; \ + files2="$(RELEASE_NAME).tar.bz2.sig \ + $(RELEASE_NAME).tar.gz.sig \ + $(RELEASE_NAME).swdb \ + $(RELEASE_NAME).buildlog" ;\ + echo "/* Signing the source tarball ..." ;\ + gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.bz2 ;\ + gpg -sbu $(RELEASE_SIGNING_KEY) $(RELEASE_NAME).tar.gz ;\ + cat $(RELEASE_NAME).swdb >swdb.snippet;\ + echo >>swdb.snippet ;\ + sha1sum $${files1} >>swdb.snippet ;\ + cat "../$(RELEASE_NAME).buildlog" swdb.snippet \ + | gzip >$(RELEASE_NAME).buildlog ;\ + echo "Copying to local archive ..." ;\ + scp -p $${files1} $${files2} $(RELEASE_ARCHIVE_DIR)/ || true;\ + echo '/*' ;\ + echo ' * All done; for checksums see dist/swdb.snippet' ;\ + echo ' */' ;\ + ) commit b0ad66e48c46b79af69349606e276cf0a6b9a020 Author: Werner Koch Date: Wed Oct 24 12:23:47 2018 +0200 build: Make distcheck work again. * cipher/Makefile.am: Prettified source file lists. EXTRA_libcipher_la_SOURCES): Add missing asm-common-aarch64.h. Signed-off-by: Werner Koch diff --git a/cipher/Makefile.am b/cipher/Makefile.am index 599e3c1..98320ca 100644 --- a/cipher/Makefile.am +++ b/cipher/Makefile.am @@ -40,75 +40,89 @@ libcipher_la_DEPENDENCIES = $(GCRYPT_MODULES) libcipher_la_LIBADD = $(GCRYPT_MODULES) libcipher_la_SOURCES = \ -cipher.c cipher-internal.h \ -cipher-cbc.c cipher-cfb.c cipher-ofb.c cipher-ctr.c cipher-aeswrap.c \ -cipher-ccm.c cipher-cmac.c cipher-gcm.c cipher-gcm-intel-pclmul.c \ - cipher-gcm-armv8-aarch32-ce.S cipher-gcm-armv8-aarch64-ce.S \ -cipher-poly1305.c cipher-ocb.c cipher-xts.c cipher-eax.c \ -cipher-selftest.c cipher-selftest.h \ -pubkey.c pubkey-internal.h pubkey-util.c \ -md.c \ -mac.c mac-internal.h \ -mac-hmac.c mac-cmac.c mac-gmac.c mac-poly1305.c \ -poly1305.c poly1305-internal.h \ -kdf.c kdf-internal.h \ -hmac-tests.c \ -bithelp.h \ -bufhelp.h \ -primegen.c \ -hash-common.c hash-common.h \ -dsa-common.c rsa-common.c \ -sha1.h + cipher.c cipher-internal.h \ + cipher-cbc.c \ + cipher-cfb.c \ + cipher-ofb.c \ + cipher-ctr.c \ + cipher-aeswrap.c \ + cipher-ccm.c \ + cipher-cmac.c \ + cipher-gcm.c cipher-gcm-intel-pclmul.c \ + cipher-gcm-armv8-aarch32-ce.S cipher-gcm-armv8-aarch64-ce.S \ + cipher-poly1305.c \ + cipher-ocb.c \ + cipher-xts.c \ + cipher-eax.c \ + cipher-selftest.c cipher-selftest.h \ + pubkey.c pubkey-internal.h pubkey-util.c \ + md.c \ + mac.c mac-internal.h \ + mac-hmac.c mac-cmac.c mac-gmac.c mac-poly1305.c \ + poly1305.c poly1305-internal.h \ + kdf.c kdf-internal.h \ + hmac-tests.c \ + bithelp.h \ + bufhelp.h \ + primegen.c \ + hash-common.c hash-common.h \ + dsa-common.c rsa-common.c \ + sha1.h EXTRA_libcipher_la_SOURCES = \ -asm-common-amd64.h \ -arcfour.c arcfour-amd64.S \ -blowfish.c blowfish-amd64.S blowfish-arm.S \ -cast5.c cast5-amd64.S cast5-arm.S \ -chacha20.c chacha20-amd64-ssse3.S chacha20-amd64-avx2.S chacha20-armv7-neon.S \ - chacha20-aarch64.S \ -crc.c \ - crc-intel-pclmul.c \ -des.c des-amd64.S \ -dsa.c \ -elgamal.c \ -ecc.c ecc-curves.c ecc-misc.c ecc-common.h \ -ecc-ecdsa.c ecc-eddsa.c ecc-gost.c \ -idea.c \ -gost28147.c gost.h \ -gostr3411-94.c \ -md4.c \ -md5.c \ -rijndael.c rijndael-internal.h rijndael-tables.h rijndael-aesni.c \ - rijndael-padlock.c rijndael-amd64.S rijndael-arm.S \ - rijndael-ssse3-amd64.c rijndael-ssse3-amd64-asm.S \ - rijndael-armv8-ce.c rijndael-armv8-aarch32-ce.S rijndael-armv8-aarch64-ce.S \ - rijndael-aarch64.S \ -rmd160.c \ -rsa.c \ -salsa20.c salsa20-amd64.S salsa20-armv7-neon.S \ -scrypt.c \ -seed.c \ -serpent.c serpent-sse2-amd64.S serpent-avx2-amd64.S serpent-armv7-neon.S \ -sha1.c sha1-ssse3-amd64.S sha1-avx-amd64.S sha1-avx-bmi2-amd64.S \ - sha1-armv7-neon.S sha1-armv8-aarch32-ce.S sha1-armv8-aarch64-ce.S \ - sha1-intel-shaext.c \ -sha256.c sha256-ssse3-amd64.S sha256-avx-amd64.S sha256-avx2-bmi2-amd64.S \ - sha256-armv8-aarch32-ce.S sha256-armv8-aarch64-ce.S sha256-intel-shaext.c \ -sha512.c sha512-ssse3-amd64.S sha512-avx-amd64.S sha512-avx2-bmi2-amd64.S \ - sha512-armv7-neon.S sha512-arm.S \ -sm3.c \ -keccak.c keccak_permute_32.h keccak_permute_64.h keccak-armv7-neon.S \ -stribog.c \ -tiger.c \ -whirlpool.c whirlpool-sse2-amd64.S \ -twofish.c twofish-amd64.S twofish-arm.S twofish-aarch64.S \ - twofish-avx2-amd64.S \ -rfc2268.c \ -camellia.c camellia.h camellia-glue.c camellia-aesni-avx-amd64.S \ - camellia-aesni-avx2-amd64.S camellia-arm.S camellia-aarch64.S \ -blake2.c \ - blake2b-amd64-avx2.S blake2s-amd64-avx.S + asm-common-amd64.h \ + asm-common-aarch64.h \ + arcfour.c arcfour-amd64.S \ + blowfish.c blowfish-amd64.S blowfish-arm.S \ + cast5.c cast5-amd64.S cast5-arm.S \ + chacha20.c chacha20-amd64-ssse3.S chacha20-amd64-avx2.S \ + chacha20-armv7-neon.S chacha20-aarch64.S \ + crc.c crc-intel-pclmul.c \ + des.c des-amd64.S \ + dsa.c \ + elgamal.c \ + ecc.c ecc-curves.c ecc-misc.c ecc-common.h \ + ecc-ecdsa.c ecc-eddsa.c ecc-gost.c \ + idea.c \ + gost28147.c gost.h \ + gostr3411-94.c \ + md4.c \ + md5.c \ + rijndael.c rijndael-internal.h rijndael-tables.h \ + rijndael-aesni.c rijndael-padlock.c \ + rijndael-amd64.S rijndael-arm.S \ + rijndael-ssse3-amd64.c rijndael-ssse3-amd64-asm.S \ + rijndael-armv8-ce.c rijndael-armv8-aarch32-ce.S \ + rijndael-armv8-aarch64-ce.S rijndael-aarch64.S \ + rmd160.c \ + rsa.c \ + salsa20.c salsa20-amd64.S salsa20-armv7-neon.S \ + scrypt.c \ + seed.c \ + serpent.c serpent-sse2-amd64.S \ + serpent-avx2-amd64.S serpent-armv7-neon.S \ + sha1.c sha1-ssse3-amd64.S sha1-avx-amd64.S sha1-avx-bmi2-amd64.S \ + sha1-armv7-neon.S sha1-armv8-aarch32-ce.S sha1-armv8-aarch64-ce.S \ + sha1-intel-shaext.c \ + sha256.c sha256-ssse3-amd64.S sha256-avx-amd64.S \ + sha256-avx2-bmi2-amd64.S \ + sha256-armv8-aarch32-ce.S sha256-armv8-aarch64-ce.S \ + sha256-intel-shaext.c \ + sha512.c sha512-ssse3-amd64.S sha512-avx-amd64.S \ + sha512-avx2-bmi2-amd64.S \ + sha512-armv7-neon.S sha512-arm.S \ + sm3.c \ + keccak.c keccak_permute_32.h keccak_permute_64.h keccak-armv7-neon.S \ + stribog.c \ + tiger.c \ + whirlpool.c whirlpool-sse2-amd64.S \ + twofish.c twofish-amd64.S twofish-arm.S twofish-aarch64.S \ + twofish-avx2-amd64.S \ + rfc2268.c \ + camellia.c camellia.h camellia-glue.c camellia-aesni-avx-amd64.S \ + camellia-aesni-avx2-amd64.S camellia-arm.S camellia-aarch64.S \ + blake2.c \ + blake2b-amd64-avx2.S blake2s-amd64-avx.S gost28147.lo: gost-sb.h gost-sb.h: gost-s-box ----------------------------------------------------------------------- Summary of changes: Makefile.am | 60 +++++++++++++++++++++- cipher/Makefile.am | 148 +++++++++++++++++++++++++++++------------------------ 2 files changed, 139 insertions(+), 69 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Thu Oct 25 03:14:33 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Thu, 25 Oct 2018 03:14:33 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-103-gb376dc2 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via b376dc2abbb208b10bbc76998ff39adb2f301905 (commit) from 03bb25ee7ed6f1076bf788ab981ca68672880daa (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit b376dc2abbb208b10bbc76998ff39adb2f301905 Author: NIIBE Yutaka Date: Thu Oct 25 10:11:59 2018 +0900 build: Require libgpg-error >= 1.33. * configure.ac (NEED_GPG_ERROR_VERSION): Require 1.33. * m4/gpg-error.m4: Update from libgpg-error 1.33. * src/libgcrypt.m4: Bump version date. Use --variable option. Signed-off-by: NIIBE Yutaka diff --git a/configure.ac b/configure.ac index cdce339..5cb4b37 100644 --- a/configure.ac +++ b/configure.ac @@ -72,7 +72,7 @@ LIBGCRYPT_CONFIG_API_VERSION=1 # If you change the required gpg-error version, please remove # unnecessary error code defines in src/gcrypt-int.h. -NEED_GPG_ERROR_VERSION=1.25 +NEED_GPG_ERROR_VERSION=1.33 AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([src/libgcrypt.vers]) diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index 9f26fa4..0f46cd6 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -1,5 +1,5 @@ # gpg-error.m4 - autoconf macro to detect libgpg-error. -# Copyright (C) 2002, 2003, 2004, 2011, 2014 g10 Code GmbH +# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2014-10-02 +# Last-changed: 2018-10-25 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, @@ -61,7 +61,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR], fi AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) - min_gpg_error_version=ifelse([$1], ,0.0,$1) + min_gpg_error_version=ifelse([$1], ,1.33,$1) AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) ok=no if test "$GPG_ERROR_CONFIG" != "no" \ @@ -70,7 +70,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpg_error_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --version` + gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG --version` major=`echo $gpg_error_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $gpg_error_config_version | \ @@ -86,15 +86,15 @@ AC_DEFUN([AM_PATH_GPG_ERROR], fi fi if test $ok = yes; then - GPG_ERROR_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --cflags` - GPG_ERROR_LIBS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --libs` - GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --variable=mtcflags 2>/dev/null` + GPG_ERROR_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --cflags` + GPG_ERROR_LIBS=`CC=$CC $GPG_ERROR_CONFIG --libs` + GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null` GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS" - GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --variable=mtlibs 2>/dev/null` + GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null` GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS" AC_MSG_RESULT([yes ($gpg_error_config_version)]) ifelse([$2], , :, [$2]) - gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --variable=host 2>/dev/null || echo none` + gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none` if test x"$gpg_error_config_host" != xnone ; then if test x"$gpg_error_config_host" != x"$host" ; then AC_MSG_WARN([[ diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4 index df6469d..e1a158e 100644 --- a/src/libgcrypt.m4 +++ b/src/libgcrypt.m4 @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-10-24 +# Last-changed: 2018-10-25 dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, @@ -105,7 +105,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then - tmp=`CC=$CC $LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` + tmp=`CC=$CC $LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0` if test "$tmp" -gt 0 ; then AC_MSG_CHECKING([LIBGCRYPT API version]) if test "$req_libgcrypt_api" -eq "$tmp" ; then @@ -121,7 +121,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], LIBGCRYPT_CFLAGS=`CC=$CC $LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`CC=$CC $LIBGCRYPT_CONFIG --libs` ifelse([$2], , :, [$2]) - libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` + libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none` if test x"$libgcrypt_config_host" != xnone ; then if test x"$libgcrypt_config_host" != x"$host" ; then AC_MSG_WARN([[ ----------------------------------------------------------------------- Summary of changes: configure.ac | 2 +- m4/gpg-error.m4 | 18 +++++++++--------- src/libgcrypt.m4 | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Thu Oct 25 13:05:08 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Thu, 25 Oct 2018 13:05:08 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-104-g3b27107 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 3b271079d52978e5507ef71476f169332d4fd2e5 (commit) from b376dc2abbb208b10bbc76998ff39adb2f301905 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3b271079d52978e5507ef71476f169332d4fd2e5 Author: Werner Koch Date: Thu Oct 25 13:04:21 2018 +0200 cipher: Add comments about future OIDs. -- diff --git a/cipher/ecc-curves.c b/cipher/ecc-curves.c index 75d7161..971afbe 100644 --- a/cipher/ecc-curves.c +++ b/cipher/ecc-curves.c @@ -41,8 +41,22 @@ static const struct const char *other; /* Other name. */ } curve_aliases[] = { - { "Curve25519", "1.3.6.1.4.1.3029.1.5.1" }, - { "Ed25519", "1.3.6.1.4.1.11591.15.1" }, + { "Curve25519", "1.3.6.1.4.1.3029.1.5.1" }, /* OpenPGP */ + + { "Ed25519", "1.3.6.1.4.1.11591.15.1" }, /* OpenPGP */ + +#if 0 + /* FIXME: We have a naming issue here. RFC-8032 says that its + * Ed25519 is the pureEdDSA, that is w.o. the SHA512 prehasing we + * use in OpenPGP. */ + { "Ed25519", "1.3.101.112" }, /* rfc8410 */ + + { "Ed448", "1.3.101.113" }, /* rfc8410 */ + + { "X22519", "1.3.101.110" }, /* rfc8410 */ + + { "X448", "1.3.101.111" }, /* rfc8410 */ +#endif { "NIST P-192", "1.2.840.10045.3.1.1" }, /* X9.62 OID */ { "NIST P-192", "prime192v1" }, /* X9.62 name. */ ----------------------------------------------------------------------- Summary of changes: cipher/ecc-curves.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Fri Oct 26 02:12:19 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Fri, 26 Oct 2018 02:12:19 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-105-g8e5641e Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 8e5641ed65f86783542d5caccdeeee42eeb9457c (commit) from 3b271079d52978e5507ef71476f169332d4fd2e5 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 8e5641ed65f86783542d5caccdeeee42eeb9457c Author: NIIBE Yutaka Date: Fri Oct 26 09:09:51 2018 +0900 build: Relax build requirements. * m4/gpg-error.m4: Update from libgpg-error 1.33. * src/libgcrypt.m4: Don't require AM_PATH_GPG_ERROR. Use GPGRT_CONFIG instead of libgcrypt-config when it is confirmed that it is available and working well. * configure.ac (AM_PATH_GPG_ERROR): No requirement for newer version (It was because of new gpgrt-config which supports *.pc files). Signed-off-by: NIIBE Yutaka diff --git a/configure.ac b/configure.ac index 5cb4b37..cdce339 100644 --- a/configure.ac +++ b/configure.ac @@ -72,7 +72,7 @@ LIBGCRYPT_CONFIG_API_VERSION=1 # If you change the required gpg-error version, please remove # unnecessary error code defines in src/gcrypt-int.h. -NEED_GPG_ERROR_VERSION=1.33 +NEED_GPG_ERROR_VERSION=1.25 AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([src/libgcrypt.vers]) diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index 0f46cd6..f89a4ee 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -62,15 +62,21 @@ AC_DEFUN([AM_PATH_GPG_ERROR], AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) min_gpg_error_version=ifelse([$1], ,1.33,$1) - AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) ok=no - if test "$GPG_ERROR_CONFIG" != "no" \ - && test -f "$GPG_ERROR_CONFIG" ; then + if test "$GPG_ERROR_CONFIG" = "no"; then + AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) + if CC=$CC $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then + GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG --modversion` + fi + else + gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG --version` + fi + if test "$GPG_ERROR_CONFIG" != "no"; then req_major=`echo $min_gpg_error_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` req_minor=`echo $min_gpg_error_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG --version` major=`echo $gpg_error_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $gpg_error_config_version | \ @@ -84,7 +90,14 @@ AC_DEFUN([AM_PATH_GPG_ERROR], fi fi fi + if test -z "$GPGRT_CONFIG"; then + if test "$major" -gt 1 -o "$major" -eq 1 -a "$minor" -ge 33; then + AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) + GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + fi + fi fi + AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) if test $ok = yes; then GPG_ERROR_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --cflags` GPG_ERROR_LIBS=`CC=$CC $GPG_ERROR_CONFIG --libs` diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4 index e1a158e..ccbc377 100644 --- a/src/libgcrypt.m4 +++ b/src/libgcrypt.m4 @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-10-25 +# Last-changed: 2018-10-26 dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, @@ -29,7 +29,6 @@ dnl is added to the gpg_config_script_warn variable. dnl AC_DEFUN([AM_PATH_LIBGCRYPT], [ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AM_PATH_GPG_ERROR]) AC_ARG_WITH(libgcrypt-prefix, AC_HELP_STRING([--with-libgcrypt-prefix=PFX], [prefix where LIBGCRYPT is installed (optional)]), @@ -45,16 +44,26 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], fi ;; '') - LIBGCRYPT_CONFIG="$GPG_ERROR_CONFIG libgcrypt" ;; *) - LIBGCRYPT_CONFIG="$GPG_ERROR_CONFIG libgcrypt" AC_MSG_WARN([Ignoring \$SYSROOT as it is not an absolute path.]) ;; esac fi fi + if test x"${LIBGCRYPT_CONFIG}" = x ; then + if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then + if CC=$CC $GPGRT_CONFIG libgcrypt >/dev/null 2>&1; then + LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt" + libgcrypt_config_by_gpgrt=yes + fi + fi + fi + if test -z "$libgcrypt_config_by_gpgrt"; then + AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) + fi + tmp=ifelse([$1], ,1:1.2.0,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_libgcrypt_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` ----------------------------------------------------------------------- Summary of changes: configure.ac | 2 +- m4/gpg-error.m4 | 21 +++++++++++++++++---- src/libgcrypt.m4 | 17 +++++++++++++---- 3 files changed, 31 insertions(+), 9 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Fri Oct 26 02:40:18 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Fri, 26 Oct 2018 02:40:18 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-106-g630ece1 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 630ece1b7e0a94442bca91d8e96d9b1d4cd3ec66 (commit) from 8e5641ed65f86783542d5caccdeeee42eeb9457c (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 630ece1b7e0a94442bca91d8e96d9b1d4cd3ec66 Author: NIIBE Yutaka Date: Fri Oct 26 09:38:47 2018 +0900 build: Fix libgcrypt.m4. * src/libgcrypt.m4: Use AC_PATH_PROG to detect libgcrypt-config. -- Last commit using AC_PATH_TOOL was wrong. Signed-off-by: NIIBE Yutaka diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4 index ccbc377..e674293 100644 --- a/src/libgcrypt.m4 +++ b/src/libgcrypt.m4 @@ -52,16 +52,15 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], fi fi - if test x"${LIBGCRYPT_CONFIG}" = x ; then - if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then - if CC=$CC $GPGRT_CONFIG libgcrypt >/dev/null 2>&1; then - LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt" - libgcrypt_config_by_gpgrt=yes - fi + use_gpgrt_config="" + if test x"${LIBGCRYPT_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then + if CC=$CC $GPGRT_CONFIG libgcrypt >/dev/null 2>&1; then + LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt" + use_gpgrt_config=yes fi fi - if test -z "$libgcrypt_config_by_gpgrt"; then - AC_PATH_TOOL(LIBGCRYPT_CONFIG, libgcrypt-config, no) + if test -z "$use_gpgrt_config"; then + AC_PATH_PROG(LIBGCRYPT_CONFIG, libgcrypt-config, no) fi tmp=ifelse([$1], ,1:1.2.0,$1) ----------------------------------------------------------------------- Summary of changes: src/libgcrypt.m4 | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Fri Oct 26 03:36:59 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Fri, 26 Oct 2018 03:36:59 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-107-ga755bd0 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via a755bd0ea09af2ae5a66e3f5aeb8707673c687cf (commit) from 630ece1b7e0a94442bca91d8e96d9b1d4cd3ec66 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit a755bd0ea09af2ae5a66e3f5aeb8707673c687cf Author: NIIBE Yutaka Date: Fri Oct 26 10:35:51 2018 +0900 libgcrypt.m4: Better compatibility support. * src/gpg-error.m4: Update. * src/libgcrypt.m4: Don't assume libgcrypt-config is newer. Signed-off-by: NIIBE Yutaka diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index f89a4ee..70dc501 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-10-25 +# Last-changed: 2018-10-26 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, @@ -63,10 +63,13 @@ AC_DEFUN([AM_PATH_GPG_ERROR], AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) min_gpg_error_version=ifelse([$1], ,1.33,$1) ok=no + + use_gpgrt_config="" if test "$GPG_ERROR_CONFIG" = "no"; then AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) if CC=$CC $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + use_gpgrt_config=yes gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG --modversion` fi else @@ -94,6 +97,7 @@ AC_DEFUN([AM_PATH_GPG_ERROR], if test "$major" -gt 1 -o "$major" -eq 1 -a "$minor" -ge 33; then AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + use_gpgrt_config=yes fi fi fi @@ -101,18 +105,27 @@ AC_DEFUN([AM_PATH_GPG_ERROR], if test $ok = yes; then GPG_ERROR_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --cflags` GPG_ERROR_LIBS=`CC=$CC $GPG_ERROR_CONFIG --libs` - GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null` - GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS" - GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null` - GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS" + if test -z "$use_gpgrt_config"; then + GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null` + GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null` + else + GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null` + GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS" + GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null` + GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS" + fi AC_MSG_RESULT([yes ($gpg_error_config_version)]) ifelse([$2], , :, [$2]) - gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none` + if test -z "$use_gpgrt_config"; then + gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG --host 2>/dev/null || echo none` + else + gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none` + fi if test x"$gpg_error_config_host" != xnone ; then if test x"$gpg_error_config_host" != x"$host" ; then AC_MSG_WARN([[ *** -*** The config script $GPG_ERROR_CONFIG was +*** The config script "$GPG_ERROR_CONFIG" was *** built for $gpg_error_config_host and thus may not match the *** used host $host. *** You may want to use the configure option --with-libgpg-error-prefix diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4 index e674293..5c3f6e1 100644 --- a/src/libgcrypt.m4 +++ b/src/libgcrypt.m4 @@ -81,7 +81,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` req_micro=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - libgcrypt_config_version=`CC=$CC $LIBGCRYPT_CONFIG --modversion` + if test -z "$use_gpgrt_config"; then + libgcrypt_config_version=`CC=$CC $LIBGCRYPT_CONFIG --version` + else + libgcrypt_config_version=`CC=$CC $LIBGCRYPT_CONFIG --modversion` + fi major=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $libgcrypt_config_version | \ @@ -113,7 +117,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], # If we have a recent libgcrypt, we should also check that the # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then - tmp=`CC=$CC $LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0` + if test -z "$use_gpgrt_config"; then + tmp=`CC=$CC $LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` + else + tmp=`CC=$CC $LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0` + fi if test "$tmp" -gt 0 ; then AC_MSG_CHECKING([LIBGCRYPT API version]) if test "$req_libgcrypt_api" -eq "$tmp" ; then @@ -129,7 +137,11 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], LIBGCRYPT_CFLAGS=`CC=$CC $LIBGCRYPT_CONFIG --cflags` LIBGCRYPT_LIBS=`CC=$CC $LIBGCRYPT_CONFIG --libs` ifelse([$2], , :, [$2]) - libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none` + if test -z "$use_gpgrt_config"; then + libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` + else + libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none` + fi if test x"$libgcrypt_config_host" != xnone ; then if test x"$libgcrypt_config_host" != x"$host" ; then AC_MSG_WARN([[ ----------------------------------------------------------------------- Summary of changes: m4/gpg-error.m4 | 27 ++++++++++++++++++++------- src/libgcrypt.m4 | 18 +++++++++++++++--- 2 files changed, 35 insertions(+), 10 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From gniibe at fsij.org Fri Oct 26 06:02:58 2018 From: gniibe at fsij.org (NIIBE Yutaka) Date: Fri, 26 Oct 2018 13:02:58 +0900 Subject: Bug in fips_is_operational in libgcrypt master Message-ID: <87o9bhl5hp.fsf@iwagami.gniibe.org> Hello, I encounterd failures when I build gnupg master with new libgcrypt master. All failures are same cause: gcry_md_open fails. Example is: the test program gnupg/common/t-ssh-utils.c fails, when the function get_fingerprint in gnupg/common/ssh-utils.c calls gcry_md_open. I located this commit has a problem: Add fast path for _gcry_fips_is_operational commit: b6e6ace324440f564df664e27f8276ef01f76795 It seems for me that _gcry_global_is_operational should be used (for the case global_init is not called yet). -- From jussi.kivilinna at iki.fi Fri Oct 26 07:14:46 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Fri, 26 Oct 2018 08:14:46 +0300 Subject: Bug in fips_is_operational in libgcrypt master In-Reply-To: <87o9bhl5hp.fsf@iwagami.gniibe.org> References: <87o9bhl5hp.fsf@iwagami.gniibe.org> Message-ID: <8ec39c82-b53d-7dcc-35bc-acad2664ed5f@iki.fi> Hello, On 26.10.2018 7.02, NIIBE Yutaka wrote: > Hello, > > I encounterd failures when I build gnupg master with new libgcrypt master. > > All failures are same cause: gcry_md_open fails. > Example is: the test program gnupg/common/t-ssh-utils.c fails, > when the function get_fingerprint in gnupg/common/ssh-utils.c > calls gcry_md_open. > > I located this commit has a problem: > > Add fast path for _gcry_fips_is_operational > commit: b6e6ace324440f564df664e27f8276ef01f76795 > > It seems for me that _gcry_global_is_operational should be > used (for the case global_init is not called yet). > Oh, yes. I did not read old code carefully enough. It was: int _gcry_fips_is_operational (void); #define fips_is_operational() (_gcry_global_is_operational ()) I missed that macro uses _gcry_global_is_operational, not _gcry_fips_is_operational. Looks like fast-path is not possible with _gcry_global_is_operational, so problematic commit should be reverted. I'll patch this on weekend. -Jussi From cvs at cvs.gnupg.org Fri Oct 26 13:23:47 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 26 Oct 2018 13:23:47 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-109-g319f55e Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 319f55e6e5793c59f1ba4cfe481b562bca42194d (commit) via 2e2e68ad4874a4678cfbe452b70ae987e0402eca (commit) from a755bd0ea09af2ae5a66e3f5aeb8707673c687cf (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 319f55e6e5793c59f1ba4cfe481b562bca42194d Author: Werner Koch Date: Fri Oct 26 13:22:16 2018 +0200 random: Make sure to re-open /dev/random after a fork * random/rndlinux.c (_gcry_rndlinux_gather_random): Detect fork and re-open devices. -- This mitigates about ill-behaving software which has closed the standard fds but later dups them to /dev/null. GnuPG-bug-id: 3491 Signed-off-by: Werner Koch diff --git a/random/rndlinux.c b/random/rndlinux.c index 1bb7c76..f70bc21 100644 --- a/random/rndlinux.c +++ b/random/rndlinux.c @@ -104,9 +104,10 @@ open_device (const char *name, int retry) /* Note that the caller needs to make sure that this function is only - called by one thread at a time. The function returns 0 on success - or true on failure (in which case the caller will signal a fatal - error). */ + * called by one thread at a time. The function returns 0 on success + * or true on failure (in which case the caller will signal a fatal + * error). This function should be entered only by one thread at a + * time. */ int _gcry_rndlinux_gather_random (void (*add)(const void*, size_t, enum random_origins), @@ -117,6 +118,11 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t, static int fd_random = -1; static int only_urandom = -1; static unsigned char ever_opened; + static volatile pid_t my_pid; /* The volatile is there to make sure + * the compiler does not optimize the + * code away in case the getpid + * function is badly attributed. */ + volatile pid_t apid; int fd; int n; byte buffer[768]; @@ -130,13 +136,13 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t, * use only urandom. */ if (only_urandom == -1) { + my_pid = getpid (); if ((_gcry_random_read_conf () & RANDOM_CONF_ONLY_URANDOM)) only_urandom = 1; else only_urandom = 0; } - if (!add) { /* Special mode to close the descriptors. */ @@ -153,6 +159,25 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t, return 0; } + /* Detect a fork and close the devices so that we don't use the old + * file descriptors. Note that open_device will be called in retry + * mode if the devices was opened by the parent process. */ + apid = getpid (); + if (my_pid != apid) + { + if (fd_random != -1) + { + close (fd_random); + fd_random = -1; + } + if (fd_urandom != -1) + { + close (fd_urandom); + fd_urandom = -1; + } + my_pid = apid; + } + /* First read from a hardware source. However let it account only for up to 50% (or 25% for RDRAND) of the requested bytes. */ commit 2e2e68ad4874a4678cfbe452b70ae987e0402eca Author: Werner Koch Date: Fri Oct 26 12:57:30 2018 +0200 primes: Avoid leaking bits of the prime test to pageable memory. * cipher/primegen.c (gen_prime): Allocate MODS in secure memory. -- This increases the pressure on the secure memory by about 1400 byte but given that we can meanwhile increase the size of the secmem area, this is acceptable. GnuPG-bug-id: 3848 Signed-off-by: Werner Koch diff --git a/cipher/primegen.c b/cipher/primegen.c index ce5ad3c..e24de4d 100644 --- a/cipher/primegen.c +++ b/cipher/primegen.c @@ -758,7 +758,8 @@ gen_prime (unsigned int nbits, int secret, int randomlevel, if (nbits < 16) log_fatal ("can't generate a prime with less than %d bits\n", 16); - mods = xmalloc (no_of_small_prime_numbers * sizeof *mods); + mods = (secret? xmalloc_secure (no_of_small_prime_numbers * sizeof *mods) + /* */ : xmalloc (no_of_small_prime_numbers * sizeof *mods)); /* Make nbits fit into gcry_mpi_t implementation. */ val_2 = mpi_alloc_set_ui( 2 ); val_3 = mpi_alloc_set_ui( 3); ----------------------------------------------------------------------- Summary of changes: cipher/primegen.c | 3 ++- random/rndlinux.c | 33 +++++++++++++++++++++++++++++---- 2 files changed, 31 insertions(+), 5 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Fri Oct 26 13:49:57 2018 From: cvs at cvs.gnupg.org (by Daniel Kahn Gillmor) Date: Fri, 26 Oct 2018 13:49:57 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-110-g7e66268 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 7e662680c170968661ee0105d132813f8281d229 (commit) from 319f55e6e5793c59f1ba4cfe481b562bca42194d (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7e662680c170968661ee0105d132813f8281d229 Author: Daniel Kahn Gillmor Date: Wed Sep 5 10:34:04 2018 -0400 random: use getrandom() on Linux where available * random/rndlinux.c (_gcry_rndlinux_gather_random): use the getrandom() syscall on Linux if it exists, regardless of what kind of entropy was requested. -- This change avoids the serious usability problem of unnecessary blocking on /dev/random when the kernel's PRNG is already seeded, without introducing the risk of pulling from an uninitialized PRNG. It only has an effect on Linux systems with a functioning getrandom() syscall. If that syscall is unavailable or fails, it should fall through to the pre-existing behavior. GnuPG-bug-id: 3894 Signed-off-by: Daniel Kahn Gillmor diff --git a/random/rndlinux.c b/random/rndlinux.c index f70bc21..fefc3c3 100644 --- a/random/rndlinux.c +++ b/random/rndlinux.c @@ -245,17 +245,16 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t, struct timeval tv; int rc; - /* If we have a modern Linux kernel and we want to read from the - * the non-blocking /dev/urandom, we first try to use the new + /* If we have a modern Linux kernel, we first try to use the new * getrandom syscall. That call guarantees that the kernel's * RNG has been properly seeded before returning any data. This * is different from /dev/urandom which may, due to its * non-blocking semantics, return data even if the kernel has - * not been properly seeded. Unfortunately we need to use a + * not been properly seeded. And it differs from /dev/random by never + * blocking once the kernel is seeded. Unfortunately we need to use a * syscall and not a new device and thus we are not able to use * select(2) to have a timeout. */ #if defined(__linux__) && defined(HAVE_SYSCALL) && defined(__NR_getrandom) - if (fd == fd_urandom) { long ret; size_t nbytes; @@ -272,7 +271,7 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t, } while (ret == -1 && errno == EINTR); if (ret == -1 && errno == ENOSYS) - ; /* The syscall is not supported - fallback to /dev/urandom. */ + ; /* The syscall is not supported - fallback to pulling from fd. */ else { /* The syscall is supported. Some sanity checks. */ if (ret == -1) ----------------------------------------------------------------------- Summary of changes: random/rndlinux.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Fri Oct 26 20:05:00 2018 From: cvs at cvs.gnupg.org (by Werner Koch) Date: Fri, 26 Oct 2018 20:05:00 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-111-gf1fe145 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via f1fe145a2958ba7a51113d35a83cfc676a920a86 (commit) from 7e662680c170968661ee0105d132813f8281d229 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit f1fe145a2958ba7a51113d35a83cfc676a920a86 Author: Werner Koch Date: Fri Oct 26 20:04:44 2018 +0200 Merge release info from 1.8.4 -- diff --git a/Makefile.am b/Makefile.am index 24c362a..7fa4fa4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ # internal archive and before uploading this to the public server, # manual tests should be run and the git release tagged and pushed. # Adjust as needed. -RELEASE_ARCHIVE_DIR = wk at vigenere:tarballs/libgpg-error/ +RELEASE_ARCHIVE_DIR = wk at vigenere:tarballs/libgcrypt/v1.9 # The key used to sign the released sources. Adjust as needed. RELEASE_SIGNING_KEY = D8692123C4065DEA5E0F3AB5249B39D24F25E3B6 diff --git a/NEWS b/NEWS index a4841b3..aa58fda 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,20 @@ Noteworthy changes in version 1.9.0 (unreleased) [C22/A3/R0] * Bug fixes + - Fix infinite loop due to applications using fork the wrong + way. [#3491][also in 1.8.4] + + - Fix possible leak of a few bits of secret primes to pageable + memory. [#3848][also in 1.8.4] + + - Fix possible hang in the RNG (1.8.3 only). [#4034][also in 1.8.4] + + - Several minor fixes. [#4102,#4208,#4209,#4210,#4211,#4212] + [also in 1.8.4] + + - On Linux always make use of getrandom if possible and then use + its /dev/urandom behaviour. [#3894][also in 1.8.4] + - Use blinding for ECDSA signing to mitigate a novel side-channel attack. [#4011,CVE-2018-0495] [also in 1.8.3, 1.7.10] @@ -36,6 +50,7 @@ Noteworthy changes in version 1.9.0 (unreleased) [C22/A3/R0] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Version 1.8.2 (2017-12-13) Version 1.8.3 (2018-06-13) + Version 1.8.4 (2018-10-26) Noteworthy changes in version 1.8.1 (2017-08-27) [C22/A2/R1] diff --git a/README b/README index 7ac8e4a..92f2f1b 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ Libgcrypt - The GNU Crypto Library ------------------------------------ - Version 1.8 + Version 1.9 Copyright (C) 1989,1991-2018 Free Software Foundation, Inc. Copyright (C) 2012-2018 g10 Code GmbH @@ -193,6 +193,9 @@ Build Problems -------------- + If you have a problem with a a certain release, please first check + the Release-info URL given in the NEWS file. + We can't check all assembler files, so if you have problems assembling them (or the program crashes) use --disable-asm with ./configure. If you opt to delete individual replacement files in ----------------------------------------------------------------------- Summary of changes: Makefile.am | 2 +- NEWS | 15 +++++++++++++++ README | 5 ++++- 3 files changed, 20 insertions(+), 2 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From cvs at cvs.gnupg.org Sat Oct 27 15:16:29 2018 From: cvs at cvs.gnupg.org (by Jussi Kivilinna) Date: Sat, 27 Oct 2018 15:16:29 +0200 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-112-g6e669e0 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 6e669e09603e5a98b59dcf35f77f346db6c81eac (commit) from f1fe145a2958ba7a51113d35a83cfc676a920a86 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6e669e09603e5a98b59dcf35f77f346db6c81eac Author: Jussi Kivilinna Date: Sat Oct 27 15:48:29 2018 +0300 Fix missing global initialization in fips_is_operational * src/g10lib.h (_gcry_global_any_init_done): New extern. (fips_is_operational): Check for _gcry_global_any_init_done and call _gcry_global_is_operational. * src/global.c (any_init_done): Rename to ... (_gcry_global_any_init_done): ... this and make externally available. -- Commit b6e6ace324440f564df664e27f8276ef01f76795 "Add fast path for _gcry_fips_is_operational" inadvertently replaced function call to _gcry_global_is_operational with call to _gcry_fips_is_operational in fips_is_operational macro. This can cause libgcrypt to miss initialization. This patch restores _gcry_global_is_operational functionality to fips_is_operational macro while keeping fast-path to reduce call-overhead to gcry_* functions. Signed-off-by: Jussi Kivilinna diff --git a/src/g10lib.h b/src/g10lib.h index d52eef3..c1f84ee 100644 --- a/src/g10lib.h +++ b/src/g10lib.h @@ -102,6 +102,7 @@ /*-- src/global.c -*/ +extern int _gcry_global_any_init_done; int _gcry_global_is_operational (void); gcry_err_code_t _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr); void _gcry_check_heap (const void *a); @@ -466,7 +467,9 @@ int _gcry_fips_is_operational (void); /* Return true if the library is in the operational state. */ #define fips_is_operational() \ - (!fips_mode () || _gcry_fips_is_operational ()) + (!_gcry_global_any_init_done ? \ + _gcry_global_is_operational() : \ + (!fips_mode () || _gcry_global_is_operational ())) #define fips_not_operational() (GPG_ERR_NOT_OPERATIONAL) diff --git a/src/global.c b/src/global.c index 6c2486c..d82c680 100644 --- a/src/global.c +++ b/src/global.c @@ -54,7 +54,7 @@ static unsigned int debug_flags; static int force_fips_mode; /* Controlled by global_init(). */ -static int any_init_done; +int _gcry_global_any_init_done; /* * Functions called before and after blocking syscalls. @@ -91,9 +91,9 @@ global_init (void) { gcry_error_t err = 0; - if (any_init_done) + if (_gcry_global_any_init_done) return; - any_init_done = 1; + _gcry_global_any_init_done = 1; /* Tell the random module that we have seen an init call. */ _gcry_set_preferred_rng_type (0); @@ -161,7 +161,7 @@ global_init (void) int _gcry_global_is_operational (void) { - if (!any_init_done) + if (!_gcry_global_any_init_done) { #ifdef HAVE_SYSLOG syslog (LOG_USER|LOG_WARNING, "Libgcrypt warning: " @@ -570,7 +570,7 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr) break; case GCRYCTL_ANY_INITIALIZATION_P: - if (any_init_done) + if (_gcry_global_any_init_done) rc = GPG_ERR_GENERAL; break; @@ -682,7 +682,7 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr) selftest is triggered. It is not possible to put the libraty into fips mode after having passed the initialization. */ _gcry_set_preferred_rng_type (0); - if (!any_init_done) + if (!_gcry_global_any_init_done) { /* Not yet initialized at all. Set a flag so that we are put into fips mode during initialization. */ @@ -749,7 +749,7 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr) break; case GCRYCTL_SET_ENFORCED_FIPS_FLAG: - if (!any_init_done) + if (!_gcry_global_any_init_done) { /* Not yet initialized at all. Set the enforced fips mode flag */ _gcry_set_preferred_rng_type (0); @@ -773,7 +773,7 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr) { int *ip = va_arg (arg_ptr, int*); if (ip) - *ip = _gcry_get_rng_type (!any_init_done); + *ip = _gcry_get_rng_type (!_gcry_global_any_init_done); } break; @@ -801,7 +801,8 @@ _gcry_vcontrol (enum gcry_ctl_cmds cmd, va_list arg_ptr) int npers = va_arg (arg_ptr, int); if (va_arg (arg_ptr, void *) || npers < 0) rc = GPG_ERR_INV_ARG; - else if (_gcry_get_rng_type (!any_init_done) != GCRY_RNG_TYPE_FIPS) + else if (_gcry_get_rng_type (!_gcry_global_any_init_done) + != GCRY_RNG_TYPE_FIPS) rc = GPG_ERR_NOT_SUPPORTED; else rc = _gcry_rngdrbg_reinit (flagstr, pers, npers); ----------------------------------------------------------------------- Summary of changes: src/g10lib.h | 5 ++++- src/global.c | 19 ++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From jussi.kivilinna at iki.fi Sat Oct 27 17:41:57 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Sat, 27 Oct 2018 18:41:57 +0300 Subject: [PATCH 1/3] Change remaining users of _gcry_fips_mode to use fips_mode Message-ID: <154065491741.14250.10262018668761581153.stgit@localhost.localdomain> * src/fips.c (_gcry_fips_mode): Remove. (_gcry_enforced_fips_mode, _gcry_inactivate_fips_mode) (_gcry_is_fips_mode_inactive): Use fips_mode. * src/g10lib.h (_gcry_fips_mode): Remove. -- Signed-off-by: Jussi Kivilinna --- 0 files changed diff --git a/src/fips.c b/src/fips.c index 2b3a0af4b..36358bfa5 100644 --- a/src/fips.c +++ b/src/fips.c @@ -255,25 +255,11 @@ unlock_fsm (void) } -/* This function returns true if fips mode is enabled. This is - independent of the fips required finite state machine and only used - to enable fips specific code. Please use the fips_mode macro - instead of calling this function directly. */ -int -_gcry_fips_mode (void) -{ - /* No locking is required because we have the requirement that this - variable is only initialized once with no other threads - existing. */ - return !_gcry_no_fips_mode_required; -} - - /* Return a flag telling whether we are in the enforced fips mode. */ int _gcry_enforced_fips_mode (void) { - if (!_gcry_fips_mode ()) + if (!fips_mode ()) return 0; return enforced_fips_mode; } @@ -292,7 +278,7 @@ _gcry_set_enforced_fips_mode (void) void _gcry_inactivate_fips_mode (const char *text) { - gcry_assert (_gcry_fips_mode ()); + gcry_assert (fips_mode ()); if (_gcry_enforced_fips_mode () ) { @@ -323,7 +309,7 @@ _gcry_is_fips_mode_inactive (void) { int flag; - if (!_gcry_fips_mode ()) + if (!fips_mode ()) return 0; lock_fsm (); flag = inactive_fips_mode; diff --git a/src/g10lib.h b/src/g10lib.h index c1f84ee3b..c64cbcf2a 100644 --- a/src/g10lib.h +++ b/src/g10lib.h @@ -427,8 +427,6 @@ extern int _gcry_no_fips_mode_required; void _gcry_initialize_fips_mode (int force); -int _gcry_fips_mode (void); - /* This macro returns true if fips mode is enabled. This is independent of the fips required finite state machine and only used to enable fips specific code. From jussi.kivilinna at iki.fi Sat Oct 27 17:42:02 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Sat, 27 Oct 2018 18:42:02 +0300 Subject: [PATCH 2/3] mpi/longlong.h: enable inline assembly for powerpc64 In-Reply-To: <154065491741.14250.10262018668761581153.stgit@localhost.localdomain> References: <154065491741.14250.10262018668761581153.stgit@localhost.localdomain> Message-ID: <154065492258.14250.4023125170998389.stgit@localhost.localdomain> * mpi/longlong.h [__powerpc__ && W_TYPE_SIZE == 64]: Remove '#if 0'. -- PowerPC64 inline assembly was tested on QEMU ('make check' pass). Signed-off-by: Jussi Kivilinna --- 0 files changed diff --git a/mpi/longlong.h b/mpi/longlong.h index d6958f3b2..c0f24c859 100644 --- a/mpi/longlong.h +++ b/mpi/longlong.h @@ -1088,7 +1088,6 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); /* Powerpc 64 bit support taken from gmp-4.1.2. */ /* We should test _IBMR2 here when we add assembly support for the system vendor compilers. */ -#if 0 /* Not yet enabled because we don't have hardware for a test. */ #if (defined (_ARCH_PPC) || defined (__powerpc__)) && W_TYPE_SIZE == 64 #define add_ssaaaa(sh, sl, ah, al, bh, bl) \ do { \ @@ -1141,7 +1140,6 @@ typedef unsigned int UTItype __attribute__ ((mode (TI))); #define SMUL_TIME 14 /* ??? */ #define UDIV_TIME 120 /* ??? */ #endif /* 64-bit PowerPC. */ -#endif /* if 0 */ /*************************************** ************** PYR ****************** From jussi.kivilinna at iki.fi Sat Oct 27 17:42:07 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Sat, 27 Oct 2018 18:42:07 +0300 Subject: [PATCH 3/3] rijndael: fix unused parameter warning In-Reply-To: <154065491741.14250.10262018668761581153.stgit@localhost.localdomain> References: <154065491741.14250.10262018668761581153.stgit@localhost.localdomain> Message-ID: <154065492775.14250.13108155955202485026.stgit@localhost.localdomain> * cipher/rijndael.c (do_setkey): Silence unused 'hd' warning. -- This commit fixes "warning: unused parameter 'hd'" warning seen on architectures that do not have alternative AES implementations. Signed-off-by: Jussi Kivilinna --- 0 files changed diff --git a/cipher/rijndael.c b/cipher/rijndael.c index d126f8847..1bc8b0fc2 100644 --- a/cipher/rijndael.c +++ b/cipher/rijndael.c @@ -264,6 +264,8 @@ do_setkey (RIJNDAEL_context *ctx, const byte *key, const unsigned keylen, unsigned int hwfeatures; #endif + (void)hd; + /* The on-the-fly self tests are only run in non-fips mode. In fips mode explicit self-tests are required. Actually the on-the-fly self-tests are not fully thread-safe and it might happen that a From jussi.kivilinna at iki.fi Sat Oct 27 18:05:24 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Sat, 27 Oct 2018 19:05:24 +0300 Subject: Bug in fips_is_operational in libgcrypt master In-Reply-To: <87o9bhl5hp.fsf@iwagami.gniibe.org> References: <87o9bhl5hp.fsf@iwagami.gniibe.org> Message-ID: <239fcfd1-e71d-c586-4672-3856b126468a@iki.fi> Hello, On 26.10.2018 7.02, NIIBE Yutaka wrote: > Hello, > > I encounterd failures when I build gnupg master with new libgcrypt master. > > All failures are same cause: gcry_md_open fails. > Example is: the test program gnupg/common/t-ssh-utils.c fails, > when the function get_fingerprint in gnupg/common/ssh-utils.c > calls gcry_md_open. > > I located this commit has a problem: > > Add fast path for _gcry_fips_is_operational > commit: b6e6ace324440f564df664e27f8276ef01f76795 > > It seems for me that _gcry_global_is_operational should be > used (for the case global_init is not called yet). > I've pushed a fix to master: Fix missing global initialization in fips_is_operational commit: 6e669e09603e5a98b59dcf35f77f346db6c81eac Sorry for the inconvenience. -Jussi From jussi.kivilinna at iki.fi Sun Oct 28 00:46:47 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Sun, 28 Oct 2018 01:46:47 +0300 Subject: [PATCH] stdmem: free: only call _gcry_secmem_free if needed Message-ID: <154068040754.20357.11647983149544271039.stgit@localhost.localdomain> * src/stdmem.c (_gcry_private_free): Check if memory is secure before calling _gcry_secmem_free to avoid unnecessarily taking secmem lock. -- Unnecessarily taking secmem lock on non-secure memory can result poor performance on multi-threaded workloads: https://marc.info/?l=gcrypt-devel&m=153424107207061&w=2 Reported-by: Christian Grothoff Signed-off-by: Jussi Kivilinna --- src/stdmem.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/stdmem.c b/src/stdmem.c index cbda8d895..04ce64fba 100644 --- a/src/stdmem.c +++ b/src/stdmem.c @@ -224,19 +224,23 @@ void _gcry_private_free (void *a) { unsigned char *p = a; + unsigned char *freep; if (!p) return; - if (use_m_guard ) + if (use_m_guard) { - _gcry_private_check_heap(p); - if (! _gcry_secmem_free (p - EXTRA_ALIGN - 4)) - { - free (p - EXTRA_ALIGN - 4); - } + _gcry_private_check_heap (p); + freep = p - EXTRA_ALIGN - 4; + } + else + { + freep = p; } - else if (!_gcry_secmem_free (p)) + + if (!_gcry_private_is_secure (freep) || + !_gcry_secmem_free (freep)) { - free(p); + free (freep); } } From jussi.kivilinna at iki.fi Sun Oct 28 17:16:33 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Sun, 28 Oct 2018 18:16:33 +0200 Subject: [PATCH] Change buf_cpy and buf_xor* functions to use buf_put/buf_get helpers Message-ID: <154074339325.27516.5060101595268555008.stgit@localhost.localdomain> * cipher/bufhelp.h (BUFHELP_FAST_UNALIGNED_ACCESS) (bufhelp_int_s, buf_xor_1): Remove. (buf_cpy, buf_xor, buf_xor_2dst, buf_xor_n_copy_2): Use buf_put/buf_get helpers to handle unaligned memory accesses. -- Signed-off-by: Jussi Kivilinna --- 0 files changed diff --git a/cipher/bufhelp.h b/cipher/bufhelp.h index 4e97c4d41..0e8f5991c 100644 --- a/cipher/bufhelp.h +++ b/cipher/bufhelp.h @@ -35,277 +35,6 @@ #endif -#undef BUFHELP_FAST_UNALIGNED_ACCESS -#if defined(BUFHELP_UNALIGNED_ACCESS) && \ - (defined(__i386__) || defined(__x86_64__) || \ - (defined(__arm__) && defined(__ARM_FEATURE_UNALIGNED)) || \ - defined(__aarch64__)) -/* These architectures are able of unaligned memory accesses and can - handle those fast. - */ -# define BUFHELP_FAST_UNALIGNED_ACCESS 1 -#endif - - -#ifdef BUFHELP_FAST_UNALIGNED_ACCESS -/* Define type with one-byte alignment on architectures with fast unaligned - memory accesses. - */ -typedef struct bufhelp_int_s -{ - uintptr_t a; -} __attribute__((packed, aligned(1), may_alias)) bufhelp_int_t; -#else -/* Define type with default alignment for other architectures (unaligned - accessed handled in per byte loops). - */ -#ifdef HAVE_GCC_ATTRIBUTE_MAY_ALIAS -typedef struct bufhelp_int_s -{ - uintptr_t a; -} __attribute__((may_alias)) bufhelp_int_t; -#else -typedef struct bufhelp_int_s -{ - uintptr_t a; -} bufhelp_int_t; -#endif -#endif - - -/* Optimized function for small buffer copying */ -static inline void -buf_cpy(void *_dst, const void *_src, size_t len) -{ -#if __GNUC__ >= 4 && (defined(__x86_64__) || defined(__i386__)) - /* For AMD64 and i386, memcpy is faster. */ - memcpy(_dst, _src, len); -#else - byte *dst = _dst; - const byte *src = _src; - bufhelp_int_t *ldst; - const bufhelp_int_t *lsrc; -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS - const unsigned int longmask = sizeof(bufhelp_int_t) - 1; - - /* Skip fast processing if buffers are unaligned. */ - if (UNLIKELY(((uintptr_t)dst | (uintptr_t)src) & longmask)) - goto do_bytes; -#endif - - ldst = (bufhelp_int_t *)(void *)dst; - lsrc = (const bufhelp_int_t *)(const void *)src; - - for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) - (ldst++)->a = (lsrc++)->a; - - dst = (byte *)ldst; - src = (const byte *)lsrc; - -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS -do_bytes: -#endif - /* Handle tail. */ - for (; len; len--) - *dst++ = *src++; -#endif /*__GNUC__ >= 4 && (__x86_64__ || __i386__)*/ -} - - -/* Optimized function for buffer xoring */ -static inline void -buf_xor(void *_dst, const void *_src1, const void *_src2, size_t len) -{ - byte *dst = _dst; - const byte *src1 = _src1; - const byte *src2 = _src2; - bufhelp_int_t *ldst; - const bufhelp_int_t *lsrc1, *lsrc2; -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS - const unsigned int longmask = sizeof(bufhelp_int_t) - 1; - - /* Skip fast processing if buffers are unaligned. */ - if (UNLIKELY(((uintptr_t)dst | (uintptr_t)src1 | (uintptr_t)src2) & longmask)) - goto do_bytes; -#endif - - ldst = (bufhelp_int_t *)(void *)dst; - lsrc1 = (const bufhelp_int_t *)(const void *)src1; - lsrc2 = (const bufhelp_int_t *)(const void *)src2; - - for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) - (ldst++)->a = (lsrc1++)->a ^ (lsrc2++)->a; - - dst = (byte *)ldst; - src1 = (const byte *)lsrc1; - src2 = (const byte *)lsrc2; - -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS -do_bytes: -#endif - /* Handle tail. */ - for (; len; len--) - *dst++ = *src1++ ^ *src2++; -} - - -/* Optimized function for in-place buffer xoring. */ -static inline void -buf_xor_1(void *_dst, const void *_src, size_t len) -{ - byte *dst = _dst; - const byte *src = _src; - bufhelp_int_t *ldst; - const bufhelp_int_t *lsrc; -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS - const unsigned int longmask = sizeof(bufhelp_int_t) - 1; - - /* Skip fast processing if buffers are unaligned. */ - if (UNLIKELY(((uintptr_t)dst | (uintptr_t)src) & longmask)) - goto do_bytes; -#endif - - ldst = (bufhelp_int_t *)(void *)dst; - lsrc = (const bufhelp_int_t *)(const void *)src; - - for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) - (ldst++)->a ^= (lsrc++)->a; - - dst = (byte *)ldst; - src = (const byte *)lsrc; - -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS -do_bytes: -#endif - /* Handle tail. */ - for (; len; len--) - *dst++ ^= *src++; -} - - -/* Optimized function for buffer xoring with two destination buffers. Used - mainly by CFB mode encryption. */ -static inline void -buf_xor_2dst(void *_dst1, void *_dst2, const void *_src, size_t len) -{ - byte *dst1 = _dst1; - byte *dst2 = _dst2; - const byte *src = _src; - bufhelp_int_t *ldst1, *ldst2; - const bufhelp_int_t *lsrc; -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS - const unsigned int longmask = sizeof(bufhelp_int_t) - 1; - - /* Skip fast processing if buffers are unaligned. */ - if (UNLIKELY(((uintptr_t)src | (uintptr_t)dst1 | (uintptr_t)dst2) & longmask)) - goto do_bytes; -#endif - - ldst1 = (bufhelp_int_t *)(void *)dst1; - ldst2 = (bufhelp_int_t *)(void *)dst2; - lsrc = (const bufhelp_int_t *)(const void *)src; - - for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) - (ldst1++)->a = ((ldst2++)->a ^= (lsrc++)->a); - - dst1 = (byte *)ldst1; - dst2 = (byte *)ldst2; - src = (const byte *)lsrc; - -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS -do_bytes: -#endif - /* Handle tail. */ - for (; len; len--) - *dst1++ = (*dst2++ ^= *src++); -} - - -/* Optimized function for combined buffer xoring and copying. Used by mainly - CBC mode decryption. */ -static inline void -buf_xor_n_copy_2(void *_dst_xor, const void *_src_xor, void *_srcdst_cpy, - const void *_src_cpy, size_t len) -{ - byte *dst_xor = _dst_xor; - byte *srcdst_cpy = _srcdst_cpy; - const byte *src_xor = _src_xor; - const byte *src_cpy = _src_cpy; - byte temp; - bufhelp_int_t *ldst_xor, *lsrcdst_cpy; - const bufhelp_int_t *lsrc_cpy, *lsrc_xor; - uintptr_t ltemp; -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS - const unsigned int longmask = sizeof(bufhelp_int_t) - 1; - - /* Skip fast processing if buffers are unaligned. */ - if (UNLIKELY(((uintptr_t)src_cpy | (uintptr_t)src_xor | (uintptr_t)dst_xor | - (uintptr_t)srcdst_cpy) & longmask)) - goto do_bytes; -#endif - - ldst_xor = (bufhelp_int_t *)(void *)dst_xor; - lsrc_xor = (const bufhelp_int_t *)(void *)src_xor; - lsrcdst_cpy = (bufhelp_int_t *)(void *)srcdst_cpy; - lsrc_cpy = (const bufhelp_int_t *)(const void *)src_cpy; - - for (; len >= sizeof(bufhelp_int_t); len -= sizeof(bufhelp_int_t)) - { - ltemp = (lsrc_cpy++)->a; - (ldst_xor++)->a = (lsrcdst_cpy)->a ^ (lsrc_xor++)->a; - (lsrcdst_cpy++)->a = ltemp; - } - - dst_xor = (byte *)ldst_xor; - src_xor = (const byte *)lsrc_xor; - srcdst_cpy = (byte *)lsrcdst_cpy; - src_cpy = (const byte *)lsrc_cpy; - -#ifndef BUFHELP_FAST_UNALIGNED_ACCESS -do_bytes: -#endif - /* Handle tail. */ - for (; len; len--) - { - temp = *src_cpy++; - *dst_xor++ = *srcdst_cpy ^ *src_xor++; - *srcdst_cpy++ = temp; - } -} - - -/* Optimized function for combined buffer xoring and copying. Used by mainly - CFB mode decryption. */ -static inline void -buf_xor_n_copy(void *_dst_xor, void *_srcdst_cpy, const void *_src, size_t len) -{ - buf_xor_n_copy_2(_dst_xor, _src, _srcdst_cpy, _src, len); -} - - -/* Constant-time compare of two buffers. Returns 1 if buffers are equal, - and 0 if buffers differ. */ -static inline int -buf_eq_const(const void *_a, const void *_b, size_t len) -{ - const byte *a = _a; - const byte *b = _b; - int ab, ba; - size_t i; - - /* Constant-time compare. */ - for (i = 0, ab = 0, ba = 0; i < len; i++) - { - /* If a[i] != b[i], either ab or ba will be negative. */ - ab |= a[i] - b[i]; - ba |= b[i] - a[i]; - } - - /* 'ab | ba' is negative when buffers are not equal. */ - return (ab | ba) >= 0; -} - - #ifndef BUFHELP_UNALIGNED_ACCESS /* Functions for loading and storing unaligned u32 values of different @@ -467,4 +196,188 @@ static inline void buf_put_le64(void *_buf, u64 val) #endif + +/* Optimized function for small buffer copying */ +static inline void +buf_cpy(void *_dst, const void *_src, size_t len) +{ + byte *dst = _dst; + const byte *src = _src; + +#if __GNUC__ >= 4 + if (!__builtin_constant_p (len)) + { + memcpy(_dst, _src, len); + return; + } +#endif + + while (len >= sizeof(u64)) + { + buf_put_he64(dst, buf_get_he64(src)); + dst += sizeof(u64); + src += sizeof(u64); + len -= sizeof(u64); + } + + if (len >= sizeof(u32)) + { + buf_put_he32(dst, buf_get_he32(src)); + dst += sizeof(u32); + src += sizeof(u32); + len -= sizeof(u32); + } + + /* Handle tail. */ + for (; len; len--) + *dst++ = *src++; +} + + +/* Optimized function for buffer xoring */ +static inline void +buf_xor(void *_dst, const void *_src1, const void *_src2, size_t len) +{ + byte *dst = _dst; + const byte *src1 = _src1; + const byte *src2 = _src2; + + while (len >= sizeof(u64)) + { + buf_put_he64(dst, buf_get_he64(src1) ^ buf_get_he64(src2)); + dst += sizeof(u64); + src1 += sizeof(u64); + src2 += sizeof(u64); + len -= sizeof(u64); + } + + if (len > sizeof(u32)) + { + buf_put_he32(dst, buf_get_he32(src1) ^ buf_get_he32(src2)); + dst += sizeof(u32); + src1 += sizeof(u32); + src2 += sizeof(u32); + len -= sizeof(u32); + } + + /* Handle tail. */ + for (; len; len--) + *dst++ = *src1++ ^ *src2++; +} + + +/* Optimized function for buffer xoring with two destination buffers. Used + mainly by CFB mode encryption. */ +static inline void +buf_xor_2dst(void *_dst1, void *_dst2, const void *_src, size_t len) +{ + byte *dst1 = _dst1; + byte *dst2 = _dst2; + const byte *src = _src; + + while (len >= sizeof(u64)) + { + u64 temp = buf_get_he64(dst2) ^ buf_get_he64(src); + buf_put_he64(dst2, temp); + buf_put_he64(dst1, temp); + dst2 += sizeof(u64); + dst1 += sizeof(u64); + src += sizeof(u64); + len -= sizeof(u64); + } + + if (len >= sizeof(u32)) + { + u32 temp = buf_get_he32(dst2) ^ buf_get_he32(src); + buf_put_he32(dst2, temp); + buf_put_he32(dst1, temp); + dst2 += sizeof(u32); + dst1 += sizeof(u32); + src += sizeof(u32); + len -= sizeof(u32); + } + + /* Handle tail. */ + for (; len; len--) + *dst1++ = (*dst2++ ^= *src++); +} + + +/* Optimized function for combined buffer xoring and copying. Used by mainly + CBC mode decryption. */ +static inline void +buf_xor_n_copy_2(void *_dst_xor, const void *_src_xor, void *_srcdst_cpy, + const void *_src_cpy, size_t len) +{ + byte *dst_xor = _dst_xor; + byte *srcdst_cpy = _srcdst_cpy; + const byte *src_xor = _src_xor; + const byte *src_cpy = _src_cpy; + + while (len >= sizeof(u64)) + { + u64 temp = buf_get_he64(src_cpy); + buf_put_he64(dst_xor, buf_get_he64(srcdst_cpy) ^ buf_get_he64(src_xor)); + buf_put_he64(srcdst_cpy, temp); + dst_xor += sizeof(u64); + srcdst_cpy += sizeof(u64); + src_xor += sizeof(u64); + src_cpy += sizeof(u64); + len -= sizeof(u64); + } + + if (len >= sizeof(u32)) + { + u32 temp = buf_get_he32(src_cpy); + buf_put_he32(dst_xor, buf_get_he32(srcdst_cpy) ^ buf_get_he32(src_xor)); + buf_put_he32(srcdst_cpy, temp); + dst_xor += sizeof(u32); + srcdst_cpy += sizeof(u32); + src_xor += sizeof(u32); + src_cpy += sizeof(u32); + len -= sizeof(u32); + } + + /* Handle tail. */ + for (; len; len--) + { + byte temp = *src_cpy++; + *dst_xor++ = *srcdst_cpy ^ *src_xor++; + *srcdst_cpy++ = temp; + } +} + + +/* Optimized function for combined buffer xoring and copying. Used by mainly + CFB mode decryption. */ +static inline void +buf_xor_n_copy(void *_dst_xor, void *_srcdst_cpy, const void *_src, size_t len) +{ + buf_xor_n_copy_2(_dst_xor, _src, _srcdst_cpy, _src, len); +} + + +/* Constant-time compare of two buffers. Returns 1 if buffers are equal, + and 0 if buffers differ. */ +static inline int +buf_eq_const(const void *_a, const void *_b, size_t len) +{ + const byte *a = _a; + const byte *b = _b; + int ab, ba; + size_t i; + + /* Constant-time compare. */ + for (i = 0, ab = 0, ba = 0; i < len; i++) + { + /* If a[i] != b[i], either ab or ba will be negative. */ + ab |= a[i] - b[i]; + ba |= b[i] - a[i]; + } + + /* 'ab | ba' is negative when buffers are not equal. */ + return (ab | ba) >= 0; +} + + #endif /*GCRYPT_BUFHELP_H*/ From cvs at cvs.gnupg.org Mon Oct 29 04:51:49 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Mon, 29 Oct 2018 04:51:49 +0100 Subject: [git] GCRYPT - branch, master, updated. libgcrypt-1.8.1-113-g4a4d4a2 Message-ID: This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "The GNU crypto library". The branch, master has been updated via 4a4d4a284ca996df874e2534f8529c1611289943 (commit) from 6e669e09603e5a98b59dcf35f77f346db6c81eac (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4a4d4a284ca996df874e2534f8529c1611289943 Author: NIIBE Yutaka Date: Mon Oct 29 12:51:19 2018 +0900 build: Update gpg-error.m4 and ksba.m4. * m4/gpg-error.m4: Update to 2018-10-29. * src/libgrypt.m4: Follow the change of gpgrt-config. Bump the version date. Signed-off-by: NIIBE Yutaka diff --git a/m4/gpg-error.m4 b/m4/gpg-error.m4 index 70dc501..0964a26 100644 --- a/m4/gpg-error.m4 +++ b/m4/gpg-error.m4 @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-10-26 +# Last-changed: 2018-10-29 dnl AM_PATH_GPG_ERROR([MINIMUM-VERSION, @@ -67,13 +67,16 @@ AC_DEFUN([AM_PATH_GPG_ERROR], use_gpgrt_config="" if test "$GPG_ERROR_CONFIG" = "no"; then AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) - if CC=$CC $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then - GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" - use_gpgrt_config=yes - gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG --modversion` + if test "$GPGRT_CONFIG" != "no"; then + GPGRT_CONFIG="$GPGRT_CONFIG --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir" + if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then + GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + use_gpgrt_config=yes + gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion` + fi fi else - gpg_error_config_version=`CC=$CC $GPG_ERROR_CONFIG --version` + gpg_error_config_version=`$GPG_ERROR_CONFIG --version` fi if test "$GPG_ERROR_CONFIG" != "no"; then req_major=`echo $min_gpg_error_version | \ @@ -96,30 +99,33 @@ AC_DEFUN([AM_PATH_GPG_ERROR], if test -z "$GPGRT_CONFIG"; then if test "$major" -gt 1 -o "$major" -eq 1 -a "$minor" -ge 33; then AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no) - GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" - use_gpgrt_config=yes + if test "$GPGRT_CONFIG" != "no"; then + GPGRT_CONFIG="$GPGRT_CONFIG --prefix=$prefix --exec-prefix=$exec_prefix --libdir=$libdir" + GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + use_gpgrt_config=yes + fi fi fi fi AC_MSG_CHECKING(for GPG Error - version >= $min_gpg_error_version) if test $ok = yes; then - GPG_ERROR_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --cflags` - GPG_ERROR_LIBS=`CC=$CC $GPG_ERROR_CONFIG --libs` + GPG_ERROR_CFLAGS=`$GPG_ERROR_CONFIG --cflags` + GPG_ERROR_LIBS=`$GPG_ERROR_CONFIG --libs` if test -z "$use_gpgrt_config"; then - GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --mt --cflags 2>/dev/null` - GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG $gpg_error_config_args --mt --libs 2>/dev/null` + GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --mt --cflags 2>/dev/null` + GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --mt --libs 2>/dev/null` else - GPG_ERROR_MT_CFLAGS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null` + GPG_ERROR_MT_CFLAGS=`$GPG_ERROR_CONFIG --variable=mtcflags 2>/dev/null` GPG_ERROR_MT_CFLAGS="$GPG_ERROR_CFLAGS${GPG_ERROR_CFLAGS:+ }$GPG_ERROR_MT_CFLAGS" - GPG_ERROR_MT_LIBS=`CC=$CC $GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null` + GPG_ERROR_MT_LIBS=`$GPG_ERROR_CONFIG --variable=mtlibs 2>/dev/null` GPG_ERROR_MT_LIBS="$GPG_ERROR_LIBS${GPG_ERROR_LIBS:+ }$GPG_ERROR_MT_LIBS" fi AC_MSG_RESULT([yes ($gpg_error_config_version)]) ifelse([$2], , :, [$2]) if test -z "$use_gpgrt_config"; then - gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG --host 2>/dev/null || echo none` + gpg_error_config_host=`$GPG_ERROR_CONFIG --host 2>/dev/null || echo none` else - gpg_error_config_host=`CC=$CC $GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none` + gpg_error_config_host=`$GPG_ERROR_CONFIG --variable=host 2>/dev/null || echo none` fi if test x"$gpg_error_config_host" != xnone ; then if test x"$gpg_error_config_host" != x"$host" ; then diff --git a/src/libgcrypt.m4 b/src/libgcrypt.m4 index 5c3f6e1..2646e96 100644 --- a/src/libgcrypt.m4 +++ b/src/libgcrypt.m4 @@ -9,7 +9,7 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2018-10-26 +# Last-changed: 2018-10-29 dnl AM_PATH_LIBGCRYPT([MINIMUM-VERSION, @@ -54,7 +54,7 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], use_gpgrt_config="" if test x"${LIBGCRYPT_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then - if CC=$CC $GPGRT_CONFIG libgcrypt >/dev/null 2>&1; then + if $GPGRT_CONFIG libgcrypt --exists; then LIBGCRYPT_CONFIG="$GPGRT_CONFIG libgcrypt" use_gpgrt_config=yes fi @@ -82,9 +82,9 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], req_micro=`echo $min_libgcrypt_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` if test -z "$use_gpgrt_config"; then - libgcrypt_config_version=`CC=$CC $LIBGCRYPT_CONFIG --version` + libgcrypt_config_version=`$LIBGCRYPT_CONFIG --version` else - libgcrypt_config_version=`CC=$CC $LIBGCRYPT_CONFIG --modversion` + libgcrypt_config_version=`$LIBGCRYPT_CONFIG --modversion` fi major=`echo $libgcrypt_config_version | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` @@ -118,9 +118,9 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], # API is compatible if test "$req_libgcrypt_api" -gt 0 ; then if test -z "$use_gpgrt_config"; then - tmp=`CC=$CC $LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` + tmp=`$LIBGCRYPT_CONFIG --api-version 2>/dev/null || echo 0` else - tmp=`CC=$CC $LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0` + tmp=`$LIBGCRYPT_CONFIG --variable=api_version 2>/dev/null || echo 0` fi if test "$tmp" -gt 0 ; then AC_MSG_CHECKING([LIBGCRYPT API version]) @@ -134,13 +134,13 @@ AC_DEFUN([AM_PATH_LIBGCRYPT], fi fi if test $ok = yes; then - LIBGCRYPT_CFLAGS=`CC=$CC $LIBGCRYPT_CONFIG --cflags` - LIBGCRYPT_LIBS=`CC=$CC $LIBGCRYPT_CONFIG --libs` + LIBGCRYPT_CFLAGS=`$LIBGCRYPT_CONFIG --cflags` + LIBGCRYPT_LIBS=`$LIBGCRYPT_CONFIG --libs` ifelse([$2], , :, [$2]) if test -z "$use_gpgrt_config"; then - libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` + libgcrypt_config_host=`$LIBGCRYPT_CONFIG --host 2>/dev/null || echo none` else - libgcrypt_config_host=`CC=$CC $LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none` + libgcrypt_config_host=`$LIBGCRYPT_CONFIG --variable=host 2>/dev/null || echo none` fi if test x"$libgcrypt_config_host" != xnone ; then if test x"$libgcrypt_config_host" != x"$host" ; then ----------------------------------------------------------------------- Summary of changes: m4/gpg-error.m4 | 38 ++++++++++++++++++++++---------------- src/libgcrypt.m4 | 20 ++++++++++---------- 2 files changed, 32 insertions(+), 26 deletions(-) hooks/post-receive -- The GNU crypto library http://git.gnupg.org _______________________________________________ Gnupg-commits mailing list Gnupg-commits at gnupg.org http://lists.gnupg.org/mailman/listinfo/gnupg-commits From wk at gnupg.org Mon Oct 29 14:37:17 2018 From: wk at gnupg.org (Werner Koch) Date: Mon, 29 Oct 2018 14:37:17 +0100 Subject: [PATCH] stdmem: free: only call _gcry_secmem_free if needed In-Reply-To: <154068040754.20357.11647983149544271039.stgit@localhost.localdomain> (Jussi Kivilinna's message of "Sun, 28 Oct 2018 01:46:47 +0300") References: <154068040754.20357.11647983149544271039.stgit@localhost.localdomain> Message-ID: <87lg6gj2lu.fsf@wheatstone.g10code.de> Hi! Thanks for this patch. I would even consider this for backporting. > - else if (!_gcry_secmem_free (p)) > + > + if (!_gcry_private_is_secure (freep) || > + !_gcry_secmem_free (freep)) Not related to the above change but in general I think it is important to add least add more comments to the code to warn about the assumptions we make. In particular when we allocate a new overflow pool in the secure memory we do this (in a locked state): --8<---------------cut here---------------start------------->8--- /* Take care: in _gcry_private_is_secure we do not lock and thus * we assume that the second assignment below is atomic. */ pool->next = mainpool.next; mainpool.next = pool; --8<---------------cut here---------------end--------------->8--- MAINPOOL is never changed and thus as long the last assignment is atomic we should always be able to call: --8<---------------cut here---------------start------------->8--- /* Return true if P points into the secure memory areas. */ int _gcry_private_is_secure (const void *p) { pooldesc_t *pool; /* We do no lock here because once a pool is allocated it will not * be removed anymore (except for gcry_secmem_term). Further, * adding a new pool to the list should be atomic. */ for (pool = &mainpool; pool; pool = pool->next) if (pool->okay && ptr_into_pool_p (pool, p)) return 1; return 0; } --8<---------------cut here---------------end--------------->8--- Do we need to think about memory visibility here? Are there case where we pass a P which has been allocated in secure memory but the test does not catch it because the thread in the second function and the one in the first have a different view of the memory? Bypassing locking or having no guaranteed memory barrier is a difficult thing. Just asking. Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From sgarlick at gmail.com Mon Oct 29 13:11:59 2018 From: sgarlick at gmail.com (sgarlick at gmail.com) Date: Mon, 29 Oct 2018 22:41:59 +1030 Subject: [Announce] Libgcrypt 1.8.4 released In-Reply-To: <87r2gclgju.fsf@wheatstone.g10code.de> References: <87r2gclgju.fsf@wheatstone.g10code.de> Message-ID: unsubscribe On Sat, Oct 27, 2018 at 4:55 AM Werner Koch wrote: > Hi! > > The GnuPG Project is pleased to announce the availability of Libgcrypt > versions 1.8.4. This is a maintenance release to fix a few minor bugs. > > Libgcrypt is a general purpose library of cryptographic building blocks. > It is originally based on code used by GnuPG. It does not provide any > implementation of OpenPGP or other protocols. Thorough understanding of > applied cryptography is required to use Libgcrypt. > > > Noteworthy changes in version 1.8.4 > =================================== > > * Bug fixes: > > - Fix infinite loop due to applications using fork the wrong > way. [#3491] > > - Fix possible leak of a few bits of secret primes to pageable > memory. [#3848] > > - Fix possible hang in the RNG (1.8.3 only). [#4034] > > - Several minor fixes. [#4102,#4208,#4209,#4210,#4211,#4212] > > * Performance: > > - On Linux always make use of getrandom if possible and then use > its /dev/urandom behaviour. [#3894] > > > Download > ======== > > Source code is hosted at the GnuPG FTP server and its mirrors as listed > at . On the primary server > the source tarball and its digital signature are: > > https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.bz2 > https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.bz2.sig > > or gzip compressed: > > https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.gz > https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.8.4.tar.gz.sig > > In order to check that the version of Libgcrypt you downloaded is an > original and unmodified file please follow the instructions found at > . In short, you may > use one of the following methods: > > - Check the supplied OpenPGP signature. For example to check the > signature of the file libgcrypt-1.8.4.tar.bz2 you would use this > command: > > gpg --verify libgcrypt-1.8.4.tar.bz2.sig libgcrypt-1.8.4.tar.bz2 > > This checks whether the signature file matches the source file. > You should see a message indicating that the signature is good and > made by one or more of the release signing keys. Make sure that > this is a valid key, either by matching the shown fingerprint > against a trustworthy list of valid release signing keys or by > checking that the key has been signed by trustworthy other keys. > See the end of this mail for information on the signing keys. > > - If you are not able to use an existing version of GnuPG, you have > to verify the SHA-1 checksum. On Unix systems the command to do > this is either "sha1sum" or "shasum". Assuming you downloaded the > file libgcrypt-1.8.4.tar.bz2, you run the command like this: > > sha1sum libgcrypt-1.8.4.tar.bz2 > > and check that the output matches the first line from the > this list: > > 4a8ef9db6922f3a31992aca5640b4198a69b58fc libgcrypt-1.8.4.tar.bz2 > 211855f39f3bc3c4a4f444d4c09d743dfc5cb427 libgcrypt-1.8.4.tar.gz > > You should also verify that the checksums above are authentic by > matching them with copies of this announcement. Those copies can be > found at other mailing lists, web sites, and search engines. > > > Copying > ======= > > Libgcrypt is distributed under the terms of the GNU Lesser General > Public License (LGPLv2.1+). The helper programs as well as the > documentation are distributed under the terms of the GNU General Public > License (GPLv2+). The file LICENSES has notices about contributions > that require that these additional notices are distributed. > > > Support > ======= > > In case of build problems specific to this release please first check > https://dev.gnupg.org/T4234 for updated information. > > For help on developing with Libgcrypt you should read the included > manual and optional ask on the gcrypt-devel mailing list [1]. A > listing with commercial support offers for Libgcrypt and related > software is available at the GnuPG web site [2]. > > If you are a developer and you may need a certain feature for your > project, please do not hesitate to bring it to the gcrypt-devel > mailing list for discussion. > > > Thanks > ====== > > Maintenance and development of GnuPG is mostly financed by donations. > The GnuPG project currently employs one full-time developer and two > contractors. They all work exclusively on GnuPG and closely related > software like Libgcrypt, GPGME, and GPA. > > We have to thank all the people who helped the GnuPG project, be it > testing, coding, translating, suggesting, auditing, administering the > servers, spreading the word, and answering questions on the mailing > lists. Thanks to Tomas Mraz for pointing out several smaller flaws. > > Many thanks to our numerous financial supporters, both corporate and > individuals. Without you it would not be possible to keep GnuPG in a > good shape and address all the small and larger requests made by our > users. Thanks. > > > Happy hacking, > > Your GnuPG hackers > > > > p.s. > This is an announcement only mailing list. Please send replies only to > the gnupg-users'at'gnupg.org mailing list. > > p.p.s > List of Release Signing Keys: > > To guarantee that a downloaded GnuPG version has not been tampered by > malicious entities we provide signature files for all tarballs and > binary versions. The keys are also signed by the long term keys of > their respective owners. Current releases are signed by one or more > of these four keys: > > rsa2048 2011-01-12 [expires: 2019-12-31] > Key fingerprint = D869 2123 C406 5DEA 5E0F 3AB5 249B 39D2 4F25 E3B6 > Werner Koch (dist sig) > > rsa2048 2014-10-29 [expires: 2019-12-31] > Key fingerprint = 46CC 7308 65BB 5C78 EBAB ADCF 0437 6F3E E085 6959 > David Shaw (GnuPG Release Signing Key) > > rsa2048 2014-10-29 [expires: 2020-10-30] > Key fingerprint = 031E C253 6E58 0D8E A286 A9F2 2071 B08A 33BD 3F06 > NIIBE Yutaka (GnuPG Release Key) > > rsa3072 2017-03-17 [expires: 2027-03-15] > Key fingerprint = 5B80 C575 4298 F0CB 55D8 ED6A BCEF 7E29 4B09 2E28 > Andre Heinecke (Release Signing Key) > > The keys are available at and > in any recently released GnuPG tarball in the file g10/distsigkey.gpg . > Note that this mail has been signed by a different key. > > -- > Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. > _______________________________________________ > Gnupg-announce mailing list > Gnupg-announce at gnupg.org > http://lists.gnupg.org/mailman/listinfo/gnupg-announce > _______________________________________________ > Gnupg-users mailing list > Gnupg-users at gnupg.org > http://lists.gnupg.org/mailman/listinfo/gnupg-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jancar.jj at gmail.com Mon Oct 29 15:41:44 2018 From: jancar.jj at gmail.com (=?UTF-8?B?SsOhbiBKYW7EjcOhcg==?=) Date: Mon, 29 Oct 2018 15:41:44 +0100 Subject: ECDH loads parameters as signed In-Reply-To: References: Message-ID: On 18/10/2018 11:51, J?n Jan??r wrote: > Hi all, > while trying to get libgcrypt to do ECDH I think I came up to a bug, or > at least a bit of unexpected behavior. > > See the attached test.c for a proof-of-concept that fails/loops > indefinitely, but should work. The issue is that > ecc_encrypt_raw/ecc_decrypt_raw extract the domain > parameters from the keys using the signed option in sexp_extract_param. > This means that if keys are generated, then exported into unsigned MPIs > from the S-exps, then again built into S-exps using the unsigned > notation %M, and passed into ecc_encrypt_raw/ecc_decrypt_raw, they will > still be considered signed if their highest bit is set. This is a > problem for most curves that have such primes/parameters. > > The attached patch fixes this problem and the proof-of-concept works. Any updates on this? Such exporting and loading parameters back should work. The same problem appears in ECDSA. Cheers, J?n Jan??r From gniibe at fsij.org Tue Oct 30 03:17:35 2018 From: gniibe at fsij.org (NIIBE Yutaka) Date: Tue, 30 Oct 2018 11:17:35 +0900 Subject: ECDH loads parameters as signed In-Reply-To: References: Message-ID: <87tvl4w534.fsf@fsij.org> Hello, J?n Jan??r wrote: > while trying to get libgcrypt to do ECDH I think I came up to a bug, or > at least a bit of unexpected behavior. Sorry for late response. Frankly speaking, I don't understand what you try to solve. I would agree that it might be good idea to use unsigned representation, if it were now the time we start writing new code. > This means that if keys are generated, then exported into unsigned MPIs > from the S-exps, then again built into S-exps using the unsigned > notation %M, and passed into ecc_encrypt_raw/ecc_decrypt_raw, they will > still be considered signed if their highest bit is set. Isn't it a thing of... "Don't do that, then."? IIUC, your proposed change will break existing keys with PUBKEY_FLAG_PARAM, represented by %m (signed). See the function ecc_generate in libgcrypt/cipher/ecc.c. -- From wk at gnupg.org Mon Oct 29 17:44:35 2018 From: wk at gnupg.org (Werner Koch) Date: Mon, 29 Oct 2018 17:44:35 +0100 Subject: ECDH loads parameters as signed In-Reply-To: (=?utf-8?B?IkrDoW4gSmFuxI3DoXIiJ3M=?= message of "Mon, 29 Oct 2018 15:41:44 +0100") References: Message-ID: <87pnvsg0ss.fsf@wheatstone.g10code.de> On Mon, 29 Oct 2018 15:41, jancar.jj at gmail.com said: > Any updates on this? Such exporting and loading parameters back should > work. The same problem appears in ECDSA. I considered to include this in 1.8.4 but given that I have seen no further comments your patch first needs closer investigations. We need to check the history to see why the code was written this way. Even if your issue is a bug (in the sense of a wrong/different implementation) we can't simply change it and risk that other applications break. Shalom-Salam, Werner -- Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 227 bytes Desc: not available URL: From jussi.kivilinna at iki.fi Tue Oct 30 17:50:30 2018 From: jussi.kivilinna at iki.fi (Jussi Kivilinna) Date: Tue, 30 Oct 2018 18:50:30 +0200 Subject: [PATCH] stdmem: free: only call _gcry_secmem_free if needed In-Reply-To: <87lg6gj2lu.fsf@wheatstone.g10code.de> References: <154068040754.20357.11647983149544271039.stgit@localhost.localdomain> <87lg6gj2lu.fsf@wheatstone.g10code.de> Message-ID: Hello, On 29.10.2018 15.37, Werner Koch wrote: > Hi! > > Thanks for this patch. I would even consider this for backporting. > >> - else if (!_gcry_secmem_free (p)) >> + >> + if (!_gcry_private_is_secure (freep) || >> + !_gcry_secmem_free (freep)) > > Not related to the above change but in general I think it is important > to add least add more comments to the code to warn about the assumptions > we make. Ok, I'll add some comments. > > In particular when we allocate a new overflow pool in the secure memory > we do this (in a locked state): > > --8<---------------cut here---------------start------------->8--- > /* Take care: in _gcry_private_is_secure we do not lock and thus > * we assume that the second assignment below is atomic. */ > pool->next = mainpool.next; > mainpool.next = pool; > --8<---------------cut here---------------end--------------->8--- > > MAINPOOL is never changed and thus as long the last assignment is atomic > we should always be able to call: > > --8<---------------cut here---------------start------------->8--- > /* Return true if P points into the secure memory areas. */ > int > _gcry_private_is_secure (const void *p) > { > pooldesc_t *pool; > > /* We do no lock here because once a pool is allocated it will not > * be removed anymore (except for gcry_secmem_term). Further, > * adding a new pool to the list should be atomic. */ > for (pool = &mainpool; pool; pool = pool->next) > if (pool->okay && ptr_into_pool_p (pool, p)) > return 1; > > return 0; > } > --8<---------------cut here---------------end--------------->8--- > > Do we need to think about memory visibility here? Are there case where > we pass a P which has been allocated in secure memory but the test does > not catch it because the thread in the second function and the one in > the first have a different view of the memory? Bypassing locking or > having no guaranteed memory barrier is a difficult thing. Just asking. > I do see one problem. The two stores when adding new overflow pool might get re-ordered: 1> reg = mainpool.next; 2> pool->next = reg; 3> mainpool.next = pool; to 1> reg = mainpool.next; 3> mainpool.next = pool; 2> pool->next = reg; Now _gcry_private_is_secure might see load 3 but not 2, and exit loop too early (pool->next == NULL, should see pool->next == old mainpool.next). I think adding memory barrier before setting mainpool.next is enough to prevent this. That ensures that thread in _gcry_private_is_secure sees new pool structure properly initialized. 1> reg = mainpool.next; 2> pool->next = reg; memory_barrier (); 3> mainpool.next = pool; -Jussi From kristian.fiskerstrand at sumptuouscapital.com Tue Oct 30 21:55:14 2018 From: kristian.fiskerstrand at sumptuouscapital.com (Kristian Fiskerstrand) Date: Tue, 30 Oct 2018 21:55:14 +0100 Subject: [PATCH] stdmem: free: only call _gcry_secmem_free if needed In-Reply-To: <154068040754.20357.11647983149544271039.stgit@localhost.localdomain> References: <154068040754.20357.11647983149544271039.stgit@localhost.localdomain> Message-ID: On 10/28/18 12:46 AM, Jussi Kivilinna wrote: > Unnecessarily taking secmem lock on non-secure memory can result poor > performance on multi-threaded workloads: > https://marc.info/?l=gcrypt-devel&m=153424107207061&w=2 If you are making changes to the patch anyways, maybe update this comment to use https://lists.gnupg.org/pipermail/gcrypt-devel/2018-August/004535.html instead so we don't rely on third party service? It was painful enough when Gmane dissapeared. -- ---------------------------- Kristian Fiskerstrand Blog: https://blog.sumptuouscapital.com Twitter: @krifisk ---------------------------- Public OpenPGP keyblock at hkp://pool.sks-keyservers.net fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3 ---------------------------- Timendi causa est nescire The cause of fear is ignorance -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 488 bytes Desc: OpenPGP digital signature URL: From jancar.jj at gmail.com Wed Oct 31 00:06:32 2018 From: jancar.jj at gmail.com (=?UTF-8?B?SsOhbiBKYW7EjcOhcg==?=) Date: Wed, 31 Oct 2018 00:06:32 +0100 Subject: ECDH loads parameters as signed In-Reply-To: <87tvl4w534.fsf@fsij.org> References: <87tvl4w534.fsf@fsij.org> Message-ID: <331e6ed4-b1d2-5a6f-0af8-e062ac0690e7@gmail.com> Hi, On 30/10/2018 03:17, NIIBE Yutaka wrote: > Hello, > > J?n Jan??r wrote: >> while trying to get libgcrypt to do ECDH I think I came up to a bug, or >> at least a bit of unexpected behavior. > > Sorry for late response. Frankly speaking, I don't understand what you > try to solve. I am trying to generate keypairs, export them (into Java via JNI), then import them again and use them. For that an unsigned representation of the domain parameters and key material seemed obvious. > > I would agree that it might be good idea to use unsigned representation, > if it were now the time we start writing new code. > >> This means that if keys are generated, then exported into unsigned MPIs >> from the S-exps, then again built into S-exps using the unsigned >> notation %M, and passed into ecc_encrypt_raw/ecc_decrypt_raw, they will >> still be considered signed if their highest bit is set. > > Isn't it a thing of... "Don't do that, then."? > > IIUC, your proposed change will break existing keys with > PUBKEY_FLAG_PARAM, represented by %m (signed). See the function > ecc_generate in libgcrypt/cipher/ecc.c. > My thinking is that when I specify %M in building the S-exp, I mean that the MPI should be stored and interpreted in the S-exp as unsigned. Thus gcry_pk_encrypt/decrypt and gcry_pk_sign/verify should not just choose to re-interpret them as signed. Will the change actually break using those keys? I applied the changes to ECDH and tested generating a keypair with PUBKEY_FLAG_PARAM, the public key of which is then directly passed into gcry_pk_encrypt, and it proceeds just fine, the values of loaded domain parameters are the same. Cheers, J?n Jan??r From jancar.jj at gmail.com Wed Oct 31 00:32:32 2018 From: jancar.jj at gmail.com (=?UTF-8?B?SsOhbiBKYW7EjcOhcg==?=) Date: Wed, 31 Oct 2018 00:32:32 +0100 Subject: ECDH loads parameters as signed In-Reply-To: <87pnvsg0ss.fsf@wheatstone.g10code.de> References: <87pnvsg0ss.fsf@wheatstone.g10code.de> Message-ID: On 29/10/2018 17:44, Werner Koch wrote: > On Mon, 29 Oct 2018 15:41, jancar.jj at gmail.com said: > >> Any updates on this? Such exporting and loading parameters back should >> work. The same problem appears in ECDSA. > > I considered to include this in 1.8.4 but given that I have seen no > further comments your patch first needs closer investigations. We need > to check the history to see why the code was written this way. Even if > your issue is a bug (in the sense of a wrong/different implementation) > we can't simply change it and risk that other applications break. The use of sexp_extract_param with the signed prefix was introduced in 6bd5d18c, which moved the sexp parsing from gcry_pk_encrypt to ecc_encrypt_raw. Previously the keyparams S-exp was parsed using a loop and: gcry_sexp_nth_mpi (list, 1, GCRYMPI_FMT_STD); as in 6bd5d18c: cipher/pubkey.c (sexp_elements_extract_ecc). However, before 6bd5d18c, which introduced eddsa, this was done using: gcry_sexp_nth_mpi (list, 1, GCRYMPI_FMT_USG); Thus there is the change from unsigned to signed. I think reasonable behavior is one where the way the S-exp is built determines whether the mpis are considered signed or unsigned, thus %M -> unsigned, %m -> signed, as I think the S-exp should hold this information, or not? Cheers, J?n Jan??r From jancar.jj at gmail.com Wed Oct 31 12:10:52 2018 From: jancar.jj at gmail.com (=?UTF-8?B?SsOhbiBKYW7EjcOhcg==?=) Date: Wed, 31 Oct 2018 12:10:52 +0100 Subject: ECDH loads parameters as signed In-Reply-To: References: <87pnvsg0ss.fsf@wheatstone.g10code.de> Message-ID: <26eebcb1-9c0f-ff9c-24c2-40a8c7a2b92f@gmail.com> On 31/10/2018 00:32, J?n Jan??r wrote: > > > On 29/10/2018 17:44, Werner Koch wrote: >> On Mon, 29 Oct 2018 15:41, jancar.jj at gmail.com said: >> >>> Any updates on this? Such exporting and loading parameters back should >>> work. The same problem appears in ECDSA. >> >> I considered to include this in 1.8.4 but given that I have seen no >> further comments your patch first needs closer investigations. We need >> to check the history to see why the code was written this way. Even if >> your issue is a bug (in the sense of a wrong/different implementation) >> we can't simply change it and risk that other applications break. > > The use of sexp_extract_param with the signed prefix was introduced in > 6bd5d18c, which moved the sexp parsing from gcry_pk_encrypt to > ecc_encrypt_raw. Previously the keyparams S-exp was parsed using a loop and: > > gcry_sexp_nth_mpi (list, 1, GCRYMPI_FMT_STD); > > as in 6bd5d18c: cipher/pubkey.c (sexp_elements_extract_ecc). > > However, before 6bd5d18c, which introduced eddsa, this was done using: Sorry, the eddsa introduction should have been commit 63cd34744, mis-copied the id. Cheers, J?n Jan??r