summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexandre Pujol <alexandre@pujol.io>2017-01-31 23:10:39 (GMT)
committer Alexandre Pujol <alexandre@pujol.io>2017-02-03 23:57:52 (GMT)
commit8f8dc0a0d4a088d77159d791d85e3cd8df434ec2 (patch)
treeffdb8f12b6d742ef17343b3ed25d06e23f361b0a
parentb23e9aa0280b6e27ccf1b4daf4467d39bfe46a56 (diff)
Improve exhumation of key when opening a tomb
-rwxr-xr-xtomb26
1 files changed, 14 insertions, 12 deletions
diff --git a/tomb b/tomb
index cd104bf..52dd73c 100755
--- a/tomb
+++ b/tomb
@@ -1014,20 +1014,22 @@ get_lukskey() {
# key needs to be exhumed from an image
elif [[ -r $TOMBKEYFILE && $(file $TOMBKEYFILE) =~ "JP.G" ]]; then
- # When using a GPG key, the tomb key is buried using a steganography password
- if option_is_set -r && option_is_set --tomb-pwd; then
- _password="`option_value --tomb-pwd`"
- _verbose "tomb-pwd = ::1 tomb pass::" $_password
- elif option_is_set -r; then
- _password=$(ask_password "Insert password to exhume key from $imagefile")
- [[ $? != 0 ]] && {
- _warning "User aborted password dialog."
- return 1
- }
- fi
- exhume_key $TOMBKEYFILE "$_password"
if option_is_set -r; then
+ # When using a GPG key, the tomb key is buried using a steganography password
+ if option_is_set --tomb-pwd; then
+ _password="`option_value --tomb-pwd`"
+ _verbose "tomb-pwd = ::1 tomb pass::" $_password
+ else
+ _password=$(ask_password "Insert password to exhume key from $imagefile")
+ [[ $? != 0 ]] && {
+ _warning "User aborted password dialog."
+ return 1
+ }
+ fi
+ exhume_key $TOMBKEYFILE "$_password"
unset _password
+ else
+ exhume_key $TOMBKEYFILE "$_password"
fi
fi