From 42dd39666e32124265132c49843d77f34aaa1943 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 6 Jun 2018 19:47:20 -0300 Subject: Fix passphrase entry at genpairs when exporting secret keys; fix ChangeLog dates --- lib/keyringer/actions/genkeys | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/keyringer/actions/genkeys b/lib/keyringer/actions/genkeys index deacbfd..e086891 100755 --- a/lib/keyringer/actions/genkeys +++ b/lib/keyringer/actions/genkeys @@ -66,8 +66,11 @@ function genkeys_gpg { EOF # Encrypt the result + # See https://superuser.com/questions/1135812/gpg2-asking-for-passphrase-when-importing-secret-keys#1135950 + # https://stackoverflow.com/questions/49072403/suppress-the-passphrase-prompt-in-gpg-command + # https://dev.gnupg.org/T2313 echo "Encrypting secret key into keyringer..." - $GPG --armor --homedir "$TMPWORK" --export-secret-keys | keyringer_exec encrypt "$BASEDIR" "$FILE" + echo -e "${passphrase}\n" | $GPG --armor --homedir "$TMPWORK" --passphrase-fd 0 --batch --no-tty --pinentry-mode=loopback --export-secret-keys | keyringer_exec encrypt "$BASEDIR" "$FILE" echo "Encrypting public key into keyringer..." $GPG --armor --homedir "$TMPWORK" --export | keyringer_exec encrypt "$BASEDIR" "$FILE.pub" #echo "Encrypting passphrase into keyringer..." @@ -76,8 +79,8 @@ EOF if [ ! -z "$OUTFILE" ]; then mkdir -p `dirname $OUTFILE` printf "Saving copies at %s and %s.pub\n" "$OUTFILE" "$OUTFILE" - $GPG --armor --homedir "$TMPWORK" --export-secret-keys > "$OUTFILE" - $GPG --armor --homedir "$TMPWORK" --export > "$OUTFILE.pub" + echo -e "${passphrase}\n" | $GPG --armor --homedir "$TMPWORK" --passphrase-fd 0 --batch --no-tty --pinentry-mode=loopback --export-secret-keys > "$OUTFILE" + $GPG --armor --homedir "$TMPWORK" --export > "$OUTFILE.pub" fi echo "Done" -- cgit v1.2.3 From a62bb9bb190df115327d85e0f24b418ee10f4785 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Wed, 6 Jun 2018 19:47:59 -0300 Subject: Remove Name-Comment from genkeys_gpg TODO --- lib/keyringer/actions/genkeys | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/keyringer/actions/genkeys b/lib/keyringer/actions/genkeys index e086891..addd10d 100755 --- a/lib/keyringer/actions/genkeys +++ b/lib/keyringer/actions/genkeys @@ -52,7 +52,7 @@ function genkeys_gpg { passphrase="`keyringer_exec decrypt "$BASEDIR" "$FILE.passwd"`" # TODO: insert random bytes - # TODO: custom Name-Comment and Name-Email + # TODO: custom Name-Email $GPG --homedir "$TMPWORK" --gen-key --batch < Date: Sat, 16 Jun 2018 21:23:35 -0300 Subject: Adds history support at shell action --- ChangeLog | 4 +++- lib/keyringer/actions/shell | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/ChangeLog b/ChangeLog index 1d0b4e6..1672236 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -2010-06-06 - unreleased - Silvio Rhatto +2010-06-16 - unreleased - Silvio Rhatto + + Adds history support at shell action Fix passphrase entry at genpairs when exporting secret keys diff --git a/lib/keyringer/actions/shell b/lib/keyringer/actions/shell index 3b98d68..d87a638 100755 --- a/lib/keyringer/actions/shell +++ b/lib/keyringer/actions/shell @@ -15,6 +15,8 @@ keyringer_usage $KEYRING # While a "quit" command isn't entered, read STDIN while read -rep "keyringer:/${KEYRING}${SHELLPATH}> " STDIN; do + history -s "$STDIN" + if [ "$STDIN" == "quit" ] || [ "$STDIN" == "exit" ] || [ "$STDIN" == "bye" ]; then break elif [ "$STDIN" == "shell" ]; then -- cgit v1.2.3 From 0503cd47d8648fcd70edc57c0d7e25c9c4bc73b0 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 24 Jan 2019 18:31:50 -0200 Subject: Use --no-encrypt-to GnuPG option to strictly respect the recipients file --- ChangeLog | 4 +++- lib/keyringer/functions | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/ChangeLog b/ChangeLog index e63baa8..3f6ccfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -2018-10-17 - unreleased - Silvio Rhatto +2019-01-29 - unreleased - Silvio Rhatto + + Use --no-encrypt-to GnuPG option to strictly respect the recipients file Fixes BASEDIR evaluation at init action diff --git a/lib/keyringer/functions b/lib/keyringer/functions index d529daf..308d0ea 100755 --- a/lib/keyringer/functions +++ b/lib/keyringer/functions @@ -314,9 +314,9 @@ function keyringer_set_env { fi if [ ! -z "$KEYID" ]; then - GPG="gpg --quiet -u $KEYID" + GPG="gpg --quiet --no-encrypt-to -u $KEYID" else - GPG="gpg --quiet" + GPG="gpg --quiet --no-encrypt-to" fi # Check keyring config version -- cgit v1.2.3