From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- app-crypt/shash/files/0.2.6-manpage-fixes.patch | 30 +++++++++++++++++ .../shash/files/shash-0.2.6-binary-files.patch | 34 +++++++++++++++++++ .../shash/files/shash-0.2.6-format-security.patch | 28 ++++++++++++++++ app-crypt/shash/files/shash.bash-completion | 38 ++++++++++++++++++++++ 4 files changed, 130 insertions(+) create mode 100644 app-crypt/shash/files/0.2.6-manpage-fixes.patch create mode 100644 app-crypt/shash/files/shash-0.2.6-binary-files.patch create mode 100644 app-crypt/shash/files/shash-0.2.6-format-security.patch create mode 100644 app-crypt/shash/files/shash.bash-completion (limited to 'app-crypt/shash/files') diff --git a/app-crypt/shash/files/0.2.6-manpage-fixes.patch b/app-crypt/shash/files/0.2.6-manpage-fixes.patch new file mode 100644 index 000000000000..0376e15c3572 --- /dev/null +++ b/app-crypt/shash/files/0.2.6-manpage-fixes.patch @@ -0,0 +1,30 @@ +diff -pruN shash-0.2.6/doc/shash.1 shash-0.2.6-r1/doc/shash.1 +--- shash-0.2.6/doc/shash.1 2004-09-18 09:51:04.004647112 +0100 ++++ shash-0.2.6-r1/doc/shash.1 2004-09-18 09:57:26.062565480 +0100 +@@ -31,7 +31,7 @@ Because of this shash also supports HMAC + a mechanism for message authentication using cryptographic hash functions. + So shash can use a key with a hash algorithm to produce hashes that can only + be verified with the key. This way you can securely check (i.e. you are sure +-that nobody can modify the mac, without beeing detected) ++that nobody can modify the mac, without being detected) + if files in a filesystem were altered. + + If the list of files and digests, that shash produces, is stored as +@@ -72,7 +72,7 @@ Suppress some not critical warnings. + .TP + .B \-b + Use binary mode. In unix environment, only difference between this and +-the normal mode is an asterix preceding the filename in the output. ++the normal mode is an asterisk preceding the filename in the output. + .TP + .B \-c + Check the checksum of all files listed in +@@ -94,7 +94,7 @@ Enter the keyword via the command line. + keyword instead of prompting for it. Keep in mind that someone + may see the command you are executing and so your key. + .TP +-.B \-c --config FILE ++.B \-i --config FILE + Use the specified configuration file. The default is .shashrc + in your home directory. The format of the configuration + file is the same as the parameters. An example file is: diff --git a/app-crypt/shash/files/shash-0.2.6-binary-files.patch b/app-crypt/shash/files/shash-0.2.6-binary-files.patch new file mode 100644 index 000000000000..1eb0cba17613 --- /dev/null +++ b/app-crypt/shash/files/shash-0.2.6-binary-files.patch @@ -0,0 +1,34 @@ +--- shash-0.2.6/src/shash.c ++++ shash-0.2.6/src/shash.c +@@ -631,11 +631,11 @@ + + if (nosalt == FALSE && hmac == 1) { + if (sscanf +- (linebuf, "%s %s %s\n", hexbuffer, buffer, +- buffer2) < 2) { ++ (linebuf, "%s %s *%s\n", hexbuffer, buffer, ++ buffer2) != 3) { + if (sscanf +- (linebuf, "%s %s *%s\n", hexbuffer, +- buffer, buffer2) < 2) ++ (linebuf, "%s %s %s\n", hexbuffer, ++ buffer, buffer2) != 3) + continue; + } + +@@ -648,11 +648,11 @@ + key = pass2key(algorithm, keymode_buffer, &keylen, password, plen); + + } else { +- if (sscanf(linebuf, "%s %s\n", buffer, buffer2) == +- 0) { ++ if (sscanf(linebuf, "%s *%s\n", buffer, buffer2) != ++ 2) { + if (sscanf +- (linebuf, "%s *%s\n", buffer, +- buffer2) == 0) ++ (linebuf, "%s %s\n", buffer, ++ buffer2) != 2) + continue; + } + diff --git a/app-crypt/shash/files/shash-0.2.6-format-security.patch b/app-crypt/shash/files/shash-0.2.6-format-security.patch new file mode 100644 index 000000000000..4e46639e2807 --- /dev/null +++ b/app-crypt/shash/files/shash-0.2.6-format-security.patch @@ -0,0 +1,28 @@ +--- shash-0.2.6/src/errors.c ++++ shash-0.2.6/src/errors.c +@@ -4,7 +4,7 @@ + + void err_quit(char *errmsg) + { +- fprintf(stderr, errmsg); ++ fputs(errmsg, stderr); + exit(-1); + } + +@@ -12,7 +12,7 @@ + { + + if (quiet < 1) { +- fprintf(stderr, errmsg); ++ fputs(errmsg, stderr); + } + + } +@@ -20,6 +20,6 @@ + void err_crit(char *errmsg) + { + if (quiet <= 2) { +- fprintf(stderr, errmsg); ++ fputs(errmsg, stderr); + } + } diff --git a/app-crypt/shash/files/shash.bash-completion b/app-crypt/shash/files/shash.bash-completion new file mode 100644 index 000000000000..15a677dce5ba --- /dev/null +++ b/app-crypt/shash/files/shash.bash-completion @@ -0,0 +1,38 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# +# shash(1) completion. + +_shash() { + local cur prev + + COMPREPLY=() + cur=${COMP_WORDS[COMP_CWORD]} + prev=${COMP_WORDS[COMP_CWORD-1]} + + case "${prev}" in + -c|--config) + _filedir + return 0 ;; + -o|--keymode) + COMPREPLY=( $( compgen -W "$( shash --listkeygen | tail -n +2 )" \ + -- ${cur} ) ) + return ;; + -a|--algorithm) + COMPREPLY=( $( compgen -W "$( shash --list )" \ + -- ${cur} ) ) + return ;; + *) + ;; + esac + + COMPREPLY=( $( compgen -W '-V -q -m -d -c -b -t -o -i -a -l -k -h -v \ + -L \ + --verbose --quiet --nosalt --time --hmac --doublecheck \ + --check --binary --text --keymode --config --algorithm \ + --list --key --listkeygen --help --version --license' \ + -- ${cur} ) ) + _filedir + return 0 +} +complete -F _shash ${filenames} shash -- cgit v1.2.3