From 764a8853e0dc04c67f4ab7044dfce8c3323f528b Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Mon, 16 Jul 2018 14:34:49 +0000 Subject: [PATCH 01/50] follows PR#63 on grenache-grape (Forward get opts to dht) --- src/grenache-get.in | 131 +++++++++++++++++++++++++++----------------- 1 file changed, 81 insertions(+), 50 deletions(-) diff --git a/src/grenache-get.in b/src/grenache-get.in index b97bf68..58295db 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -19,11 +19,11 @@ readonly ME="${BASH_SOURCE[0]}" readonly WHOAMI="$(@READLINK@ -snf "${ME}")" -readonly ARGV=$(@GETOPT@ -o 'g:hip:trvVw' --long 'grape:,help,id,port:,tls,raw,value,version,write' -n "${ME##*/}" -- "$@") || exit 1 +readonly ARGV=$(@GETOPT@ -o 'g:hip:trs:vVw' --long 'grape:,help,id,port:,tls,raw,salt:,value,version,write' -n "${ME##*/}" -- "$@") || exit 1 TLS='' +SALT='' PORT=30002 -EXIT_CODE=1 HOSTNAME='127.0.0.1' QUERY='select(.v) | .v' @@ -32,7 +32,7 @@ QUERY='select(.v) | .v' function show_help { @CAT@ <<_EOF Usage: - ${ME##*/} [OPTIONS] ... -- send a GET request to the DHT + ${ME##*/} [OPTIONS] -- send a GET request to the DHT Options: @@ -41,6 +41,7 @@ Usage: -p, --port Set the Grape port number -t, --tls Enable TLS -r, --raw Get the raw response message + -s, --salt Set salt for this request -v, --value Get the stored value -w, --write Get the write token @@ -108,6 +109,19 @@ while true; do -r | --raw ) QUERY='select(.)'; shift 1 ;; + -s | --salt ) + [[ -z "${2}" ]] && { + echo "${ME##*/}: error: empty salt string." >&2 + exit 1 + } + + [[ "${#2}" -gt 64 ]] && { + echo "${ME##*/}: error: salt is too big." >&2 + exit 1 + } + + SALT="${2}"; shift 2 + ;; -v | --value ) QUERY='select(.v) | .v'; shift 1 ;; @@ -132,70 +146,87 @@ done exit 1 } +HASH="${1}" exec {stderr}>&2 [[ x"${GRENACHE_CLI_DEBUG:+set}" != xset ]] && { exec 2>/dev/null } -for hash in "${@}" -do - [[ "${hash}" =~ ^[a-fA-F0-9]{40}$ ]] || { - echo "${ME##*/}: warning: invalid hash provided: ${hash}." >&"${stderr}" - continue - } +[[ "${HASH}" =~ ^[a-fA-F0-9]{40}$ ]] || { + echo "${ME##*/}: error: invalid hash provided: ${HASH}." >&"${stderr}" - JSON="$(@CURL@ -qK "${HOME}/.grenache-cli/grenache-cli.conf" -A '@PACKAGE@/@PACKAGE_VERSION@' "http${TLS:+s}://${HOSTNAME}:${PORT}/get" < <( \ - @JQ@ -cnM \ - --arg 'data' "${hash}" \ - --arg 'rid' "$(@UUIDGEN@)" \ - '{ "data": $data, "rid": $rid }' \ - ))" + exec {stderr}>&- + exit 1 +} - [[ -z "${JSON}" ]] && { - echo "${ME##*/}: warning: hash ${hash} not found." >&"${stderr}" - continue - } +JSON="$(@CURL@ -qK "${HOME}/.grenache-cli/grenache-cli.conf" -A '@PACKAGE@/@PACKAGE_VERSION@' "http${TLS:+s}://${HOSTNAME}:${PORT}/get" < <( \ + @JQ@ -cnM \ + --arg 'hash' "${HASH}" \ + --arg 'salt' "${SALT:-}" \ + --arg 'rid' "$(@UUIDGEN@)" \ + '{ "data": { "hash": $hash, "salt": $salt }, "rid": $rid }' +))" + +[[ -z "${JSON}" ]] && { + echo "${ME##*/}: error: hash ${HASH} not found." >&"${stderr}" + + exec {stderr}>&- + exit 1 +} - @JQ@ -e 'has("k")' >/dev/null <<<"${JSON}" && { - CHALLENGE='' +@JQ@ -e 'has("k")' >/dev/null <<<"${JSON}" && { + CHALLENGE='' + [[ -z "${SALT}" ]] || { @JQ@ -e 'has("salt")' >/dev/null <<<"${JSON}" && { - CHALLENGE+="$(@JQ@ -j '"4:salt\(.salt | length):\(.salt)"' <<<"${JSON}")" - } + GRENACHE_SALT="$(@JQ@ -r '.salt' <<<"${JSON}")" - CHALLENGE+="$(@JQ@ -j '"3:seqi" + "\(.seq)" + "e1:v" + "\(.v | length):\(.v)"' <<<"${JSON}")" - - ${WHOAMI%/*}/grc-verify "${CHALLENGE}" \ - @PKEY_FILENO@< <( \ - @JQ@ -r 'select(.k) | .k' <<<"${JSON}" - ) \ - @SIGN_FILENO@< <( \ - @JQ@ -r 'select(.sig) | .sig' <<<"${JSON}" - ) >/dev/null || { - echo "${ME##*/}: warning: cannot verify challenge buffer." >&"${stderr}" - continue + [[ "${GRENACHE_SALT}" = "${SALT}" ]] || { + echo "${ME##*/}: error: salt mismatch." >&"${stderr}" + + exec {stderr}>&- + exit 1 + } } - CHECK="$(@SHA1SUM@ < <( \ - printf '%s' \ - "$(@XXD@ -r -p < <( @JQ@ -r 'select(.k) | .k' <<<"${JSON}" ))" \ - "$(@JQ@ -r 'select(.salt) | .salt' <<<"${JSON}")" - ))" - } || { - CHECK="$(@SHA1SUM@ < <( \ - @JQ@ -j 'select(.v) | "\(.v | length):\(.v)"' <<<"${JSON}" - ))" + CHALLENGE+="4:salt${#SALT}:${SALT}" } - [[ "x${hash}" = "x${CHECK%% *}" ]] || { - echo "${ME##*/}: warning: unexpected value." >&"${stderr}" - continue + CHALLENGE+="$(@JQ@ -j '"3:seqi" + "\(.seq)" + "e1:v" + "\(.v | length):\(.v)"' <<<"${JSON}")" + + ${WHOAMI%/*}/grc-verify "${CHALLENGE}" \ + @PKEY_FILENO@< <( \ + @JQ@ -r 'select(.k) | .k' <<<"${JSON}" + ) \ + @SIGN_FILENO@< <( \ + @JQ@ -r 'select(.sig) | .sig' <<<"${JSON}" + ) >/dev/null || { + echo "${ME##*/}: error: cannot verify challenge buffer." >&"${stderr}" + + exec {stderr}>&- + exit 1 } - @JQ@ -r "${QUERY}" <<<"${JSON}" \ - && EXIT_CODE=0 -done + CHECK="$(@SHA1SUM@ < <( \ + printf '%s' \ + "$(@XXD@ -r -p < <( @JQ@ -r 'select(.k) | .k' <<<"${JSON}" ))" \ + "${SALT:-}" + ))" +} || { + CHECK="$(@SHA1SUM@ < <( \ + @JQ@ -j 'select(.v) | "\(.v | length):\(.v)"' <<<"${JSON}" + ))" +} + +[[ "x${HASH}" = "x${CHECK%% *}" ]] || { + echo "${ME##*/}: error: unexpected value." >&"${stderr}" + + exec {stderr}>&- + exit 1 +} + +@JQ@ -cMr "${QUERY}" <<<"${JSON}" exec {stderr}>&- -exit "${EXIT_CODE}" +exit 0 From 0148bf20817feeb3a4d6bdcd53b90128e3ae2fbe Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Mon, 16 Jul 2018 14:37:30 +0000 Subject: [PATCH 02/50] documentation updated mentioning the new requirement --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 337f7d2..fc8e216 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ to retrieve the complete options list. ## Retreive items from the DHT -The `grenache-get` command reads a data record from the DHT (see [BEP 44](http://bittorrent.org/beps/bep_0044.html) for more information). There is no differences in retreiving a _mutable_ or an _immutable_ item; on both cases the key returned by the *PUT* request must be provided. In any case, `grenache-get` validates the payload it receive; this will ensure that the _key_ provided really match the payload and, in case of a _mutable_ item, that the signature is correct. This will protect you from evil nodes on the network. To read an item from the DHT simply run something like this: +The `grenache-get` command reads a data record from the DHT (see [BEP 44](http://bittorrent.org/beps/bep_0044.html) for more information). There is no differences in retreiving a _mutable_ or an _immutable_ item; in both cases the key returned by the *PUT* request must be provided. Furthermore, starting from version _[0.9.6](https://github.com/bitfinexcom/grenache-grape/commit/efbfc11)_ of [grenache-grape](https://github.com/bitfinexcom/grenache-grape), the _salt_ specified during the *PUT* operation must be provided if used. In any case, `grenache-get` validates the payload it receive; this will ensure that the _key_ provided really match the payload and, in case of a _mutable_ item, that the signature is correct. This will protect you from evil nodes on the network. To read an item from the DHT simply run something like this: ```bash grenache-get '81c2a8157780989af9a16661324fafbd7803877d' @@ -101,7 +101,7 @@ For example, you can format the previously stored available memory amount using ```bash numfmt --from=auto --to=iec-i < <( - grenache-get '81c2a8157780989af9a16661324fafbd7803877d' + grenache-get --salt 'sys:mem:available' '633def0b4349e2ed5bfbe0a5a1bb34e622f8c20d' ) ``` From e608465385b5cc2901c5d2b3d555f8d64033e8be Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 17 Jul 2018 07:58:03 +0000 Subject: [PATCH 03/50] help and version messages have been improved --- src/grenache-announce.in | 30 ++++++++++++++++++------------ src/grenache-get.in | 36 +++++++++++++++++++++--------------- src/grenache-keygen.in | 22 ++++++++++++++-------- src/grenache-lookup.in | 34 ++++++++++++++++++++-------------- src/grenache-put.in | 34 ++++++++++++++++++++-------------- 5 files changed, 93 insertions(+), 63 deletions(-) diff --git a/src/grenache-announce.in b/src/grenache-announce.in index f767996..8e6c500 100644 --- a/src/grenache-announce.in +++ b/src/grenache-announce.in @@ -33,21 +33,25 @@ JQ_ARGV=(--unbuffered -r) # Show program's help. function show_help { @CAT@ <<_EOF -Usage: - ${ME##*/} [OPTIONS] ... -- announce a service on the DHT. +${ME##*/} announces a service on the DHT - Options: +Usage: ${ME##*/} [OPTION]... [SERVICE]... - -d, --delimiter Set the service/port delimiter - -g, --grape Set the Grape hostname - -j, --json Use JSON as data serializer - -p, --port Set the Grape port number - -t, --tls Enable TLS +Options: + -d, --delimiter Set the service,port delimiter + -g, --grape Set the Grape hostname + -j, --json Use JSON as data serializer + -p, --port Set the Grape port number + -t, --tls Enable TLS - -h, --help Show this message - -V, --version Show version information + -h, --help Show help message + -V, --version Show version information - The order of the specified options is not relevant. +Examples: + ${ME##*/} Announce services from stdin + ${ME##*/} -d/ The same thing, but use / as delimiter + +Report bugs to <@PACKAGE_BUGREPORT@>. _EOF exit 1 @@ -56,12 +60,14 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@host_cpu@-@host_os@) @PACKAGE_NAME@/@PACKAGE_VERSION@ +${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ + Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by Davide Scola. _EOF exit 1 diff --git a/src/grenache-get.in b/src/grenache-get.in index 58295db..b94dba5 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -31,24 +31,28 @@ QUERY='select(.v) | .v' # Show program's help. function show_help { @CAT@ <<_EOF -Usage: - ${ME##*/} [OPTIONS] -- send a GET request to the DHT +${ME##*/} sends a GET request to the DHT - Options: +Usage: ${ME##*/} [OPTION]... HASH - -g, --grape Set the Grape hostname - -i. --id Get the id of sending node - -p, --port Set the Grape port number - -t, --tls Enable TLS - -r, --raw Get the raw response message - -s, --salt Set salt for this request - -v, --value Get the stored value - -w, --write Get the write token +Options: + -g, --grape Set the Grape hostname + -i. --id Get the id of sending node + -p, --port Set the Grape port number + -t, --tls Enable TLS + -r, --raw Get the raw response message + -s, --salt Set salt for this request + -v, --value Get the stored value + -w, --write Get the write token - -h, --help Show this message - -V, --version Show version information + -h, --help Show help message + -V, --version Show version information - The order of the specified options is not relevant. +Examples: + ${ME##*/} foo Read value whose hash is foo from the DHT + ${ME##*/} -s bar foo The same thing, using bar as salt + +Report bugs to <@PACKAGE_BUGREPORT@>. _EOF exit 1 @@ -57,12 +61,14 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@host_cpu@-@host_os@) @PACKAGE_NAME@/@PACKAGE_VERSION@ +${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ + Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by Davide Scola. _EOF exit 1 diff --git a/src/grenache-keygen.in b/src/grenache-keygen.in index 6761827..6efd3a5 100644 --- a/src/grenache-keygen.in +++ b/src/grenache-keygen.in @@ -27,17 +27,21 @@ OVERWRITE='no' # Show program's help. function show_help { @CAT@ <<_EOF -Usage: - ${ME##*/} [OPTIONS] -- creates your grenache-cli keypair. +${ME##*/} generates and manages authentication keys - Options: +Usage: ${ME##*/} [OPTION]... - -f, --force Overwrite existing keypair +Options: + -f, --force Overwrite existing keypair - -h, --help Show this message - -V, --version Show version information + -h, --help Show help message + -V, --version Show version information - The order of the specified options is not relevant. +Examples: + ${ME##*/} Create a new keypair + ${ME##*/} -f The same thing, but overwrites the existing one + +Report bugs to <@PACKAGE_BUGREPORT@>. _EOF exit 1 @@ -46,12 +50,14 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@host_cpu@-@host_os@) @PACKAGE_NAME@/@PACKAGE_VERSION@ +${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ + Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by Davide Scola. _EOF exit 1 diff --git a/src/grenache-lookup.in b/src/grenache-lookup.in index f82e5cc..0a555b6 100644 --- a/src/grenache-lookup.in +++ b/src/grenache-lookup.in @@ -36,23 +36,27 @@ readonly LOOKUP_RANDOM=8 # Show program's help. function show_help { @CAT@ <<_EOF -Usage: - ${ME##*/} [OPTIONS] ... -- lookup a service in the DHT. +${ME##*/} looks for a service in the DHT - Options: +Usage: ${ME##*/} [OPTION]... SERVICE... - -a, --all Pick all peers in list - -f, --first Pick the first peer in list - -g, --grape Set the Grape hostname - -l, --last Pick the last peer in list - -p, --port Set the Grape port number - -r, --random Pick a random peer in list - -t, --tls Enable TLS +Options: + -a, --all Pick all peers in list + -f, --first Pick the first peer in list + -g, --grape Set the Grape hostname + -l, --last Pick the last peer in list + -p, --port Set the Grape port number + -r, --random Pick a random peer in list + -t, --tls Enable TLS - -h, --help Show this message - -V, --version Show version information + -h, --help Show help message + -V, --version Show version information - The order of the specified options is not relevant. +Examples: + ${ME##*/} 'foo' Pick a random peer that provides the foo service + ${ME##*/} -a 'foo' The same thing, but retreive all peers + +Report bugs to <@PACKAGE_BUGREPORT@>. _EOF exit 1 @@ -61,12 +65,14 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@host_cpu@-@host_os@) @PACKAGE_NAME@/@PACKAGE_VERSION@ +${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ + Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by Davide Scola. _EOF exit 1 diff --git a/src/grenache-put.in b/src/grenache-put.in index e11bf5b..4a2904d 100644 --- a/src/grenache-put.in +++ b/src/grenache-put.in @@ -33,23 +33,27 @@ SEQUENCE="$(@DATE@ '+%s%6N')" # Show program's help. function show_help { @CAT@ <<_EOF -Usage: - ${ME##*/} [OPTIONS] ... -- send a PUT request to the DHT +${ME##*/} sends a PUT request to the DHT - Options: +Usage: ${ME##*/} [OPTION]... VALUE - -c, --cas Set the compare and swap number - -g, --grape Set the Grape hostname - -m, --mutable Send a mutable PUT request - -n, --number Set the sequence number of this PUT request - -p, --port Set the Grape port number - -s, --salt Set salt for this request - -t, --tls Enable TLS +Options: + -c, --cas Set the compare and swap number + -g, --grape Set the Grape hostname + -m, --mutable Send a mutable PUT request + -n, --number Set the sequence number of this PUT request + -p, --port Set the Grape port number + -s, --salt Set salt for this request + -t, --tls Enable TLS - -h, --help Show this message - -V, --version Show version information + -h, --help Show help message + -V, --version Show version information - The order of the specified options is not relevant. +Examples: + ${ME##*/} 'foo' Store the value foo to the DHT + ${ME##*/} -m 'foo' The same thing, but as mutable value + +Report bugs to <@PACKAGE_BUGREPORT@>. _EOF exit 1 @@ -58,12 +62,14 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@host_cpu@-@host_os@) @PACKAGE_NAME@/@PACKAGE_VERSION@ +${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ + Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +Written by Davide Scola. _EOF exit 1 From 12e3f73db3ce06024e3b564bbd5bc02e140a1f63 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 17 Jul 2018 08:03:30 +0000 Subject: [PATCH 04/50] generation of manual pages has been added --- Makefile.am | 2 +- configure.ac | 2 ++ doc/Makefile.am | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 doc/Makefile.am diff --git a/Makefile.am b/Makefile.am index d436237..d572472 100644 --- a/Makefile.am +++ b/Makefile.am @@ -18,7 +18,7 @@ ACLOCAL_AMFLAGS = -I m4 -GRC_SUBDIRS = . src tests +GRC_SUBDIRS = . doc src tests SUBDIRS = $(GRC_SUBDIRS) DIST_SUBDIRS = $(GRC_SUBDIRS) include m4 diff --git a/configure.ac b/configure.ac index 3689104..797b9be 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,7 @@ AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL AC_PROG_AWK +AM_MISSING_PROG([HELP2MAN], [help2man]) AX_PROG_JQ AX_PROG_CAT @@ -180,6 +181,7 @@ AX_MSG_BOLD([Writing output files]) AC_CONFIG_FILES([ \ Makefile \ + doc/Makefile \ m4/Makefile \ include/Makefile \ src/Makefile \ diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..824f0d2 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,32 @@ +############################################################################ +# This file is part of Grenache Command Line Interface. # +# # +# Copyright (C) 2017, 2018 Davide Scola # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # +# implied. See the License for the specific language governing permissions # +# and limitations under the License. # +############################################################################ + +dist_man1_MANS = \ +grenache-get.1 \ +grenache-put.1 \ +grenache-keygen.1 \ +grenache-lookup.1 \ +grenache-announce.1 + +MAINTAINERCLEANFILES = \ +$(dist_man1_MANS) + +%.1: $(top_srcdir)/src/%.in $(top_srcdir)/doc/Makefile.am + $(HELP2MAN) --no-info --output=$@ --version-string="$(PACKAGE_VERSION)" \ + --name="manual page for $(notdir $(basename $<)) ($(PACKAGE_NAME)) $(PACKAGE_VERSION) on $(host_cpu)-$(host_os)" \ + "${SHELL} $(basename $<)$(EXEEXT)" From 126b080cf88119c5904ae26aa420f2f98ac85a69 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 17 Jul 2018 08:07:21 +0000 Subject: [PATCH 05/50] ignore generated manual pages --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index bce5b5c..d38870f 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,5 @@ grenache-announce # # Distribution # +*.1 *.tar.* From 458b7223d3a43b0e8915028649574a8d16365c10 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 17 Jul 2018 08:11:58 +0000 Subject: [PATCH 06/50] bump version to 0.7.0 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 797b9be..47378af 100644 --- a/configure.ac +++ b/configure.ac @@ -15,9 +15,9 @@ dnl implied. See the License for the specific language governing permissions dnl and limitations under the License. AC_PREREQ(2.69) -AC_INIT([grenache-cli], [0.6.1], [davide@bitfinex.com]) +AC_INIT([grenache-cli], [0.7.0], [davide@bitfinex.com]) -AC_SUBST([VERSION], [0.6.1]) +AC_SUBST([VERSION], [0.7.0]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) From a0f92bff4965170193033d173fd166c79ce56775 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Wed, 18 Jul 2018 09:18:19 +0000 Subject: [PATCH 07/50] makes man pages generation working even for VPATH builds --- doc/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 824f0d2..d7c9aa7 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -29,4 +29,4 @@ $(dist_man1_MANS) %.1: $(top_srcdir)/src/%.in $(top_srcdir)/doc/Makefile.am $(HELP2MAN) --no-info --output=$@ --version-string="$(PACKAGE_VERSION)" \ --name="manual page for $(notdir $(basename $<)) ($(PACKAGE_NAME)) $(PACKAGE_VERSION) on $(host_cpu)-$(host_os)" \ - "${SHELL} $(basename $<)$(EXEEXT)" + "${SHELL} $(top_builddir)/src/$(notdir $(basename $<))$(EXEEXT)" From c615e088f89da2616e681d5d97752166005df593 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Wed, 18 Jul 2018 09:19:40 +0000 Subject: [PATCH 08/50] makes install-man a recursive target --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 47378af..efad779 100644 --- a/configure.ac +++ b/configure.ac @@ -38,6 +38,7 @@ AC_CONFIG_HEADERS([config.h]) AC_CANONICAL_HOST AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz]) +AM_EXTRA_RECURSIVE_TARGETS([install-man]) AX_IS_RELEASE([git-directory]) AX_CHECK_ENABLE_DEBUG From ebecc883a9bc897e8399beb6af20d18cee719a5a Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Wed, 18 Jul 2018 09:22:46 +0000 Subject: [PATCH 09/50] bump version to 0.7.1 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index efad779..024e4fb 100644 --- a/configure.ac +++ b/configure.ac @@ -15,9 +15,9 @@ dnl implied. See the License for the specific language governing permissions dnl and limitations under the License. AC_PREREQ(2.69) -AC_INIT([grenache-cli], [0.7.0], [davide@bitfinex.com]) +AC_INIT([grenache-cli], [0.7.1], [davide@bitfinex.com]) -AC_SUBST([VERSION], [0.7.0]) +AC_SUBST([VERSION], [0.7.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) From fb6c86ef1d7834d946554f91ae264bc6e98c2ba8 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Mon, 30 Mar 2020 14:03:28 +0000 Subject: [PATCH 10/50] copyright update --- Makefile.am | 2 +- autogen.sh | 2 +- configure.ac | 4 ++-- doc/Makefile.am | 2 +- include/Makefile.am | 2 +- include/common.h | 2 +- include/encode.h | 2 +- include/io.h | 2 +- m4/Makefile.am | 2 +- src/Makefile.am | 2 +- src/encode.c | 2 +- src/grc-keygen.c | 2 +- src/grc-sign.c | 2 +- src/grc-verify.c | 2 +- src/grenache-announce.in | 4 ++-- src/grenache-get.in | 4 ++-- src/grenache-keygen.in | 4 ++-- src/grenache-lookup.in | 4 ++-- src/grenache-put.in | 4 ++-- src/io.c | 2 +- tests/Makefile.am | 2 +- tests/sign-test-vector-1.sh.in | 2 +- tests/sign-test-vector-2.sh.in | 2 +- tests/verify-test-vector-1.sh.in | 2 +- tests/verify-test-vector-2.sh.in | 2 +- 25 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Makefile.am b/Makefile.am index d572472..db2d5f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/autogen.sh b/autogen.sh index 065d654..570ec9a 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/configure.ac b/configure.ac index 024e4fb..a94e15b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl This file is part of Grenache Command Line Interface. dnl -dnl Copyright (C) 2017, 2018 Davide Scola +dnl Copyright (C) 2017, 2018, 2019, 2020 Davide Scola dnl dnl Licensed under the Apache License, Version 2.0 (the "License"); you may dnl not use this file except in compliance with the License. You may obtain @@ -21,7 +21,7 @@ AC_SUBST([VERSION], [0.7.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) -AC_COPYRIGHT([Copyright (c) 2017, 2018 Davide Scola, +AC_COPYRIGHT([Copyright (c) 2017, 2018, 2019, 2020 Davide Scola, This configure script may be copied, distributed and modified under the terms of the Apache License 2.0 license; see LICENSE for more details.]) diff --git a/doc/Makefile.am b/doc/Makefile.am index d7c9aa7..6e24af8 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/Makefile.am b/include/Makefile.am index a202cfc..abdc850 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/common.h b/include/common.h index 5d33120..b7647ab 100644 --- a/include/common.h +++ b/include/common.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/encode.h b/include/encode.h index b118519..723cb17 100644 --- a/include/encode.h +++ b/include/encode.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/io.h b/include/io.h index 0c3ee1f..2b20dbd 100644 --- a/include/io.h +++ b/include/io.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/m4/Makefile.am b/m4/Makefile.am index 187d1bb..81ec7c9 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/Makefile.am b/src/Makefile.am index 31bc212..97fdb7a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/encode.c b/src/encode.c index 7b58c9e..20a6932 100644 --- a/src/encode.c +++ b/src/encode.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-keygen.c b/src/grc-keygen.c index 64bfebe..bb45eb5 100644 --- a/src/grc-keygen.c +++ b/src/grc-keygen.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-sign.c b/src/grc-sign.c index 6ba91e3..d01b469 100644 --- a/src/grc-sign.c +++ b/src/grc-sign.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-verify.c b/src/grc-verify.c index a126d53..438d46b 100644 --- a/src/grc-verify.c +++ b/src/grc-verify.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grenache-announce.in b/src/grenache-announce.in index 8e6c500..7b62b19 100644 --- a/src/grenache-announce.in +++ b/src/grenache-announce.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -62,7 +62,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-get.in b/src/grenache-get.in index b94dba5..9ab7ca9 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -63,7 +63,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-keygen.in b/src/grenache-keygen.in index 6efd3a5..c5b95c5 100644 --- a/src/grenache-keygen.in +++ b/src/grenache-keygen.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -52,7 +52,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-lookup.in b/src/grenache-lookup.in index 0a555b6..e57a4c2 100644 --- a/src/grenache-lookup.in +++ b/src/grenache-lookup.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -67,7 +67,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-put.in b/src/grenache-put.in index 4a2904d..24ad94a 100644 --- a/src/grenache-put.in +++ b/src/grenache-put.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -64,7 +64,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/io.c b/src/io.c index dc4f759..8a1b0b4 100644 --- a/src/io.c +++ b/src/io.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018 Davide Scola + * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/tests/Makefile.am b/tests/Makefile.am index 8a91ede..aac0e2d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-1.sh.in b/tests/sign-test-vector-1.sh.in index 0f73c93..00562cb 100644 --- a/tests/sign-test-vector-1.sh.in +++ b/tests/sign-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-2.sh.in b/tests/sign-test-vector-2.sh.in index e032732..33a54aa 100644 --- a/tests/sign-test-vector-2.sh.in +++ b/tests/sign-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-1.sh.in b/tests/verify-test-vector-1.sh.in index 7bd1dae..0da06c7 100644 --- a/tests/verify-test-vector-1.sh.in +++ b/tests/verify-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-2.sh.in b/tests/verify-test-vector-2.sh.in index c981a3d..0cf6b88 100644 --- a/tests/verify-test-vector-2.sh.in +++ b/tests/verify-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018 Davide Scola # +# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # From 240f5eddf4704c97134e3e99a2191958eff41d40 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 7 Aug 2020 14:05:59 +0000 Subject: [PATCH 11/50] DLLs and test source are no longer included in the dist tarball --- Makefile.am | 6 +++--- src/Makefile.am | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile.am b/Makefile.am index db2d5f1..1c928d2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -29,7 +29,9 @@ EXTRA_DIST = \ LICENSE \ README.md \ autogen.sh \ -shtool +shtool \ +ed25519/readme.md \ +ed25519/license.txt DISTCLEANFILES = \ config.h.in~ @@ -39,8 +41,6 @@ $(DISTCLEANFILES) \ README dist-hook: dist-ChangeLog - cp -fpR $(top_srcdir)/ed25519 $(distdir) - $(RM) -rf $(distdir)/ed25519/.git maintainer-clean-local: maintainer-clean-local-check diff --git a/src/Makefile.am b/src/Makefile.am index 97fdb7a..694594b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -40,12 +40,19 @@ libcommon.la libed25519_la_SOURCES = \ $(top_srcdir)/ed25519/src/add_scalar.c \ +$(top_srcdir)/ed25519/src/ed25519.h \ +$(top_srcdir)/ed25519/src/fe.h \ $(top_srcdir)/ed25519/src/fe.c \ +$(top_srcdir)/ed25519/src/fixedint.h \ +$(top_srcdir)/ed25519/src/ge.h \ $(top_srcdir)/ed25519/src/ge.c \ $(top_srcdir)/ed25519/src/key_exchange.c \ $(top_srcdir)/ed25519/src/keypair.c \ +$(top_srcdir)/ed25519/src/precomp_data.h \ +$(top_srcdir)/ed25519/src/sc.h \ $(top_srcdir)/ed25519/src/sc.c \ $(top_srcdir)/ed25519/src/seed.c \ +$(top_srcdir)/ed25519/src/sha512.h \ $(top_srcdir)/ed25519/src/sha512.c \ $(top_srcdir)/ed25519/src/sign.c \ $(top_srcdir)/ed25519/src/verify.c From 32e07609fbfdf31549f0c2f84da4b0f764266051 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 7 Aug 2020 14:25:08 +0000 Subject: [PATCH 12/50] fix some warnings during autogen --- autogen.sh | 2 +- m4/ax_c99_inline.m4 | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/autogen.sh b/autogen.sh index 570ec9a..1ada915 100755 --- a/autogen.sh +++ b/autogen.sh @@ -26,7 +26,7 @@ case "${1}" in ;; * ) autoreconf --force --install --include 'm4' - [[ -x shtool ]] || shtoolize -q 'echo' [[ -d autom4te.cache ]] && rm -rf autom4te.cache + [[ -x shtool ]] || PERL5OPT='-M-warnings=deprecated' shtoolize -q 'echo' ;; esac diff --git a/m4/ax_c99_inline.m4 b/m4/ax_c99_inline.m4 index 6675e02..aa5b02b 100644 --- a/m4/ax_c99_inline.m4 +++ b/m4/ax_c99_inline.m4 @@ -12,6 +12,10 @@ # and "extern inline" correctly. An application may replace "inline" with # "static inline" as a workaround for older compilers. # +# Note: a slightly modified version by Davide Scola +# - fix a warning with newer versions of autoconf (for more details +# see https://autotools.io/forwardporting/autoconf.html) +# # LICENSE # # Copyright (c) 2009 Michael McMaster @@ -35,10 +39,10 @@ AC_DEFUN([AX_C99_INLINE], [ dnl GCC versions before 4.3 would output the inline functions into all dnl translation units that could require the definition. AC_LINK_IFELSE( - AC_LANG_SOURCE([ + [AC_LANG_SOURCE([ inline void* foo() { foo(); return &foo; } int main() { return foo() != 0;} - ]), + ])], dnl the invalid source compiled, so the inline keyword does not work dnl correctly. @@ -46,10 +50,10 @@ AC_DEFUN([AX_C99_INLINE], [ dnl Secondary test of valid source. AC_LINK_IFELSE( - AC_LANG_SOURCE([ + [AC_LANG_SOURCE([ extern inline void* foo() { foo(); return &foo; } int main() { return foo() != 0;} - ]), + ])], AC_MSG_RESULT([yes]) AC_DEFINE([HAVE_C99_INLINE], [1], From 19650e1d21505dc6ee0e0d4a542dd08d77e0b14f Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 7 Aug 2020 14:43:50 +0000 Subject: [PATCH 13/50] code cleanup --- Makefile.am | 3 +-- include/common.h | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index 1c928d2..082a621 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,8 +37,7 @@ DISTCLEANFILES = \ config.h.in~ MAINTAINERCLEANFILES = \ -$(DISTCLEANFILES) \ -README +$(DISTCLEANFILES) dist-hook: dist-ChangeLog diff --git a/include/common.h b/include/common.h index b7647ab..5f4aa80 100644 --- a/include/common.h +++ b/include/common.h @@ -24,10 +24,10 @@ #ifdef HAVE_C99_INLINE # define INLINE inline #else -# define INLINE static inline +# define INLINE #endif -#ifdef HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE +#if defined(HAVE_C99_INLINE) && defined(HAVE_FUNC_ATTRIBUTE_ALWAYS_INLINE) # define ALWAYS_INLINE __attribute__ ((__always_inline__)) #else # define ALWAYS_INLINE From 2571094ce0940b8d05ee1ffdd703d378aed8931f Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 7 Aug 2020 15:03:38 +0000 Subject: [PATCH 14/50] subdir-objects has been enabled using a workaround for automake (< 1.16) bug#13928 --- configure.ac | 2 +- src/Makefile.am | 34 +++++++++++++++++----------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/configure.ac b/configure.ac index a94e15b..d2ebd60 100644 --- a/configure.ac +++ b/configure.ac @@ -37,7 +37,7 @@ AC_CONFIG_SRCDIR([include/io.h]) AC_CONFIG_HEADERS([config.h]) AC_CANONICAL_HOST -AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz]) +AM_INIT_AUTOMAKE([foreign no-dist-gzip dist-xz subdir-objects]) AM_EXTRA_RECURSIVE_TARGETS([install-man]) AX_IS_RELEASE([git-directory]) diff --git a/src/Makefile.am b/src/Makefile.am index 694594b..b0c64be 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -39,23 +39,23 @@ libcommon.la libed25519_la_SOURCES = \ -$(top_srcdir)/ed25519/src/add_scalar.c \ -$(top_srcdir)/ed25519/src/ed25519.h \ -$(top_srcdir)/ed25519/src/fe.h \ -$(top_srcdir)/ed25519/src/fe.c \ -$(top_srcdir)/ed25519/src/fixedint.h \ -$(top_srcdir)/ed25519/src/ge.h \ -$(top_srcdir)/ed25519/src/ge.c \ -$(top_srcdir)/ed25519/src/key_exchange.c \ -$(top_srcdir)/ed25519/src/keypair.c \ -$(top_srcdir)/ed25519/src/precomp_data.h \ -$(top_srcdir)/ed25519/src/sc.h \ -$(top_srcdir)/ed25519/src/sc.c \ -$(top_srcdir)/ed25519/src/seed.c \ -$(top_srcdir)/ed25519/src/sha512.h \ -$(top_srcdir)/ed25519/src/sha512.c \ -$(top_srcdir)/ed25519/src/sign.c \ -$(top_srcdir)/ed25519/src/verify.c +../ed25519/src/add_scalar.c \ +../ed25519/src/ed25519.h \ +../ed25519/src/fe.h \ +../ed25519/src/fe.c \ +../ed25519/src/fixedint.h \ +../ed25519/src/ge.h \ +../ed25519/src/ge.c \ +../ed25519/src/key_exchange.c \ +../ed25519/src/keypair.c \ +../ed25519/src/precomp_data.h \ +../ed25519/src/sc.h \ +../ed25519/src/sc.c \ +../ed25519/src/seed.c \ +../ed25519/src/sha512.h \ +../ed25519/src/sha512.c \ +../ed25519/src/sign.c \ +../ed25519/src/verify.c libcommon_la_SOURCES = \ From ccdf35a08c8f79abb0c7e0f1181121791ec78f28 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 3 Dec 2021 14:36:58 +0000 Subject: [PATCH 15/50] "Copying" paragraph has been added --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index fc8e216..d98b0d6 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ * [Introduction](#introduction) + * [Copying](#copying) * [Prerequisites](#prerequisites) * [Install](#install) * [Initialize](#initialize) @@ -27,6 +28,13 @@ The [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface is a set of tools to use the [grenache-grape](https://github.com/bitfinexcom/grenache-grape) suite directly from your command line. Using this set of tools you can create fancy scripts that communicate directly with the DHT. +## Copying + +The [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface is free software. See the files whose names start with _LICENSE_ (case-insensitive) for copying permission. The manuals, and some of the runtime libraries, are under different terms; see the individual source files for details. + +Copyright years on [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface source files may be listed using range notation, e.g., 2017-2021, indicating that every year in the range, inclusive, is a copyrightable year that could otherwise be listed individually. + + ## Prerequisites Be sure that your version of [grenache-grape](https://github.com/bitfinexcom/grenache-grape) supports the mutable items (see pull request [#35](https://github.com/bitfinexcom/grenache-grape/pull/35)). From 7d2a2e67dc87034d6c7f8a9a9932dca296ebeb2f Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 3 Dec 2021 14:39:24 +0000 Subject: [PATCH 16/50] copyright update --- Makefile.am | 2 +- autogen.sh | 2 +- configure.ac | 4 ++-- doc/Makefile.am | 2 +- include/Makefile.am | 2 +- include/common.h | 2 +- include/encode.h | 2 +- include/io.h | 2 +- m4/Makefile.am | 2 +- src/Makefile.am | 2 +- src/encode.c | 2 +- src/grc-keygen.c | 2 +- src/grc-sign.c | 2 +- src/grc-verify.c | 2 +- src/grenache-announce.in | 4 ++-- src/grenache-get.in | 4 ++-- src/grenache-keygen.in | 4 ++-- src/grenache-lookup.in | 4 ++-- src/grenache-put.in | 4 ++-- src/io.c | 2 +- tests/Makefile.am | 2 +- tests/sign-test-vector-1.sh.in | 2 +- tests/sign-test-vector-2.sh.in | 2 +- tests/verify-test-vector-1.sh.in | 2 +- tests/verify-test-vector-2.sh.in | 2 +- 25 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Makefile.am b/Makefile.am index 082a621..181522b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/autogen.sh b/autogen.sh index 1ada915..c03762c 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/configure.ac b/configure.ac index d2ebd60..dbb558b 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl This file is part of Grenache Command Line Interface. dnl -dnl Copyright (C) 2017, 2018, 2019, 2020 Davide Scola +dnl Copyright (C) 2017-2021 Davide Scola dnl dnl Licensed under the Apache License, Version 2.0 (the "License"); you may dnl not use this file except in compliance with the License. You may obtain @@ -21,7 +21,7 @@ AC_SUBST([VERSION], [0.7.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) -AC_COPYRIGHT([Copyright (c) 2017, 2018, 2019, 2020 Davide Scola, +AC_COPYRIGHT([Copyright (c) 2017-2021 Davide Scola, This configure script may be copied, distributed and modified under the terms of the Apache License 2.0 license; see LICENSE for more details.]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 6e24af8..e663c05 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/Makefile.am b/include/Makefile.am index abdc850..17125ba 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/common.h b/include/common.h index 5f4aa80..a0a71c8 100644 --- a/include/common.h +++ b/include/common.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/encode.h b/include/encode.h index 723cb17..dd43daa 100644 --- a/include/encode.h +++ b/include/encode.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/io.h b/include/io.h index 2b20dbd..82e58a8 100644 --- a/include/io.h +++ b/include/io.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/m4/Makefile.am b/m4/Makefile.am index 81ec7c9..51a300d 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/Makefile.am b/src/Makefile.am index b0c64be..1a1bea0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/encode.c b/src/encode.c index 20a6932..8150c34 100644 --- a/src/encode.c +++ b/src/encode.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-keygen.c b/src/grc-keygen.c index bb45eb5..4221e53 100644 --- a/src/grc-keygen.c +++ b/src/grc-keygen.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-sign.c b/src/grc-sign.c index d01b469..d44778a 100644 --- a/src/grc-sign.c +++ b/src/grc-sign.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-verify.c b/src/grc-verify.c index 438d46b..4811b96 100644 --- a/src/grc-verify.c +++ b/src/grc-verify.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grenache-announce.in b/src/grenache-announce.in index 7b62b19..8a1b0b1 100644 --- a/src/grenache-announce.in +++ b/src/grenache-announce.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -62,7 +62,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-get.in b/src/grenache-get.in index 9ab7ca9..7d85440 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -63,7 +63,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-keygen.in b/src/grenache-keygen.in index c5b95c5..0b423b3 100644 --- a/src/grenache-keygen.in +++ b/src/grenache-keygen.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -52,7 +52,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-lookup.in b/src/grenache-lookup.in index e57a4c2..927d0b3 100644 --- a/src/grenache-lookup.in +++ b/src/grenache-lookup.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -67,7 +67,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-put.in b/src/grenache-put.in index 24ad94a..2e80193 100644 --- a/src/grenache-put.in +++ b/src/grenache-put.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -64,7 +64,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017, 2018, 2019, 2020 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/io.c b/src/io.c index 8a1b0b4..18b9585 100644 --- a/src/io.c +++ b/src/io.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017, 2018, 2019, 2020 Davide Scola + * Copyright (C) 2017-2021 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/tests/Makefile.am b/tests/Makefile.am index aac0e2d..019db4f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-1.sh.in b/tests/sign-test-vector-1.sh.in index 00562cb..36cd297 100644 --- a/tests/sign-test-vector-1.sh.in +++ b/tests/sign-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-2.sh.in b/tests/sign-test-vector-2.sh.in index 33a54aa..87fac61 100644 --- a/tests/sign-test-vector-2.sh.in +++ b/tests/sign-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-1.sh.in b/tests/verify-test-vector-1.sh.in index 0da06c7..26a5e4e 100644 --- a/tests/verify-test-vector-1.sh.in +++ b/tests/verify-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-2.sh.in b/tests/verify-test-vector-2.sh.in index 0cf6b88..014aee1 100644 --- a/tests/verify-test-vector-2.sh.in +++ b/tests/verify-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017, 2018, 2019, 2020 Davide Scola # +# Copyright (C) 2017-2021 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # From 111763e489b63f3e1506f186b42abcb80082e27b Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 8 Nov 2022 10:35:57 +0000 Subject: [PATCH 17/50] copyright update --- Makefile.am | 2 +- autogen.sh | 2 +- configure.ac | 4 ++-- doc/Makefile.am | 2 +- include/Makefile.am | 2 +- include/common.h | 2 +- include/encode.h | 2 +- include/io.h | 2 +- m4/Makefile.am | 2 +- src/Makefile.am | 2 +- src/encode.c | 2 +- src/grc-keygen.c | 2 +- src/grc-sign.c | 2 +- src/grc-verify.c | 2 +- src/grenache-announce.in | 4 ++-- src/grenache-get.in | 4 ++-- src/grenache-keygen.in | 4 ++-- src/grenache-lookup.in | 4 ++-- src/grenache-put.in | 4 ++-- src/io.c | 2 +- tests/Makefile.am | 2 +- tests/sign-test-vector-1.sh.in | 2 +- tests/sign-test-vector-2.sh.in | 2 +- tests/verify-test-vector-1.sh.in | 2 +- tests/verify-test-vector-2.sh.in | 2 +- 25 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Makefile.am b/Makefile.am index 181522b..b2e739a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/autogen.sh b/autogen.sh index c03762c..7aa46ce 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/configure.ac b/configure.ac index dbb558b..1c234e1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl This file is part of Grenache Command Line Interface. dnl -dnl Copyright (C) 2017-2021 Davide Scola +dnl Copyright (C) 2017-2022 Davide Scola dnl dnl Licensed under the Apache License, Version 2.0 (the "License"); you may dnl not use this file except in compliance with the License. You may obtain @@ -21,7 +21,7 @@ AC_SUBST([VERSION], [0.7.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) -AC_COPYRIGHT([Copyright (c) 2017-2021 Davide Scola, +AC_COPYRIGHT([Copyright (c) 2017-2022 Davide Scola, This configure script may be copied, distributed and modified under the terms of the Apache License 2.0 license; see LICENSE for more details.]) diff --git a/doc/Makefile.am b/doc/Makefile.am index e663c05..89728c1 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/Makefile.am b/include/Makefile.am index 17125ba..18e7b66 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/common.h b/include/common.h index a0a71c8..829c92d 100644 --- a/include/common.h +++ b/include/common.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/encode.h b/include/encode.h index dd43daa..e29682f 100644 --- a/include/encode.h +++ b/include/encode.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/io.h b/include/io.h index 82e58a8..69be281 100644 --- a/include/io.h +++ b/include/io.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/m4/Makefile.am b/m4/Makefile.am index 51a300d..ab4cfa4 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/Makefile.am b/src/Makefile.am index 1a1bea0..0c38477 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/encode.c b/src/encode.c index 8150c34..76ee6a0 100644 --- a/src/encode.c +++ b/src/encode.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-keygen.c b/src/grc-keygen.c index 4221e53..74eb18e 100644 --- a/src/grc-keygen.c +++ b/src/grc-keygen.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-sign.c b/src/grc-sign.c index d44778a..8500eb7 100644 --- a/src/grc-sign.c +++ b/src/grc-sign.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-verify.c b/src/grc-verify.c index 4811b96..bc8fce0 100644 --- a/src/grc-verify.c +++ b/src/grc-verify.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grenache-announce.in b/src/grenache-announce.in index 8a1b0b1..169f0b6 100644 --- a/src/grenache-announce.in +++ b/src/grenache-announce.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -62,7 +62,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-get.in b/src/grenache-get.in index 7d85440..88facc3 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -63,7 +63,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-keygen.in b/src/grenache-keygen.in index 0b423b3..adbfc23 100644 --- a/src/grenache-keygen.in +++ b/src/grenache-keygen.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -52,7 +52,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-lookup.in b/src/grenache-lookup.in index 927d0b3..2c2ba3f 100644 --- a/src/grenache-lookup.in +++ b/src/grenache-lookup.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -67,7 +67,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-put.in b/src/grenache-put.in index 2e80193..e718175 100644 --- a/src/grenache-put.in +++ b/src/grenache-put.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -64,7 +64,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2021 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/io.c b/src/io.c index 18b9585..8329f1b 100644 --- a/src/io.c +++ b/src/io.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2021 Davide Scola + * Copyright (C) 2017-2022 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/tests/Makefile.am b/tests/Makefile.am index 019db4f..2ac3ec3 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-1.sh.in b/tests/sign-test-vector-1.sh.in index 36cd297..dd4b093 100644 --- a/tests/sign-test-vector-1.sh.in +++ b/tests/sign-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-2.sh.in b/tests/sign-test-vector-2.sh.in index 87fac61..51a08eb 100644 --- a/tests/sign-test-vector-2.sh.in +++ b/tests/sign-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-1.sh.in b/tests/verify-test-vector-1.sh.in index 26a5e4e..2ef0507 100644 --- a/tests/verify-test-vector-1.sh.in +++ b/tests/verify-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-2.sh.in b/tests/verify-test-vector-2.sh.in index 014aee1..3342aea 100644 --- a/tests/verify-test-vector-2.sh.in +++ b/tests/verify-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2021 Davide Scola # +# Copyright (C) 2017-2022 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # From cb329ee6522757f5c63f6a40ca42d36b586daa8c Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 09:57:56 +0000 Subject: [PATCH 18/50] just a license change of some M4 macros updated to the latest version available --- m4/ax_append_compile_flags.m4 | 31 +++++-------------------------- m4/ax_append_flag.m4 | 31 +++++-------------------------- m4/ax_append_link_flags.m4 | 31 +++++-------------------------- m4/ax_check_compile_flag.m4 | 31 +++++-------------------------- m4/ax_check_link_flag.m4 | 31 +++++-------------------------- 5 files changed, 25 insertions(+), 130 deletions(-) diff --git a/m4/ax_append_compile_flags.m4 b/m4/ax_append_compile_flags.m4 index 5b6f1af..9c85635 100644 --- a/m4/ax_append_compile_flags.m4 +++ b/m4/ax_append_compile_flags.m4 @@ -30,33 +30,12 @@ # # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 6 +#serial 7 AC_DEFUN([AX_APPEND_COMPILE_FLAGS], [AX_REQUIRE_DEFINED([AX_CHECK_COMPILE_FLAG]) diff --git a/m4/ax_append_flag.m4 b/m4/ax_append_flag.m4 index e8c5312..dd6d8b6 100644 --- a/m4/ax_append_flag.m4 +++ b/m4/ax_append_flag.m4 @@ -23,33 +23,12 @@ # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 7 +#serial 8 AC_DEFUN([AX_APPEND_FLAG], [dnl diff --git a/m4/ax_append_link_flags.m4 b/m4/ax_append_link_flags.m4 index 6f7f174..99b9fa5 100644 --- a/m4/ax_append_link_flags.m4 +++ b/m4/ax_append_link_flags.m4 @@ -28,33 +28,12 @@ # # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 6 +#serial 7 AC_DEFUN([AX_APPEND_LINK_FLAGS], [AX_REQUIRE_DEFINED([AX_CHECK_LINK_FLAG]) diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 index dcabb92..bd753b3 100644 --- a/m4/ax_check_compile_flag.m4 +++ b/m4/ax_check_compile_flag.m4 @@ -29,33 +29,12 @@ # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 5 +#serial 6 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF diff --git a/m4/ax_check_link_flag.m4 b/m4/ax_check_link_flag.m4 index 819409a..03a30ce 100644 --- a/m4/ax_check_link_flag.m4 +++ b/m4/ax_check_link_flag.m4 @@ -29,33 +29,12 @@ # Copyright (c) 2008 Guido U. Draheim # Copyright (c) 2011 Maarten Bosmans # -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. -#serial 5 +#serial 6 AC_DEFUN([AX_CHECK_LINK_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF From 886bdda0c05dbcbe4a9d2c1717cb63581849cbb2 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 09:58:32 +0000 Subject: [PATCH 19/50] the M4 macro "AX_CHECK_ENABLE_DEBUG" has been updated to the latest version available --- m4/ax_check_enable_debug.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/ax_check_enable_debug.m4 b/m4/ax_check_enable_debug.m4 index d36bcdf..7bc7710 100644 --- a/m4/ax_check_enable_debug.m4 +++ b/m4/ax_check_enable_debug.m4 @@ -42,7 +42,7 @@ # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. -#serial 8 +#serial 9 AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[ AC_BEFORE([$0],[AC_PROG_CC])dnl @@ -118,7 +118,7 @@ AC_DEFUN([AX_CHECK_ENABLE_DEBUG],[ dnl Define various variables if debugging is disabled. dnl assert.h is a NOP if NDEBUG is defined, so define it by default. AS_IF([test "x$enable_debug" = "xyes"], - [m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is enabled])])], - [m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,,[Define if debugging is disabled])])]) + [m4_map_args_w(ax_enable_debug_vars, [AC_DEFINE(], [,[1],[Define if debugging is enabled])])], + [m4_map_args_w(ax_disable_debug_vars, [AC_DEFINE(], [,[1],[Define if debugging is disabled])])]) ax_enable_debug=$enable_debug ]) From 9662c5c9310909b066ab83e7af84d33ccd80adf9 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 09:59:03 +0000 Subject: [PATCH 20/50] the M4 macro "AX_COMPILER_FLAGS_CFLAGS" has been updated to the latest version available --- m4/ax_compiler_flags_cflags.m4 | 35 +++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/m4/ax_compiler_flags_cflags.m4 b/m4/ax_compiler_flags_cflags.m4 index aeb16e3..916f918 100644 --- a/m4/ax_compiler_flags_cflags.m4 +++ b/m4/ax_compiler_flags_cflags.m4 @@ -19,13 +19,14 @@ # LICENSE # # Copyright (c) 2014, 2015 Philip Withnall +# Copyright (c) 2017, 2018 Reini Urban # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 14 +#serial 17 AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[ AC_REQUIRE([AC_PROG_SED]) @@ -39,6 +40,13 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[ AC_LANG_PUSH([C]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ + [#ifndef __cplusplus + #error "no C++" + #endif]])], + [ax_compiler_cxx=yes;], + [ax_compiler_cxx=no;]) + # Always pass -Werror=unknown-warning-option to get Clang to fail on bad # flags, otherwise they are always appended to the warn_cflags variable, and # Clang warns on them for every compilation unit. @@ -64,23 +72,31 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[ ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) AS_IF([test "$ax_enable_compile_warnings" != "no"],[ + if test "$ax_compiler_cxx" = "no" ; then + # C-only flags. Warn in C++ + AX_APPEND_COMPILE_FLAGS([ dnl + -Wnested-externs dnl + -Wmissing-prototypes dnl + -Wstrict-prototypes dnl + -Wdeclaration-after-statement dnl + -Wimplicit-function-declaration dnl + -Wold-style-definition dnl + -Wjump-misses-init dnl + ],ax_warn_cflags_variable,[$ax_compiler_flags_test]) + fi + # "yes" flags AX_APPEND_COMPILE_FLAGS([ dnl -Wall dnl -Wextra dnl -Wundef dnl - -Wnested-externs dnl -Wwrite-strings dnl -Wpointer-arith dnl -Wmissing-declarations dnl - -Wmissing-prototypes dnl - -Wstrict-prototypes dnl -Wredundant-decls dnl -Wno-unused-parameter dnl -Wno-missing-field-initializers dnl - -Wdeclaration-after-statement dnl -Wformat=2 dnl - -Wold-style-definition dnl -Wcast-align dnl -Wformat-nonliteral dnl -Wformat-security dnl @@ -96,10 +112,15 @@ AC_DEFUN([AX_COMPILER_FLAGS_CFLAGS],[ -Wmissing-include-dirs dnl -Wunused-but-set-variable dnl -Warray-bounds dnl - -Wimplicit-function-declaration dnl -Wreturn-type dnl -Wswitch-enum dnl -Wswitch-default dnl + -Wduplicated-cond dnl + -Wduplicated-branches dnl + -Wlogical-op dnl + -Wrestrict dnl + -Wnull-dereference dnl + -Wdouble-promotion dnl $4 dnl $5 dnl $6 dnl From fe4c2d771b7f05d6dc787aaccd6315e07947657f Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 09:59:39 +0000 Subject: [PATCH 21/50] the M4 macro "AX_COMPILER_FLAGS_LDFLAGS" has been updated to the latest version available --- m4/ax_compiler_flags_ldflags.m4 | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/m4/ax_compiler_flags_ldflags.m4 b/m4/ax_compiler_flags_ldflags.m4 index 842e329..976d119 100644 --- a/m4/ax_compiler_flags_ldflags.m4 +++ b/m4/ax_compiler_flags_ldflags.m4 @@ -19,13 +19,14 @@ # LICENSE # # Copyright (c) 2014, 2015 Philip Withnall +# Copyright (c) 2017, 2018 Reini Urban # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 8 +#serial 9 AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[ AX_REQUIRE_DEFINED([AX_APPEND_LINK_FLAGS]) @@ -48,7 +49,25 @@ AC_DEFUN([AX_COMPILER_FLAGS_LDFLAGS],[ ax_compiler_flags_test="" ]) - # macOS linker does not have --as-needed + AX_CHECK_LINK_FLAG([-Wl,--as-needed], [ + AX_APPEND_LINK_FLAGS([-Wl,--as-needed], + [AM_LDFLAGS],[$ax_compiler_flags_test]) + ]) + AX_CHECK_LINK_FLAG([-Wl,-z,relro], [ + AX_APPEND_LINK_FLAGS([-Wl,-z,relro], + [AM_LDFLAGS],[$ax_compiler_flags_test]) + ]) + AX_CHECK_LINK_FLAG([-Wl,-z,now], [ + AX_APPEND_LINK_FLAGS([-Wl,-z,now], + [AM_LDFLAGS],[$ax_compiler_flags_test]) + ]) + AX_CHECK_LINK_FLAG([-Wl,-z,noexecstack], [ + AX_APPEND_LINK_FLAGS([-Wl,-z,noexecstack], + [AM_LDFLAGS],[$ax_compiler_flags_test]) + ]) + # textonly, retpolineplt not yet + + # macOS and cygwin linker do not have --as-needed AX_CHECK_LINK_FLAG([-Wl,--no-as-needed], [ ax_compiler_flags_as_needed_option="-Wl,--no-as-needed" ], [ From 96e8d9b632640c8fb456c9172d0848ca55c99de6 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 10:00:24 +0000 Subject: [PATCH 22/50] the M4 macro "AX_COMPILER_VENDOR" has been updated to the latest version available --- m4/ax_compiler_vendor.m4 | 120 +++++++++++++++++++++++++-------------- 1 file changed, 76 insertions(+), 44 deletions(-) diff --git a/m4/ax_compiler_vendor.m4 b/m4/ax_compiler_vendor.m4 index 4ca8089..039f99d 100644 --- a/m4/ax_compiler_vendor.m4 +++ b/m4/ax_compiler_vendor.m4 @@ -8,15 +8,30 @@ # # DESCRIPTION # -# Determine the vendor of the C/C++ compiler, e.g., gnu, intel, ibm, sun, -# hp, borland, comeau, dec, cray, kai, lcc, metrowerks, sgi, microsoft, -# watcom, etc. The vendor is returned in the cache variable -# $ax_cv_c_compiler_vendor for C and $ax_cv_cxx_compiler_vendor for C++. +# Determine the vendor of the C, C++ or Fortran compiler. The vendor is +# returned in the cache variable $ax_cv_c_compiler_vendor for C, +# $ax_cv_cxx_compiler_vendor for C++ or $ax_cv_fc_compiler_vendor for +# (modern) Fortran. The value is one of "intel", "ibm", "pathscale", +# "clang" (LLVM), "cray", "fujitsu", "sdcc", "sx", "nvhpc" (NVIDIA HPC +# Compiler), "portland" (PGI), "gnu" (GCC), "sun" (Oracle Developer +# Studio), "hp", "dec", "borland", "comeau", "kai", "lcc", "sgi", +# "microsoft", "metrowerks", "watcom", "tcc" (Tiny CC) or "unknown" (if +# the compiler cannot be determined). +# +# To check for a Fortran compiler, you must first call AC_FC_PP_SRCEXT +# with an appropriate preprocessor-enabled extension. For example: +# +# AC_LANG_PUSH([Fortran]) +# AC_PROG_FC +# AC_FC_PP_SRCEXT([F]) +# AX_COMPILER_VENDOR +# AC_LANG_POP([Fortran]) # # LICENSE # # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo +# Copyright (c) 2018-19 John Zaitseff # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -44,44 +59,61 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 16 +#serial 32 + +AC_DEFUN([AX_COMPILER_VENDOR], [dnl + AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, [dnl + dnl If you modify this list of vendors, please add similar support + dnl to ax_compiler_version.m4 if at all possible. + dnl + dnl Note: Do NOT check for GCC first since some other compilers + dnl define __GNUC__ to remain compatible with it. Compilers that + dnl are very slow to start (such as Intel) are listed first. + + vendors=" + intel: __ICC,__ECC,__INTEL_COMPILER + ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__,__ibmxl__ + pathscale: __PATHCC__,__PATHSCALE__ + clang: __clang__ + cray: _CRAYC + fujitsu: __FUJITSU + sdcc: SDCC,__SDCC + sx: _SX + nvhpc: __NVCOMPILER + portland: __PGI + gnu: __GNUC__ + sun: __SUNPRO_C,__SUNPRO_CC,__SUNPRO_F90,__SUNPRO_F95 + hp: __HP_cc,__HP_aCC + dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER + borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ + comeau: __COMO__ + kai: __KCC + lcc: __LCC__ + sgi: __sgi,sgi + microsoft: _MSC_VER + metrowerks: __MWERKS__ + watcom: __WATCOMC__ + tcc: __TINYC__ + unknown: UNKNOWN + " + for ventest in $vendors; do + case $ventest in + *:) + vendor=$ventest + continue + ;; + *) + vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" + ;; + esac + + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[ +#if !($vencpp) + thisisanerror; +#endif + ]])], [break]) + done -AC_DEFUN([AX_COMPILER_VENDOR], -[AC_CACHE_CHECK([for _AC_LANG compiler vendor], ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor, - dnl Please add if possible support to ax_compiler_version.m4 - [# note: don't check for gcc first since some other compilers define __GNUC__ - vendors="intel: __ICC,__ECC,__INTEL_COMPILER - ibm: __xlc__,__xlC__,__IBMC__,__IBMCPP__ - pathscale: __PATHCC__,__PATHSCALE__ - clang: __clang__ - cray: _CRAYC - fujitsu: __FUJITSU - gnu: __GNUC__ - sun: __SUNPRO_C,__SUNPRO_CC - hp: __HP_cc,__HP_aCC - dec: __DECC,__DECCXX,__DECC_VER,__DECCXX_VER - borland: __BORLANDC__,__CODEGEARC__,__TURBOC__ - comeau: __COMO__ - kai: __KCC - lcc: __LCC__ - sgi: __sgi,sgi - microsoft: _MSC_VER - metrowerks: __MWERKS__ - watcom: __WATCOMC__ - portland: __PGI - tcc: __TINYC__ - unknown: UNKNOWN" - for ventest in $vendors; do - case $ventest in - *:) vendor=$ventest; continue ;; - *) vencpp="defined("`echo $ventest | sed 's/,/) || defined(/g'`")" ;; - esac - AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[ - #if !($vencpp) - thisisanerror; - #endif - ])], [break]) - done - ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` - ]) -]) + ax_cv_[]_AC_LANG_ABBREV[]_compiler_vendor=`echo $vendor | cut -d: -f1` + ]) +])dnl From ef6c65f019eaee25676668c6fff6d5c42da45d4a Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 10:00:56 +0000 Subject: [PATCH 23/50] the M4 macro "AX_GCC_ARCHFLAG" has been updated to the latest version available --- m4/ax_gcc_archflag.m4 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/m4/ax_gcc_archflag.m4 b/m4/ax_gcc_archflag.m4 index d4a37f8..c52b9b2 100644 --- a/m4/ax_gcc_archflag.m4 +++ b/m4/ax_gcc_archflag.m4 @@ -37,7 +37,7 @@ # Copyright (c) 2008 Steven G. Johnson # Copyright (c) 2008 Matteo Frigo # Copyright (c) 2014 Tsukasa Oi -# Copyright (c) 2017 Alexey Kopytov +# Copyright (c) 2017-2018 Alexey Kopytov # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the @@ -65,7 +65,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 20 +#serial 22 AC_DEFUN([AX_GCC_ARCHFLAG], [AC_REQUIRE([AC_PROG_CC]) @@ -108,7 +108,7 @@ case $host_cpu in *2?6[[ad]]?:*:*:*) ax_gcc_arch="sandybridge corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[[ae]]?:*:*:*) ax_gcc_arch="ivybridge core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *3?6[[cf]]?:*:*:*|*4?6[[56]]?:*:*:*) ax_gcc_arch="haswell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; - *3?6d?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; + *3?6d?:*:*:*|*4?6[[7f]]?:*:*:*|*5?66?:*:*:*) ax_gcc_arch="broadwell core-avx2 core-avx-i corei7-avx corei7 core2 pentium-m pentium3 pentiumpro" ;; *1?6c?:*:*:*|*2?6[[67]]?:*:*:*|*3?6[[56]]?:*:*:*) ax_gcc_arch="bonnell atom core2 pentium-m pentium3 pentiumpro" ;; *3?67?:*:*:*|*[[45]]?6[[ad]]?:*:*:*) ax_gcc_arch="silvermont atom core2 pentium-m pentium3 pentiumpro" ;; *000?f[[012]]?:*:*:*|?f[[012]]?:*:*:*|f[[012]]?:*:*:*) ax_gcc_arch="pentium4 pentiumpro" ;; @@ -198,6 +198,10 @@ case $host_cpu in *POWER4*|*power4*|*gq*) ax_gcc_arch="power4 970";; *POWER5*|*power5*|*gr*|*gs*) ax_gcc_arch="power5 power4 970";; 603ev|8240) ax_gcc_arch="$cputype 603e 603";; + *POWER7*) ax_gcc_arch="power7";; + *POWER8*) ax_gcc_arch="power8";; + *POWER9*) ax_gcc_arch="power9";; + *POWER10*) ax_gcc_arch="power10";; *) ax_gcc_arch=$cputype ;; esac ax_gcc_arch="$ax_gcc_arch powerpc" From 315434b2e60256ba69713fbe8137b21f6b018dc7 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 10:01:29 +0000 Subject: [PATCH 24/50] the M4 macro "AX_GCC_FUNC_ATTRIBUTE" has been updated to the latest version available --- m4/ax_gcc_func_attribute.m4 | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/m4/ax_gcc_func_attribute.m4 b/m4/ax_gcc_func_attribute.m4 index 077962f..fa4e089 100644 --- a/m4/ax_gcc_func_attribute.m4 +++ b/m4/ax_gcc_func_attribute.m4 @@ -38,9 +38,11 @@ # dllimport # error # externally_visible +# fallthrough # flatten # format # format_arg +# gnu_format # gnu_inline # hot # ifunc @@ -53,6 +55,8 @@ # nothrow # optimize # pure +# sentinel +# sentinel_position # unused # used # visibility @@ -74,7 +78,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 7 +#serial 13 AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ AS_VAR_PUSHDEF([ac_var], [ax_cv_have_func_attribute_$1]) @@ -128,12 +132,18 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ [externally_visible], [ int foo( void ) __attribute__(($1)); ], + [fallthrough], [ + void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }}; + ], [flatten], [ int foo( void ) __attribute__(($1)); ], [format], [ int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); ], + [gnu_format], [ + int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2))); + ], [format_arg], [ char *foo(const char *p) __attribute__(($1(1))); ], @@ -175,6 +185,12 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ [pure], [ int foo( void ) __attribute__(($1)); ], + [sentinel], [ + int foo(void *p, ...) __attribute__(($1)); + ], + [sentinel_position], [ + int foo(void *p, ...) __attribute__(($1(1))); + ], [returns_nonnull], [ void *foo( void ) __attribute__(($1)); ], @@ -212,7 +228,7 @@ AC_DEFUN([AX_GCC_FUNC_ATTRIBUTE], [ dnl GCC doesn't exit with an error if an unknown attribute is dnl provided but only outputs a warning, so accept the attribute dnl only if no warning were issued. - [AS_IF([test -s conftest.err], + [AS_IF([grep -- -Wattributes conftest.err], [AS_VAR_SET([ac_var], [no])], [AS_VAR_SET([ac_var], [yes])])], [AS_VAR_SET([ac_var], [no])]) From db7f2f26074fb4ed8eef6e502a65257d3ae08b6e Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 10:02:06 +0000 Subject: [PATCH 25/50] the M4 macro "AX_GCC_X86_CPU_SUPPORTS" has been updated to the latest version available --- m4/ax_gcc_x86_cpu_supports.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m4/ax_gcc_x86_cpu_supports.m4 b/m4/ax_gcc_x86_cpu_supports.m4 index fd37b4f..f48bc2c 100644 --- a/m4/ax_gcc_x86_cpu_supports.m4 +++ b/m4/ax_gcc_x86_cpu_supports.m4 @@ -57,7 +57,7 @@ # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. -#serial 3 +#serial 4 AC_DEFUN_ONCE([_AX_GCC_X86_CPU_INIT], [AC_LANG_PUSH([C]) @@ -69,6 +69,7 @@ AC_DEFUN_ONCE([_AX_GCC_X86_CPU_INIT], ], [ax_cv_gcc_check_x86_cpu_init=yes], [ax_cv_gcc_check_x86_cpu_init=no])]) + AC_LANG_POP([C]) AS_IF([test "X$ax_cv_gcc_check_x86_cpu_init" = "Xno"], [AC_MSG_ERROR([Need GCC to support X86 CPU features tests])]) ]) From 2115e41e10af48d1435c55969c1aeb6e040528e1 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 10:02:38 +0000 Subject: [PATCH 26/50] the M4 macro "AX_IS_RELEASE" has been updated to the latest version available --- m4/ax_is_release.m4 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/m4/ax_is_release.m4 b/m4/ax_is_release.m4 index 9097ddb..3a62609 100644 --- a/m4/ax_is_release.m4 +++ b/m4/ax_is_release.m4 @@ -19,7 +19,8 @@ # The POLICY parameter specifies how ax_is_release is determined. It can # take the following values: # -# * git-directory: ax_is_release will be 'no' if a '.git' directory exists +# * git-directory: ax_is_release will be 'no' if a '.git' +# directory or git worktree exists # * minor-version: ax_is_release will be 'no' if the minor version number # in $PACKAGE_VERSION is odd; this assumes # $PACKAGE_VERSION follows the 'major.minor.micro' scheme @@ -44,7 +45,7 @@ # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. -#serial 7 +#serial 8 AC_DEFUN([AX_IS_RELEASE],[ AC_BEFORE([AC_INIT],[$0]) @@ -52,7 +53,7 @@ AC_DEFUN([AX_IS_RELEASE],[ m4_case([$1], [git-directory],[ # $is_release = (.git directory does not exist) - AS_IF([test -d ${srcdir}/.git],[ax_is_release=no],[ax_is_release=yes]) + AS_IF([test -d ${srcdir}/.git || (test -f ${srcdir}/.git && grep \.git/worktrees ${srcdir}/.git)],[ax_is_release=no],[ax_is_release=yes]) ], [minor-version],[ # $is_release = ($minor_version is even) From 7e2895408a161f52d144f036c26ae730b4503b9a Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 14:35:39 +0000 Subject: [PATCH 27/50] also check "stdint.h" and "select" used by the "ed25519" library --- configure.ac | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 1c234e1..a410789 100644 --- a/configure.ac +++ b/configure.ac @@ -14,8 +14,8 @@ dnl WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or dnl implied. See the License for the specific language governing permissions dnl and limitations under the License. -AC_PREREQ(2.69) -AC_INIT([grenache-cli], [0.7.1], [davide@bitfinex.com]) +AC_PREREQ([2.69]) +AC_INIT([grenache-cli],[0.7.1],[davide@bitfinex.com]) AC_SUBST([VERSION], [0.7.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) @@ -105,7 +105,7 @@ AX_MSG_BOLD([Checking for required header files]) AC_HEADER_STDC AC_CHECK_HEADERS([sys/random.h]) -AC_CHECK_HEADERS([fcntl.h unistd.h], [], [ +AC_CHECK_HEADERS([fcntl.h stdint.h unistd.h], [], [ AC_MSG_ERROR([missing $ac_header vital header file]) ]) @@ -135,7 +135,7 @@ AC_CHECK_FUNCS([getentropy], [ CPPFLAGS="-DED25519_NO_SEED ${CPPFLAGS}" ]) -AC_CHECK_FUNCS([explicit_bzero], [], [ +AC_CHECK_FUNCS([explicit_bzero select], [], [ AC_MSG_ERROR([missing $ac_func vital function]) ]) From 1944ff185f27c94872c88bffe7be24b0004d1e47 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 14:39:22 +0000 Subject: [PATCH 28/50] prevent warnings for the "AX_GCC_X86_CPU_SUPPORTS" macro when using newer versions of autoconf --- m4/ax_gcc_x86_cpu_supports.m4 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/m4/ax_gcc_x86_cpu_supports.m4 b/m4/ax_gcc_x86_cpu_supports.m4 index f48bc2c..12119ad 100644 --- a/m4/ax_gcc_x86_cpu_supports.m4 +++ b/m4/ax_gcc_x86_cpu_supports.m4 @@ -27,6 +27,10 @@ # See also AX_CHECK_X86_FEATURES, which checks all the possible # instruction set and export the corresponding CFLAGS. # +# Note: a slightly modified version by Davide Scola +# - default case during cross-compilation for the `AC_RUN_IFELSE' +# macro has been added +# # LICENSE # # Copyright (c) 2016 Felix Chern @@ -68,6 +72,7 @@ AC_DEFUN_ONCE([_AX_GCC_X86_CPU_INIT], [__builtin_cpu_init ();]) ], [ax_cv_gcc_check_x86_cpu_init=yes], + [ax_cv_gcc_check_x86_cpu_init=no], [ax_cv_gcc_check_x86_cpu_init=no])]) AC_LANG_POP([C]) AS_IF([test "X$ax_cv_gcc_check_x86_cpu_init" = "Xno"], @@ -89,6 +94,7 @@ AC_DEFUN([AX_GCC_X86_CPU_SUPPORTS], return 1; ])], [gcc_x86_feature=yes], + [gcc_x86_feature=no], [gcc_x86_feature=no] )] ) From 4d7f47f1c47412408b00380f84a02331b59702cc Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 14:41:06 +0000 Subject: [PATCH 29/50] prevent warnings for the "AX_C99_INLINE" macro when using newer versions of autoconf --- m4/ax_c99_inline.m4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/m4/ax_c99_inline.m4 b/m4/ax_c99_inline.m4 index aa5b02b..b5b0a72 100644 --- a/m4/ax_c99_inline.m4 +++ b/m4/ax_c99_inline.m4 @@ -15,6 +15,7 @@ # Note: a slightly modified version by Davide Scola # - fix a warning with newer versions of autoconf (for more details # see https://autotools.io/forwardporting/autoconf.html) +# - replaced obsolete macro `AC_PROG_CC_C99' with `AC_PROG_CC' # # LICENSE # @@ -29,7 +30,7 @@ AC_DEFUN([AX_C99_INLINE], [ AC_MSG_CHECKING([whether the compiler supports C99 inline functions]) - AC_REQUIRE([AC_PROG_CC_C99]) + AC_REQUIRE([AC_PROG_CC]) AC_LANG_PUSH([C]) From 1e48cf1a9e2df91636e7b28f120340b56acc2bec Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 14:49:44 +0000 Subject: [PATCH 30/50] obsolete "AC_HELP_STRING" macro has been replaced with "AS_HELP_STRING" to avoid warnings with newer versions of autoconf --- configure.ac | 2 +- m4/ax_define_descriptor.m4 | 2 +- m4/ax_define_size.m4 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index a410789..a1a7421 100644 --- a/configure.ac +++ b/configure.ac @@ -144,7 +144,7 @@ dnl Checks for user defined options. dnl -------------------------------------------------------------------- AX_MSG_BOLD([Checking user defined options]) -AC_ARG_ENABLE([x86-features], AC_HELP_STRING([--enable-x86-features], +AC_ARG_ENABLE([x86-features], AS_HELP_STRING([--enable-x86-features], [Enable the x86 features check @<:@default=yes@:>@]), [ax_cv_enable_x86_features="${enableval}"], [ax_cv_enable_x86_features='yes']) diff --git a/m4/ax_define_descriptor.m4 b/m4/ax_define_descriptor.m4 index 15e3670..a73b555 100644 --- a/m4/ax_define_descriptor.m4 +++ b/m4/ax_define_descriptor.m4 @@ -17,7 +17,7 @@ AC_DEFUN([AX_DEFINE_DESCRIPTOR], [ AS_LITERAL_IF([$2], [], [AC_FATAL([$0: requires literal arguments])]) AS_LITERAL_IF([$3], [], [AC_FATAL([$0: requires literal arguments])]) - AC_ARG_WITH(m4_tolower($1), AC_HELP_STRING(m4_tolower(--with-$1), + AC_ARG_WITH(m4_tolower($1), AS_HELP_STRING(m4_tolower(--with-$1), [Set the $2 file descriptor @<:@default=$3@:>@]), ac_cv_[]m4_tolower($1)="${withval:-yes}", ac_cv_[]m4_tolower($1)="$3") diff --git a/m4/ax_define_size.m4 b/m4/ax_define_size.m4 index fefeb1b..207752c 100644 --- a/m4/ax_define_size.m4 +++ b/m4/ax_define_size.m4 @@ -17,7 +17,7 @@ AC_DEFUN([AX_DEFINE_SIZE], [ AS_LITERAL_IF([$2], [], [AC_FATAL([$0: requires literal arguments])]) AS_LITERAL_IF([$3], [], [AC_FATAL([$0: requires literal arguments])]) - AC_ARG_WITH(m4_tolower($1), AC_HELP_STRING(m4_tolower(--with-$1), + AC_ARG_WITH(m4_tolower($1), AS_HELP_STRING(m4_tolower(--with-$1), [Set the $2 size in bytes @<:@default=$3@:>@]), ac_cv_[]m4_tolower($1)="${withval:-yes}", ac_cv_[]m4_tolower($1)="$3") From 0b3a5eea8048847e73ff86e311e1c4d926ecf9e9 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 14:52:16 +0000 Subject: [PATCH 31/50] obsolete and redundant macros have been removed to avoid warnings with newer versions of autoconf --- configure.ac | 2 -- 1 file changed, 2 deletions(-) diff --git a/configure.ac b/configure.ac index a1a7421..9b44b78 100644 --- a/configure.ac +++ b/configure.ac @@ -57,7 +57,6 @@ AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET -AC_PROG_LIBTOOL AC_PROG_AWK AM_MISSING_PROG([HELP2MAN], [help2man]) @@ -103,7 +102,6 @@ dnl Checks for header files. dnl -------------------------------------------------------------------- AX_MSG_BOLD([Checking for required header files]) -AC_HEADER_STDC AC_CHECK_HEADERS([sys/random.h]) AC_CHECK_HEADERS([fcntl.h stdint.h unistd.h], [], [ AC_MSG_ERROR([missing $ac_header vital header file]) From 32b1dcca8ad53534101d93412110d93090b9ebf0 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 10 Nov 2022 14:54:28 +0000 Subject: [PATCH 32/50] enable warnings when using autoreconf --- autogen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen.sh b/autogen.sh index 7aa46ce..8783f5f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -25,7 +25,7 @@ case "${1}" in find . -type f -name 'Makefile.in' -print0 | xargs -r0 rm -f ;; * ) - autoreconf --force --install --include 'm4' + autoreconf --force --install --warnings=all --include 'm4' [[ -d autom4te.cache ]] && rm -rf autom4te.cache [[ -x shtool ]] || PERL5OPT='-M-warnings=deprecated' shtoolize -q 'echo' ;; From 2911cd82d4981b72db1fc85b43927d1acf2b8210 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 18 Apr 2024 14:48:11 +0000 Subject: [PATCH 33/50] copyright update --- Makefile.am | 2 +- autogen.sh | 2 +- configure.ac | 4 ++-- doc/Makefile.am | 2 +- include/Makefile.am | 2 +- include/common.h | 2 +- include/encode.h | 2 +- include/io.h | 2 +- m4/Makefile.am | 2 +- src/Makefile.am | 2 +- src/encode.c | 2 +- src/grc-keygen.c | 2 +- src/grc-sign.c | 2 +- src/grc-verify.c | 2 +- src/grenache-announce.in | 4 ++-- src/grenache-get.in | 4 ++-- src/grenache-keygen.in | 4 ++-- src/grenache-lookup.in | 4 ++-- src/grenache-put.in | 4 ++-- src/io.c | 2 +- tests/Makefile.am | 2 +- tests/sign-test-vector-1.sh.in | 2 +- tests/sign-test-vector-2.sh.in | 2 +- tests/verify-test-vector-1.sh.in | 2 +- tests/verify-test-vector-2.sh.in | 2 +- 25 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Makefile.am b/Makefile.am index b2e739a..d09c606 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/autogen.sh b/autogen.sh index 8783f5f..898c87f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/configure.ac b/configure.ac index 9b44b78..0bf630e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl This file is part of Grenache Command Line Interface. dnl -dnl Copyright (C) 2017-2022 Davide Scola +dnl Copyright (C) 2017-2024 Davide Scola dnl dnl Licensed under the Apache License, Version 2.0 (the "License"); you may dnl not use this file except in compliance with the License. You may obtain @@ -21,7 +21,7 @@ AC_SUBST([VERSION], [0.7.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) -AC_COPYRIGHT([Copyright (c) 2017-2022 Davide Scola, +AC_COPYRIGHT([Copyright (c) 2017-2024 Davide Scola, This configure script may be copied, distributed and modified under the terms of the Apache License 2.0 license; see LICENSE for more details.]) diff --git a/doc/Makefile.am b/doc/Makefile.am index 89728c1..7c193b7 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/Makefile.am b/include/Makefile.am index 18e7b66..f05658f 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/common.h b/include/common.h index 829c92d..53174d5 100644 --- a/include/common.h +++ b/include/common.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/encode.h b/include/encode.h index e29682f..e5f3b25 100644 --- a/include/encode.h +++ b/include/encode.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/io.h b/include/io.h index 69be281..e9a9829 100644 --- a/include/io.h +++ b/include/io.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/m4/Makefile.am b/m4/Makefile.am index ab4cfa4..2c14a4a 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/Makefile.am b/src/Makefile.am index 0c38477..30b71d6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/encode.c b/src/encode.c index 76ee6a0..67358b7 100644 --- a/src/encode.c +++ b/src/encode.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-keygen.c b/src/grc-keygen.c index 74eb18e..6aa9ccb 100644 --- a/src/grc-keygen.c +++ b/src/grc-keygen.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-sign.c b/src/grc-sign.c index 8500eb7..4de13b6 100644 --- a/src/grc-sign.c +++ b/src/grc-sign.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-verify.c b/src/grc-verify.c index bc8fce0..7e4b9ab 100644 --- a/src/grc-verify.c +++ b/src/grc-verify.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grenache-announce.in b/src/grenache-announce.in index 169f0b6..0768c9b 100644 --- a/src/grenache-announce.in +++ b/src/grenache-announce.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -62,7 +62,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-get.in b/src/grenache-get.in index 88facc3..94022b6 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -63,7 +63,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-keygen.in b/src/grenache-keygen.in index adbfc23..bd1956d 100644 --- a/src/grenache-keygen.in +++ b/src/grenache-keygen.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -52,7 +52,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-lookup.in b/src/grenache-lookup.in index 2c2ba3f..b4932a7 100644 --- a/src/grenache-lookup.in +++ b/src/grenache-lookup.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -67,7 +67,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-put.in b/src/grenache-put.in index e718175..8848adc 100644 --- a/src/grenache-put.in +++ b/src/grenache-put.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -64,7 +64,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ -Copyright (C) 2017-2022 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/io.c b/src/io.c index 8329f1b..3740db9 100644 --- a/src/io.c +++ b/src/io.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2022 Davide Scola + * Copyright (C) 2017-2024 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/tests/Makefile.am b/tests/Makefile.am index 2ac3ec3..8e6f888 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-1.sh.in b/tests/sign-test-vector-1.sh.in index dd4b093..4a05110 100644 --- a/tests/sign-test-vector-1.sh.in +++ b/tests/sign-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-2.sh.in b/tests/sign-test-vector-2.sh.in index 51a08eb..0a08e11 100644 --- a/tests/sign-test-vector-2.sh.in +++ b/tests/sign-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-1.sh.in b/tests/verify-test-vector-1.sh.in index 2ef0507..2f18709 100644 --- a/tests/verify-test-vector-1.sh.in +++ b/tests/verify-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-2.sh.in b/tests/verify-test-vector-2.sh.in index 3342aea..bceebdd 100644 --- a/tests/verify-test-vector-2.sh.in +++ b/tests/verify-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2022 Davide Scola # +# Copyright (C) 2017-2024 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # From 8e8d4665ca0f644fff2fa26ec7248e8b8ebb4982 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 19 Apr 2024 14:45:46 +0000 Subject: [PATCH 34/50] version information has been updated --- src/grenache-announce.in | 2 +- src/grenache-get.in | 2 +- src/grenache-keygen.in | 2 +- src/grenache-lookup.in | 2 +- src/grenache-put.in | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/grenache-announce.in b/src/grenache-announce.in index 0768c9b..f26e800 100644 --- a/src/grenache-announce.in +++ b/src/grenache-announce.in @@ -60,7 +60,7 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ +${WHOAMI##*/} @PACKAGE_VERSION@ Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is diff --git a/src/grenache-get.in b/src/grenache-get.in index 94022b6..9381879 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -61,7 +61,7 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ +${WHOAMI##*/} @PACKAGE_VERSION@ Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is diff --git a/src/grenache-keygen.in b/src/grenache-keygen.in index bd1956d..7ade28f 100644 --- a/src/grenache-keygen.in +++ b/src/grenache-keygen.in @@ -50,7 +50,7 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ +${WHOAMI##*/} @PACKAGE_VERSION@ Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is diff --git a/src/grenache-lookup.in b/src/grenache-lookup.in index b4932a7..a843219 100644 --- a/src/grenache-lookup.in +++ b/src/grenache-lookup.in @@ -65,7 +65,7 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ +${WHOAMI##*/} @PACKAGE_VERSION@ Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is diff --git a/src/grenache-put.in b/src/grenache-put.in index 8848adc..cc70172 100644 --- a/src/grenache-put.in +++ b/src/grenache-put.in @@ -62,7 +62,7 @@ _EOF # Show program's version. function show_version { @CAT@ <<_EOF -${WHOAMI##*/} (@PACKAGE_NAME@) @PACKAGE_VERSION@ for @host_cpu@-@host_os@ +${WHOAMI##*/} @PACKAGE_VERSION@ Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is From c7bfa661648103592c1123591d27cb66d5356f77 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 19 Apr 2024 14:48:17 +0000 Subject: [PATCH 35/50] get version information from the program itself when generating man pages --- doc/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/Makefile.am b/doc/Makefile.am index 7c193b7..d8032c6 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -27,6 +27,6 @@ MAINTAINERCLEANFILES = \ $(dist_man1_MANS) %.1: $(top_srcdir)/src/%.in $(top_srcdir)/doc/Makefile.am - $(HELP2MAN) --no-info --output=$@ --version-string="$(PACKAGE_VERSION)" \ - --name="manual page for $(notdir $(basename $<)) ($(PACKAGE_NAME)) $(PACKAGE_VERSION) on $(host_cpu)-$(host_os)" \ + $(HELP2MAN) --no-info --output=$@ \ + --name="manual page for $(PACKAGE_NAME) version $(PACKAGE_VERSION) on $(host_cpu)-$(host_os)" \ "${SHELL} $(top_builddir)/src/$(notdir $(basename $<))$(EXEEXT)" From a64770f4d911a6a31dd1161ea71a0622ff55cae4 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 19 Apr 2024 16:05:59 +0000 Subject: [PATCH 36/50] use a function pointer for I/O operations --- configure.ac | 1 + include/io.h | 6 ++++++ src/io.c | 56 ++++++++++++++++++++++++++++++++++------------------ 3 files changed, 44 insertions(+), 19 deletions(-) diff --git a/configure.ac b/configure.ac index 0bf630e..9f2daf4 100644 --- a/configure.ac +++ b/configure.ac @@ -115,6 +115,7 @@ AX_MSG_BOLD([Checking for compiler characteristics]) AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T +AC_TYPE_SSIZE_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_UINT32_T diff --git a/include/io.h b/include/io.h index e9a9829..d400ce0 100644 --- a/include/io.h +++ b/include/io.h @@ -21,6 +21,12 @@ #define _IO_H +/* + * Type of an IO operation. + */ +typedef ssize_t (*ioop_t) (int, void *, size_t); + + #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ diff --git a/src/io.c b/src/io.c index 3740db9..4a2bbd6 100644 --- a/src/io.c +++ b/src/io.c @@ -32,6 +32,38 @@ #include "io.h" +/** + * Perform an I/O operation. + * + * @param ioop_t op + * The I/O operation. + * @param int fd + * The file descriptor. + * @param char *buffer + * The buffer to operate on. + * @param size_t length + * On how many bytes to operate. + * + * @return int + * The number of bytes it was operated on, -1 otherwise. + */ +static INLINE ALWAYS_INLINE ssize_t ioop(ioop_t op, int fd, char *buffer, size_t length) { + ssize_t size; + size_t nbytes = 0; + + while (nbytes < length) { + if ((size = op(fd, buffer + nbytes, length - nbytes)) < 1) { + /* Return error even when EINTR. */ + return -1; + } + + nbytes += size; + } + + return nbytes; +} + + /** * Read from a file descriptor. * @@ -46,16 +78,10 @@ * 0 if all the bytes have been read, -1 otherwise. */ int ioread(int fd, char *buffer, size_t length) { - size_t size; - size_t nread = 0; - - while (nread < length) { - if ((size = read(fd, buffer + nread, length - nread)) < 1) { - /* Return error even when EINTR. */ - return -1; - } + ssize_t nread; - nread += size; + if ((nread = ioop(read, fd, buffer, length)) == -1) { + return -1; } *(buffer + nread) = '\0'; @@ -76,16 +102,8 @@ int ioread(int fd, char *buffer, size_t length) { * 0 if all bytes have been written, -1 otherwise. */ int iowrite(int fd, char *buffer, size_t length) { - size_t size; - size_t nwrote = 0; - - while (nwrote < length) { - if ((size = write(fd, buffer + nwrote, length - nwrote)) < 1) { - /* Return error even when EINTR. */ - return -1; - } - - nwrote += size; + if (ioop((ioop_t) write, fd, buffer, length) == -1) { + return -1; } (void) fsync(fd); From dcaedc4b2c3207fc6f8ff2dd5a980c3fd6a45bb9 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Fri, 19 Apr 2024 16:07:50 +0000 Subject: [PATCH 37/50] Ed25519 has been updated to the latest version --- ed25519 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ed25519 b/ed25519 index 7fa6712..b1f19fa 160000 --- a/ed25519 +++ b/ed25519 @@ -1 +1 @@ -Subproject commit 7fa6712ef5d581a6981ec2b08ee623314cd1d1c4 +Subproject commit b1f19fab4aebe607805620d25a5e42566ce46a0e From 982db9a31a76f8042a6e6f5f5d7b777fc0fb3bcd Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Mon, 13 May 2024 15:28:58 +0000 Subject: [PATCH 38/50] the M4 macro "AX_C99_INLINE" has been updated to the latest version available --- m4/ax_c99_inline.m4 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/m4/ax_c99_inline.m4 b/m4/ax_c99_inline.m4 index b5b0a72..bca6f9b 100644 --- a/m4/ax_c99_inline.m4 +++ b/m4/ax_c99_inline.m4 @@ -26,7 +26,7 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 8 +#serial 9 AC_DEFUN([AX_C99_INLINE], [ AC_MSG_CHECKING([whether the compiler supports C99 inline functions]) @@ -41,8 +41,8 @@ AC_DEFUN([AX_C99_INLINE], [ dnl translation units that could require the definition. AC_LINK_IFELSE( [AC_LANG_SOURCE([ - inline void* foo() { foo(); return &foo; } - int main() { return foo() != 0;} + inline void* foo(void) { foo(); return &foo; } + int main(void) { return foo() != 0;} ])], dnl the invalid source compiled, so the inline keyword does not work @@ -52,8 +52,8 @@ AC_DEFUN([AX_C99_INLINE], [ dnl Secondary test of valid source. AC_LINK_IFELSE( [AC_LANG_SOURCE([ - extern inline void* foo() { foo(); return &foo; } - int main() { return foo() != 0;} + extern inline void* foo(void) { foo(); return &foo; } + int main(void) { return foo() != 0;} ])], AC_MSG_RESULT([yes]) From 7516ef0a397d685559422c94473edca58e4f7727 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 22 Oct 2024 14:21:08 +0000 Subject: [PATCH 39/50] the M4 macro "AX_IS_RELEASE" has been updated to the latest version available --- m4/ax_is_release.m4 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/m4/ax_is_release.m4 b/m4/ax_is_release.m4 index 3a62609..4618a99 100644 --- a/m4/ax_is_release.m4 +++ b/m4/ax_is_release.m4 @@ -45,7 +45,7 @@ # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. -#serial 8 +#serial 9 AC_DEFUN([AX_IS_RELEASE],[ AC_BEFORE([AC_INIT],[$0]) @@ -76,6 +76,6 @@ AC_DEFUN([AX_IS_RELEASE],[ [always],[ax_is_release=yes], [never],[ax_is_release=no], [ - AC_MSG_ERROR([Invalid policy. Valid policies: git-directory, minor-version, micro-version, dash-version, always, never.]) + m4_if($1, [], m4_fatal([$0: invalid policy $1. Valid policies: git-directory, minor-version, micro-version, dash-version, always, never])) ]) ]) From a82dc6ac0b28fc4059bfcb93a29d46bdb8a0c046 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 22 Oct 2024 14:22:13 +0000 Subject: [PATCH 40/50] the M4 macro "AX_CHECK_COMPILE_FLAG" has been updated to the latest version available --- m4/ax_check_compile_flag.m4 | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/m4/ax_check_compile_flag.m4 b/m4/ax_check_compile_flag.m4 index bd753b3..54191c5 100644 --- a/m4/ax_check_compile_flag.m4 +++ b/m4/ax_check_compile_flag.m4 @@ -34,14 +34,24 @@ # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 6 +#serial 11 AC_DEFUN([AX_CHECK_COMPILE_FLAG], [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl -AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ +AC_CACHE_CHECK([whether the _AC_LANG compiler accepts $1], CACHEVAR, [ ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS - _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" + if test x"m4_case(_AC_LANG, + [C], [$GCC], + [C++], [$GXX], + [Fortran], [$GFC], + [Fortran 77], [$G77], + [Objective C], [$GOBJC], + [Objective C++], [$GOBJCXX], + [no])" = xyes ; then + add_gnu_werror="-Werror" + fi + _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1 $add_gnu_werror" AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], [AS_VAR_SET(CACHEVAR,[yes])], [AS_VAR_SET(CACHEVAR,[no])]) From fa057918eac9c277a07254110cc5af0548c46957 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 22 Oct 2024 14:26:33 +0000 Subject: [PATCH 41/50] a missing macro wanted by libtool has been added --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 9f2daf4..06d18fd 100644 --- a/configure.ac +++ b/configure.ac @@ -52,6 +52,7 @@ AX_MSG_BOLD([Checking for required programs]) LT_INIT AC_PROG_CC +AC_PROG_CXX AC_PROG_CPP AM_PROG_CC_C_O AC_PROG_INSTALL From f048056afd94b9aec4e59104283b5ac511de8fe3 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Wed, 8 Jan 2025 14:01:18 +0000 Subject: [PATCH 42/50] copyright update --- Makefile.am | 2 +- autogen.sh | 2 +- configure.ac | 4 ++-- doc/Makefile.am | 2 +- include/Makefile.am | 2 +- include/common.h | 2 +- include/encode.h | 2 +- include/io.h | 2 +- m4/Makefile.am | 2 +- src/Makefile.am | 2 +- src/encode.c | 2 +- src/grc-keygen.c | 2 +- src/grc-sign.c | 2 +- src/grc-verify.c | 2 +- src/grenache-announce.in | 4 ++-- src/grenache-get.in | 4 ++-- src/grenache-keygen.in | 4 ++-- src/grenache-lookup.in | 4 ++-- src/grenache-put.in | 4 ++-- src/io.c | 2 +- tests/Makefile.am | 2 +- tests/sign-test-vector-1.sh.in | 2 +- tests/sign-test-vector-2.sh.in | 2 +- tests/verify-test-vector-1.sh.in | 2 +- tests/verify-test-vector-2.sh.in | 2 +- 25 files changed, 31 insertions(+), 31 deletions(-) diff --git a/Makefile.am b/Makefile.am index d09c606..ec45abc 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/autogen.sh b/autogen.sh index 898c87f..9ac36e2 100755 --- a/autogen.sh +++ b/autogen.sh @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/configure.ac b/configure.ac index 06d18fd..38cabda 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl This file is part of Grenache Command Line Interface. dnl -dnl Copyright (C) 2017-2024 Davide Scola +dnl Copyright (C) 2017-2025 Davide Scola dnl dnl Licensed under the Apache License, Version 2.0 (the "License"); you may dnl not use this file except in compliance with the License. You may obtain @@ -21,7 +21,7 @@ AC_SUBST([VERSION], [0.7.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) -AC_COPYRIGHT([Copyright (c) 2017-2024 Davide Scola, +AC_COPYRIGHT([Copyright (c) 2017-2025 Davide Scola, This configure script may be copied, distributed and modified under the terms of the Apache License 2.0 license; see LICENSE for more details.]) diff --git a/doc/Makefile.am b/doc/Makefile.am index d8032c6..dfe1374 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/Makefile.am b/include/Makefile.am index f05658f..bbfcbb8 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/include/common.h b/include/common.h index 53174d5..1c8d659 100644 --- a/include/common.h +++ b/include/common.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/encode.h b/include/encode.h index e5f3b25..22ee305 100644 --- a/include/encode.h +++ b/include/encode.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/include/io.h b/include/io.h index d400ce0..057c907 100644 --- a/include/io.h +++ b/include/io.h @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/m4/Makefile.am b/m4/Makefile.am index 2c14a4a..dd5623f 100644 --- a/m4/Makefile.am +++ b/m4/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/Makefile.am b/src/Makefile.am index 30b71d6..4b04cfe 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/src/encode.c b/src/encode.c index 67358b7..db51b3f 100644 --- a/src/encode.c +++ b/src/encode.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-keygen.c b/src/grc-keygen.c index 6aa9ccb..bdc8d95 100644 --- a/src/grc-keygen.c +++ b/src/grc-keygen.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-sign.c b/src/grc-sign.c index 4de13b6..60b902f 100644 --- a/src/grc-sign.c +++ b/src/grc-sign.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grc-verify.c b/src/grc-verify.c index 7e4b9ab..a215492 100644 --- a/src/grc-verify.c +++ b/src/grc-verify.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/src/grenache-announce.in b/src/grenache-announce.in index f26e800..96a17be 100644 --- a/src/grenache-announce.in +++ b/src/grenache-announce.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -62,7 +62,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} @PACKAGE_VERSION@ -Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2025 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-get.in b/src/grenache-get.in index 9381879..1eed71a 100644 --- a/src/grenache-get.in +++ b/src/grenache-get.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -63,7 +63,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} @PACKAGE_VERSION@ -Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2025 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-keygen.in b/src/grenache-keygen.in index 7ade28f..2b56251 100644 --- a/src/grenache-keygen.in +++ b/src/grenache-keygen.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -52,7 +52,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} @PACKAGE_VERSION@ -Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2025 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-lookup.in b/src/grenache-lookup.in index a843219..48f6eb2 100644 --- a/src/grenache-lookup.in +++ b/src/grenache-lookup.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -67,7 +67,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} @PACKAGE_VERSION@ -Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2025 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/grenache-put.in b/src/grenache-put.in index cc70172..bdbbdcd 100644 --- a/src/grenache-put.in +++ b/src/grenache-put.in @@ -2,7 +2,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # @@ -64,7 +64,7 @@ function show_version { @CAT@ <<_EOF ${WHOAMI##*/} @PACKAGE_VERSION@ -Copyright (C) 2017-2024 Davide Scola <@PACKAGE_BUGREPORT@> +Copyright (C) 2017-2025 Davide Scola <@PACKAGE_BUGREPORT@> This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/src/io.c b/src/io.c index 4a2bbd6..35b5c86 100644 --- a/src/io.c +++ b/src/io.c @@ -2,7 +2,7 @@ * @file * This file is part of Grenache Command Line Interface. * - * Copyright (C) 2017-2024 Davide Scola + * Copyright (C) 2017-2025 Davide Scola * * Licensed under the Apache License, Version 2.0 (the "License"); you may * not use this file except in compliance with the License. You may obtain diff --git a/tests/Makefile.am b/tests/Makefile.am index 8e6f888..b228258 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-1.sh.in b/tests/sign-test-vector-1.sh.in index 4a05110..1cf4c70 100644 --- a/tests/sign-test-vector-1.sh.in +++ b/tests/sign-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/sign-test-vector-2.sh.in b/tests/sign-test-vector-2.sh.in index 0a08e11..b6fea14 100644 --- a/tests/sign-test-vector-2.sh.in +++ b/tests/sign-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-1.sh.in b/tests/verify-test-vector-1.sh.in index 2f18709..231b74a 100644 --- a/tests/verify-test-vector-1.sh.in +++ b/tests/verify-test-vector-1.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # diff --git a/tests/verify-test-vector-2.sh.in b/tests/verify-test-vector-2.sh.in index bceebdd..abd1da1 100644 --- a/tests/verify-test-vector-2.sh.in +++ b/tests/verify-test-vector-2.sh.in @@ -1,7 +1,7 @@ ############################################################################ # This file is part of Grenache Command Line Interface. # # # -# Copyright (C) 2017-2024 Davide Scola # +# Copyright (C) 2017-2025 Davide Scola # # # # Licensed under the Apache License, Version 2.0 (the "License"); you may # # not use this file except in compliance with the License. You may obtain # From 4c4dd235b6fa1b95da63f37e02a6278d47d67872 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 23 Jan 2025 15:09:01 +0000 Subject: [PATCH 43/50] grenache-request has been added --- .gitignore | 1 + README.md | 50 +++++++++ configure.ac | 1 + doc/Makefile.am | 1 + src/Makefile.am | 1 + src/grenache-request.in | 225 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 279 insertions(+) create mode 100644 src/grenache-request.in diff --git a/.gitignore b/.gitignore index d38870f..d2391b1 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ grenache-get grenache-put grenache-keygen grenache-lookup +grenache-request grenache-announce # diff --git a/README.md b/README.md index d98b0d6..55f4887 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,7 @@ * [Retreive items from the DHT](#retreive-items-from-the-dht) * [Lookup peers](#lookup-peers) * [Announce services](#announce-services) + * [Query services](#query-services) * [Maintainers](#maintainers) @@ -184,6 +185,55 @@ grenache-announce --help to retrieve the complete options list. +## Query services + +The `grenache-request` command sends a request to a service in the DHT. To query the [rest:ext:helpdesk:foo](https://github.com/bitfinexcom/bfx-ext-helpdesk-js) service, simply run something like this: + +```bash +grenache-request 'rest:ext:helpdesk:foo' 'getDepartments' +``` + +Action arguments are optional and can be omitted altogether. However, to pass an argument to an action, use the `-a` switch or its long form `--arg`; to query the [rest:net:util](https://github.com/bitfinexcom/bfx-util-net-js) service in order to get information about IP _208.67.222.222_, simply run something like this: + +```bash +grenache-request -a '"208.67.222.222"' 'rest:util:net' 'getIpInfo' +``` + +To send multiple arguments, simply repeat the `-a` switch or its long form `--arg` as many times as needed; arguments will be passed to the service action in the same order as they were supplied on the command line. To query the [rest:ext:gpg](https://github.com/bitfinexcom/bfx-ext-gpg-js) service in order to get a signature for the _hello_ message, simply run something like this: + +```bash +grenache-request -a '"68656c6c6f"' -a '{"userId":1}' 'rest:ext:gpg' 'getDigitalSignature' +``` + +Arguments are treated as _JSON_-encoded text; sometimes, when dealing with plain strings, this can be somewhat cumbersome. In such cases, the `-s` switch or its long form `--string` can be used to pass a string as-is or `-n` or its long form `--numeric` when accepting an option that is intended to be treated as a numeric value. + +Typically, the output is a _JSON_-encoded text. Sometimes, filtering this text can be useful; in such cases, output can be selected using the `-q` switch or its long form `--query`, as shown below: + +```bash +grenache-request -q 'map(select(.active_members > 3))' 'rest:ext:helpdesk:bar' 'getTeams' +``` + +The query is passed as-is to [jq](https://jqlang.github.io/jq/) and will be applied directly to the third position of the response array; refer to the official [filter documentation](https://jqlang.github.io/jq/manual/#basic-filters) for more details on the syntax to be used. However, there are cases where a plain string written directly to the standard output is preferable rather than formatted as a _JSON_ string with quotes, perhaps when pipe the output to another command; in such cases, the `-r` switch or its long form `--raw` can be used, as shown below: + +```bash +grenache-request -q '.[1].timezone' -r -s '208.67.222.222' 'rest:util:net' 'getIpGeo' +``` + +Under normal circumstances, workflow is to look up the service via [grenache-lookup](#lookup-peers) and then send the request to the worker. There might be cases, perhaps when dealing with a system without a running [grape](https://github.com/bitfinexcom/grenache-grape), where it would be useful to query a service without looking it up first; in such cases, the `-w` switch or its long form `--worker` can be used, as shown below: + +```bash +grenache-request -r -s '776f726c64' -a '{"userId":8}' -w '10.0.0.1:1337' 'rest:ext:gpg' 'getDigitalSignature' +``` + +Those are the main options; see + +```bash +grenache-request --help +``` + +to retrieve the complete options list. + + ## Maintainers Current maintainers: diff --git a/configure.ac b/configure.ac index 06d18fd..d7dfb43 100644 --- a/configure.ac +++ b/configure.ac @@ -190,6 +190,7 @@ AC_CONFIG_FILES([ \ src/grenache-get \ src/grenache-keygen \ src/grenache-lookup \ + src/grenache-request \ src/grenache-announce \ tests/Makefile \ tests/sign-test-vector-1.sh \ diff --git a/doc/Makefile.am b/doc/Makefile.am index d8032c6..6433737 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -21,6 +21,7 @@ grenache-get.1 \ grenache-put.1 \ grenache-keygen.1 \ grenache-lookup.1 \ +grenache-request.1 \ grenache-announce.1 MAINTAINERCLEANFILES = \ diff --git a/src/Makefile.am b/src/Makefile.am index 30b71d6..4246348 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,6 +31,7 @@ grenache-put \ grenache-get \ grenache-keygen \ grenache-lookup \ +grenache-request \ grenache-announce noinst_LTLIBRARIES = \ diff --git a/src/grenache-request.in b/src/grenache-request.in new file mode 100644 index 0000000..d71b2a1 --- /dev/null +++ b/src/grenache-request.in @@ -0,0 +1,225 @@ +#!/bin/bash +############################################################################ +# This file is part of Grenache Command Line Interface. # +# # +# Copyright (C) 2017-2025 Davide Scola # +# # +# Licensed under the Apache License, Version 2.0 (the "License"); you may # +# not use this file except in compliance with the License. You may obtain # +# a copy of the License at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# Unless required by applicable law or agreed to in writing, software # +# distributed under the License is distributed on an "AS IS" BASIS, # +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or # +# implied. See the License for the specific language governing permissions # +# and limitations under the License. # +############################################################################ + +readonly ME="${BASH_SOURCE[0]}" +readonly WHOAMI="$(@READLINK@ -snf "${ME}")" +readonly ARGV=$(@GETOPT@ -o 'a:cg:hn:p:q:rs:tVw:' --long 'arg:,color,grape:,help,numeric:,port:,query:,raw,string:,tls,version,worker:' -n "${ME##*/}" -- "$@") || exit 1 + +TLS='' +COLOR='' +EXIT_CODE=1 +REQUEST_ARGC=0 +RESPONSE_ARGV=() +REQUEST_WORKER='' +REQUEST_QUERY='.' +RESPONSE_QUERY='.' +REQUEST_ARGUMENTS='[]' +LOOKUP_ARGV=(--random) +REQUEST_ARGV=(--compact-output --monochrome-output) + + +# Show program's help. +function show_help { + @CAT@ <<_EOF +${ME##*/} sends a request to a service in the DHT + +Usage: ${ME##*/} [OPTION]... SERVICE ACTION + +Options: + -a, --arg Add an argument, JSON encoded + -c, --color Pretty print + -g, --grape Set the Grape hostname + -n, --numeric Add a numeric argument + -p, --port Set the Grape port number + -q, --query Filter response against query + -r, --raw Print string output as-is + -s, --string Add a string argument + -t, --tls Enable TLS + -w, --worker Don't lookup, use this worker + + -h, --help Show help message + -V, --version Show version information + +The \`--arg', \`--numeric' and \`--string' options can be repeated several times +to add multiple arguments, which will be passed in the same order as they were +supplied on the command line. + +Examples: + ${ME##*/} 'foo' 'bar' Call the bar action of the foo service + ${ME##*/} -n 1 'foo' 'bar' The same thing, but passing a numeric argument + +Report bugs to <@PACKAGE_BUGREPORT@>. +_EOF + + exit 1 +} + +# Show program's version. +function show_version { + @CAT@ <<_EOF +${WHOAMI##*/} @PACKAGE_VERSION@ + +Copyright (C) 2017-2025 Davide Scola <@PACKAGE_BUGREPORT@> +This is free software; see the source for copying conditions. There is +NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR +PURPOSE. + +Written by Davide Scola. +_EOF + + exit 1 +} + + +while true; do + case "$1" in + -a | --arg ) + REQUEST_ARGV+=(--arg "a$((++REQUEST_ARGC))" "${2}") + REQUEST_QUERY+=' += [ $a'"${REQUEST_ARGC}"' | fromjson ] | .'; shift 2 + ;; + -c | --color ) + COLOR='yes'; shift 1 + ;; + -g | --grape ) + [[ -z "${2}" ]] && { + echo "${ME##*/}: error: empty Grape hostname." >&2 + exit 1 + } + + LOOKUP_ARGV+=(--grape "${2}"); shift 2 + ;; + -h | --help ) + show_help; shift 1 + ;; + -n | --numeric ) + REQUEST_ARGV+=(--arg "n$((++REQUEST_ARGC))" "${2}") + REQUEST_QUERY+=' += [ $n'"${REQUEST_ARGC}"' | tonumber ] | .'; shift 2 + ;; + -p | --port ) + [[ -z "${2}" ]] && { + echo "${ME##*/}: error: empty Grape port." >&2 + exit 1 + } + + LOOKUP_ARGV+=(--port "${2}"); shift 2 + ;; + -q | --query ) + [[ -z "${2}" ]] && { + echo "${ME##*/}: error: empty response query." >&2 + exit 1 + } + + RESPONSE_QUERY="${2}"; shift 2 + ;; + -r | --raw ) + RESPONSE_ARGV+=(--raw-output); shift 1 + ;; + -s | --string ) + REQUEST_ARGV+=(--arg "s$((++REQUEST_ARGC))" "${2}") + REQUEST_QUERY+=' += [ $s'"${REQUEST_ARGC}"' | tostring ] | .'; shift 2 + ;; + -t | --tls ) + TLS='yes'; LOOKUP_ARGV+=(--tls); shift 1 + ;; + -V | --version ) + show_version; shift 1 + ;; + -w | --worker ) + [[ -z "${2}" ]] && { + echo "${ME##*/}: error: empty worker address." >&2 + exit 1 + } + + [[ "${2##*:}" =~ ^[0-9]+$ ]] || { + echo "${ME##*/}: error: invalid worker port number." >&2 + exit 1 + } + + [[ "$((${2##*:} & 0xFFFF))" -eq 0 ]] && { + echo "${ME##*/}: error: worker port number must be greater than zero." >&2 + exit 1 + } + + [[ "${2##*:}" -ne "$((${2##*:} & 0xFFFF))" ]] && { + echo "${ME##*/}: error: worker port number too big." >&2 + exit 1 + } + + REQUEST_WORKER="${2%:*}:$((${2##*:} & 0xFFFF))"; shift 2 + ;; + -- ) shift; break ;; + * ) break ;; + esac +done + +[[ -z "${COLOR}" ]] && { + RESPONSE_ARGV+=(--compact-output --monochrome-output) +} + +[[ "${#}" -lt 2 ]] && { + show_help +} + +[[ -f "${HOME}/.grenache-cli/grenache-cli.conf" ]] || { + echo "${ME##*/}: error: you need to run \`grenache-keygen' first." >&2 + exit "${EXIT_CODE}" +} + +exec {stderr}>&2 + +[[ x"${GRENACHE_CLI_DEBUG:+set}" != xset ]] && { + exec 2>/dev/null +} + +[[ "${REQUEST_ARGC}" -gt 0 ]] && { + REQUEST_ARGUMENTS="$(@JQ@ "${REQUEST_ARGV[@]}" --from-file <(echo "${REQUEST_QUERY}") <<<"${REQUEST_ARGUMENTS}")" + + [[ "${?}" -ne 0 ]] && { + echo "${ME##*/}: error: provided arguments are invalid." >&"${stderr}" + + exec {stderr}>&- + exit "${EXIT_CODE}" + } +} + +JSON="$(@CURL@ -qK "${HOME}/.grenache-cli/grenache-cli.conf" -A '@PACKAGE@/@PACKAGE_VERSION@' "http${TLS:+s}://${REQUEST_WORKER:-$(grenache-lookup "${LOOKUP_ARGV[@]}" "${1}")}" < <( \ + @JQ@ --null-input --compact-output --monochrome-output \ + --arg 'action' "${2}" \ + --arg 'service' "${1}" \ + --arg 'rid' "$(@UUIDGEN@)" \ + --arg 'args' "${REQUEST_ARGUMENTS}" \ + '[ $rid, $service, { "action": $action, "args": $args | fromjson } ]' \ +))" + +[[ -z "${JSON}" ]] && { + echo "${ME##*/}: error: service ${1} cannot be queried." >&"${stderr}" + + exec {stderr}>&- + exit "${EXIT_CODE}" +} + +@JQ@ --exit-status '.[1]' >/dev/null <<<"${JSON}" && { + @JQ@ --raw-output '.[1]' <<<"${JSON}" >&"${stderr}" +} || { + EXIT_CODE=0 + @JQ@ "${RESPONSE_ARGV[@]}" --from-file <(printf '.[2] | %s' "${RESPONSE_QUERY}") <<<"${JSON}" +} + +exec {stderr}>&- +exit "${EXIT_CODE}" From a16573b8b97f1cac75bc9c22b440234a8811ef48 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Thu, 23 Jan 2025 15:10:01 +0000 Subject: [PATCH 44/50] bump version to 0.8.0 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index d7dfb43..f16c875 100644 --- a/configure.ac +++ b/configure.ac @@ -15,9 +15,9 @@ dnl implied. See the License for the specific language governing permissions dnl and limitations under the License. AC_PREREQ([2.69]) -AC_INIT([grenache-cli],[0.7.1],[davide@bitfinex.com]) +AC_INIT([grenache-cli],[0.8.0],[davide@bitfinex.com]) -AC_SUBST([VERSION], [0.7.1]) +AC_SUBST([VERSION], [0.8.0]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) From 62214a30783ab489be098c2e2fb13a7c2f16971d Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 4 Feb 2025 10:08:46 +0000 Subject: [PATCH 45/50] documentation has been updated --- README.md | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 55f4887..6d73d68 100644 --- a/README.md +++ b/README.md @@ -1,33 +1,35 @@ # Grenache CLI ![license](https://img.shields.io/github/license/bitfinexcom/grenache-cli.svg) -![GitHub (pre-)release](https://img.shields.io/github/release/bitfinexcom/grenache-cli/all.svg) -![GitHub (Pre-)Release Date](https://img.shields.io/github/release-date-pre/bitfinexcom/grenache-cli.svg) +![GitHub release](https://img.shields.io/github/release/bitfinexcom/grenache-cli/all.svg) +![GitHub release date](https://img.shields.io/github/release-date/bitfinexcom/grenache-cli.svg) ![GitHub last commit](https://img.shields.io/github/last-commit/bitfinexcom/grenache-cli.svg) ![GitHub pull requests](https://img.shields.io/github/issues-pr/bitfinexcom/grenache-cli.svg) -![stability-unstable](https://img.shields.io/badge/stability-unstable-yellow.svg) +![stability-stable](https://img.shields.io/badge/stability-stable-green.svg) - * [Introduction](#introduction) - * [Copying](#copying) - * [Prerequisites](#prerequisites) - * [Install](#install) - * [Initialize](#initialize) - * [Store items to the DHT](#store-items-to-the-dht) - * [Immutable items](#immutable-items) - * [Mutable items](#mutable-items) - * [Retreive items from the DHT](#retreive-items-from-the-dht) - * [Lookup peers](#lookup-peers) - * [Announce services](#announce-services) - * [Query services](#query-services) - * [Maintainers](#maintainers) + - [Introduction](#introduction) + - [Copying](#copying) + - [Prerequisites](#prerequisites) + - [Install](#install) + - [Initialize](#initialize) + - [Store items to the DHT](#store-items-to-the-dht) + - [Immutable items](#immutable-items) + - [Mutable items](#mutable-items) + - [Retreive items from the DHT](#retreive-items-from-the-dht) + - [Lookup peers](#lookup-peers) + - [Announce services](#announce-services) + - [Query services](#query-services) + - [Maintainers](#maintainers) ## Introduction The [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface is a set of tools to use the [grenache-grape](https://github.com/bitfinexcom/grenache-grape) suite directly from your command line. Using this set of tools you can create fancy scripts that communicate directly with the DHT. +All command lines presented in this document are for illustrative purposes only and could make use of tools not available on the user's operating system or provided in a different version, whereby some capabilities may not be available. + ## Copying @@ -238,4 +240,4 @@ to retrieve the complete options list. Current maintainers: -* Davide Scola - davide@bitfinex.com +- [Davide Scola](https://github.com/davide-scola) From e1d4e973b0196d789c240f2a8b1e96251ccf5274 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 4 Feb 2025 10:10:46 +0000 Subject: [PATCH 46/50] "Install" section has been improved --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 56 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6d73d68..894c239 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ - [Copying](#copying) - [Prerequisites](#prerequisites) - [Install](#install) + - [Verifying the distribution](#verifying-the-distribution) + - [Install from source](#install-from-source) - [Initialize](#initialize) - [Store items to the DHT](#store-items-to-the-dht) - [Immutable items](#immutable-items) @@ -45,14 +47,65 @@ Be sure that your version of [grenache-grape](https://github.com/bitfinexcom/gre ## Install -Briefly, the shell command +The [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface relies on the [GNU Build System](https://www.gnu.org/software/automake/manual/html_node/GNU-Build-System.html). In the case where source code has been taken directly from this repository, several files related to the build system have to be generated manually; this can be achieved by running: ```bash -./configure && make && make install +./autogen.sh +``` + +However, this requires a number of development tools that are not needed to run the [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface and are, usually, unlikely to be already installed on the user's operating system. Refer to the [official documentation](https://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html) for all the required tools as well as the operating system literature on how to install them. + +The preferred method of installing the [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface is to download the distribution archives, available under the [Releases](https://github.com/bitfinexcom/grenache-cli/releases) section of this repository. The download of the several files can be automated using something similar, which will always fetch all assets of the [latest release](https://github.com/bitfinexcom/grenache-cli/releases/latest) available: + +```bash +parallel --color --no-run-if-empty 'wget --no-verbose --continue' < <( \ + jq --raw-output 'try(.assets[]) | .browser_download_url // empty' < <( \ + curl --silent 'https://api.github.com/repos/bitfinexcom/grenache-cli/releases/latest' \ + ) \ +) +``` + +Although it is not required, it is worth verifying all the assets before taking any other action; refer to the [Verifying the distribution](#verifying-the-distribution) section for more details. + +### Verifying the distribution + +Unless already done in the past, it is required to import the [GnuPG](https://www.gnupg.org/) key of the packaging system in order to verify the authenticity of the distribution. Starting with version [0.8.0](https://github.com/bitfinexcom/grenache-cli/releases/tag/0.8.0), every released asset is signed using the key [94282D2E89053665952D3E7034C1AE501F0C2C6F](https://keys.openpgp.org/vks/v1/by-fingerprint/94282D2E89053665952D3E7034C1AE501F0C2C6F); older versions may have been signed with a different key, however, the same procedure applies. + +To import the packaging system key within the local keyring, something like this is enough: + +```bash +gpg --keyserver 'hkps://keys.openpgp.org' --recv-keys '94282D2E89053665952D3E7034C1AE501F0C2C6F' ``` -should configure, build and install this package. +Optionally, the packaging system key can be marked as *trusted* within the local keyring, such as via `--lsign-key`, making the verification process straightforward. However, in cases where this does not meet a user's security standards and the version of [GnuPG](https://www.gnupg.org/) in use is fairly recent, setting a [TOFU](https://www.gnupg.org/documentation/manuals/gnupg/GPG-Configuration-Options.html#index-trust_002dmodel) trust policy might be a suitable trade-off: + +```bash +gpg --tofu-policy 'good' '94282D2E89053665952D3E7034C1AE501F0C2C6F' +``` + +In order to verify the authenticity of downloaded assets, something similar can be used: + +```bash +parallel --color 'gpg --trust-model "tofu+pgp" --verify' ::: *.asc +``` + +Finally, in case the downloaded release provides a list of file checksums, this can be verified using something like this: + +```bash +parallel --color --match '(\w+)sums\.asc$' \ + 'gpg --trust-model "tofu+pgp" --decrypt "{}" | cksum --algorithm "{1.1}" --check --ignore-missing' \ +::: *sums.asc +``` + +### Install from source + +Regardless of either source code has been taken directly from this repository or the sources archive has been unpacked, the shell command: + +```bash +./configure && make && make install +``` +should configure, build and install the [**Grenache**](https://github.com/bitfinexcom/grenache) **C**ommand **L**ine **I**nterface. ## Initialize From 02e48c445226fd2ada5b8592952182a1a53b0f87 Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 4 Feb 2025 10:13:33 +0000 Subject: [PATCH 47/50] bump version to 0.8.1 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index afac23a..daa6bc6 100644 --- a/configure.ac +++ b/configure.ac @@ -15,9 +15,9 @@ dnl implied. See the License for the specific language governing permissions dnl and limitations under the License. AC_PREREQ([2.69]) -AC_INIT([grenache-cli],[0.8.0],[davide@bitfinex.com]) +AC_INIT([grenache-cli],[0.8.1],[davide@bitfinex.com]) -AC_SUBST([VERSION], [0.8.0]) +AC_SUBST([VERSION], [0.8.1]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`]) From 0aad90b2ae8f13f99af2376ebdc83f1ec2bf68ec Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 1 Apr 2025 08:36:25 +0000 Subject: [PATCH 48/50] support for streaming data transfer has been added --- src/grenache-request.in | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/grenache-request.in b/src/grenache-request.in index d71b2a1..b339c72 100644 --- a/src/grenache-request.in +++ b/src/grenache-request.in @@ -19,7 +19,7 @@ readonly ME="${BASH_SOURCE[0]}" readonly WHOAMI="$(@READLINK@ -snf "${ME}")" -readonly ARGV=$(@GETOPT@ -o 'a:cg:hn:p:q:rs:tVw:' --long 'arg:,color,grape:,help,numeric:,port:,query:,raw,string:,tls,version,worker:' -n "${ME##*/}" -- "$@") || exit 1 +readonly ARGV=$(@GETOPT@ -o 'a:cg:hn:p:q:rs:StVw:' --long 'arg:,color,grape:,help,numeric:,port:,query:,raw,string:,stream,tls,version,worker:' -n "${ME##*/}" -- "$@") || exit 1 TLS='' COLOR='' @@ -29,6 +29,7 @@ RESPONSE_ARGV=() REQUEST_WORKER='' REQUEST_QUERY='.' RESPONSE_QUERY='.' +CURL_EXTRA_OPTS=() REQUEST_ARGUMENTS='[]' LOOKUP_ARGV=(--random) REQUEST_ARGV=(--compact-output --monochrome-output) @@ -50,6 +51,7 @@ Options: -q, --query Filter response against query -r, --raw Print string output as-is -s, --string Add a string argument + -S, --stream Enable streaming data transfer -t, --tls Enable TLS -w, --worker Don't lookup, use this worker @@ -134,6 +136,9 @@ while true; do REQUEST_ARGV+=(--arg "s$((++REQUEST_ARGC))" "${2}") REQUEST_QUERY+=' += [ $s'"${REQUEST_ARGC}"' | tostring ] | .'; shift 2 ;; + -S | --stream ) + CURL_EXTRA_OPTS+=(--http1.1 --header 'Transfer-Encoding: chunked'); shift 1 + ;; -t | --tls ) TLS='yes'; LOOKUP_ARGV+=(--tls); shift 1 ;; @@ -198,7 +203,7 @@ exec {stderr}>&2 } } -JSON="$(@CURL@ -qK "${HOME}/.grenache-cli/grenache-cli.conf" -A '@PACKAGE@/@PACKAGE_VERSION@' "http${TLS:+s}://${REQUEST_WORKER:-$(grenache-lookup "${LOOKUP_ARGV[@]}" "${1}")}" < <( \ +JSON="$(@CURL@ -qK "${HOME}/.grenache-cli/grenache-cli.conf" -A '@PACKAGE@/@PACKAGE_VERSION@' "${CURL_EXTRA_OPTS[@]}" "http${TLS:+s}://${REQUEST_WORKER:-$(grenache-lookup "${LOOKUP_ARGV[@]}" "${1}")}" < <( \ @JQ@ --null-input --compact-output --monochrome-output \ --arg 'action' "${2}" \ --arg 'service' "${1}" \ From efa7db03486138694434c3f03181618e2b4ccb9c Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 1 Apr 2025 08:36:52 +0000 Subject: [PATCH 49/50] some typos have been fixed --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 894c239..b361463 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ - [Store items to the DHT](#store-items-to-the-dht) - [Immutable items](#immutable-items) - [Mutable items](#mutable-items) - - [Retreive items from the DHT](#retreive-items-from-the-dht) + - [Retrieve items from the DHT](#retrieve-items-from-the-dht) - [Lookup peers](#lookup-peers) - [Announce services](#announce-services) - [Query services](#query-services) @@ -93,7 +93,7 @@ Finally, in case the downloaded release provides a list of file checksums, this ```bash parallel --color --match '(\w+)sums\.asc$' \ - 'gpg --trust-model "tofu+pgp" --decrypt "{}" | cksum --algorithm "{1.1}" --check --ignore-missing' \ + 'gpg --trust-model "tofu+pgp" --decrypt {} | cksum --algorithm {1.1} --check --ignore-missing' \ ::: *sums.asc ``` @@ -153,9 +153,9 @@ grenache-put --help to retrieve the complete options list. -## Retreive items from the DHT +## Retrieve items from the DHT -The `grenache-get` command reads a data record from the DHT (see [BEP 44](http://bittorrent.org/beps/bep_0044.html) for more information). There is no differences in retreiving a _mutable_ or an _immutable_ item; in both cases the key returned by the *PUT* request must be provided. Furthermore, starting from version _[0.9.6](https://github.com/bitfinexcom/grenache-grape/commit/efbfc11)_ of [grenache-grape](https://github.com/bitfinexcom/grenache-grape), the _salt_ specified during the *PUT* operation must be provided if used. In any case, `grenache-get` validates the payload it receive; this will ensure that the _key_ provided really match the payload and, in case of a _mutable_ item, that the signature is correct. This will protect you from evil nodes on the network. To read an item from the DHT simply run something like this: +The `grenache-get` command reads a data record from the DHT (see [BEP 44](http://bittorrent.org/beps/bep_0044.html) for more information). There is no differences in retrieving a _mutable_ or an _immutable_ item; in both cases the key returned by the *PUT* request must be provided. Furthermore, starting from version _[0.9.6](https://github.com/bitfinexcom/grenache-grape/commit/efbfc11)_ of [grenache-grape](https://github.com/bitfinexcom/grenache-grape), the _salt_ specified during the *PUT* operation must be provided if used. In any case, `grenache-get` validates the payload it receive; this will ensure that the _key_ provided really match the payload and, in case of a _mutable_ item, that the signature is correct. This will protect you from evil nodes on the network. To read an item from the DHT simply run something like this: ```bash grenache-get '81c2a8157780989af9a16661324fafbd7803877d' From 53fa93592c06359c749d97d4e90887b9293e4d3b Mon Sep 17 00:00:00 2001 From: Davide Scola Date: Tue, 1 Apr 2025 08:38:43 +0000 Subject: [PATCH 50/50] bump version to 0.8.2 --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index daa6bc6..b0cd5ac 100644 --- a/configure.ac +++ b/configure.ac @@ -15,9 +15,9 @@ dnl implied. See the License for the specific language governing permissions dnl and limitations under the License. AC_PREREQ([2.69]) -AC_INIT([grenache-cli],[0.8.1],[davide@bitfinex.com]) +AC_INIT([grenache-cli],[0.8.2],[davide@bitfinex.com]) -AC_SUBST([VERSION], [0.8.1]) +AC_SUBST([VERSION], [0.8.2]) AC_SUBST([SB], [`$srcdir/shtool echo -n -e %B`]) AC_SUBST([EB], [`$srcdir/shtool echo -n -e %b`])