mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-29 00:06:38 +00:00
fix to key password verification
last minute bug slipped in: it doesn't recognizes correct passwords in some strange situations where gnupg doesn't returns correctly (for instance when a .gnupg dir is not found in home)
This commit is contained in:
parent
8ad87f2233
commit
361a194700
15
tomb
15
tomb
@ -600,12 +600,16 @@ get_lukskey() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
res=`safe_filename tomb.open`
|
||||||
|
(( $? )) && { unset tombpass; die "error creating temp dir" }
|
||||||
|
|
||||||
print ${tombpass} | \
|
print ${tombpass} | \
|
||||||
gpg --batch --passphrase-fd 0 --no-tty --no-options --status-fd 2 \
|
gpg --batch --passphrase-fd 0 --no-tty --no-options --status-fd 2 \
|
||||||
-d "${keyfile}" 2> /dev/null
|
-d "${keyfile}" 2>$res
|
||||||
ret=$?
|
|
||||||
xxx "gpg decryption returns $ret"
|
|
||||||
unset tombpass
|
unset tombpass
|
||||||
|
grep 'DECRYPTION_OKAY' $res
|
||||||
|
ret=$?; rm -f $res
|
||||||
|
xxx "get_lukskey returns $ret"
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -983,10 +987,9 @@ lock_tomb_with_key() {
|
|||||||
tombname=${tombfile%%\.*}
|
tombname=${tombfile%%\.*}
|
||||||
tombfile=${tombname}.tomb
|
tombfile=${tombname}.tomb
|
||||||
|
|
||||||
if ! [ -e ${tombdir}/${tombfile} ]; then
|
{ test -f ${tombdir}/${tombfile} } || {
|
||||||
die "There is no tomb here. You have to it dig first."
|
die "There is no tomb here. You have to it dig first."
|
||||||
return 1
|
return 1 }
|
||||||
fi
|
|
||||||
|
|
||||||
xxx "tomb found: ${tombdir}/${tombfile}"
|
xxx "tomb found: ${tombdir}/${tombfile}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user