From 6c0d89cab1ad970f3ff0848990332a4ae5044430 Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Mon, 30 Jan 2017 21:01:27 +0000 Subject: [PATCH] Use -r option to shortcut interactive tomb password popup --- tomb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) mode change 100644 => 100755 tomb diff --git a/tomb b/tomb old mode 100644 new mode 100755 index e168b65..4ade4f1 --- a/tomb +++ b/tomb @@ -889,7 +889,12 @@ _load_key() { [[ -z $keyfile ]] && { _failure "This operation requires a key file to be specified using the -k option." } - if [[ $keyfile == "-" ]]; then + if option_is_set -r; then + _verbose "load_key delegating password handling to GnuPG" + _message "Waiting for GnuPG to handle password authentication... " + TOMBKEYFILE=$keyfile + TOMBKEY="${mapfile[$TOMBKEYFILE]}" + elif [[ $keyfile == "-" ]]; then _verbose "load_key reading from stdin." _message "Waiting for the key to be piped from stdin... " TOMBKEYFILE=stdin @@ -1024,6 +1029,12 @@ ask_key_password() { _verbose "no password needed, using secret bytes from stdin" return 0 } + if option_is_set -r; then + _verbose "no password needed, using GPG key" + get_lukskey + return $? + fi + _message "A password is required to use key ::1 key::" $TOMBKEYFILE passok=0 tombpass=""