mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-22 12:35:13 +00:00
Add GPG recipient support when generating a new tomb key
This commit is contained in:
parent
db7109da4a
commit
902860fd9f
13
tomb
13
tomb
@ -1139,6 +1139,7 @@ gen_key() {
|
||||
tombpass=""
|
||||
tombpasstmp=""
|
||||
|
||||
{ ! option_is_set -r } && {
|
||||
if [ "$1" = "" ]; then
|
||||
while true; do
|
||||
# 3 tries to write two times a matching password
|
||||
@ -1194,17 +1195,23 @@ gen_key() {
|
||||
header="_KDF_pbkdf2sha1_${pbkdf2_salt}_${pbkdf2_iter}_64\n"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
print $header
|
||||
}
|
||||
|
||||
_tmp_create
|
||||
local tmpres=$TOMBTMP
|
||||
|
||||
if option_is_set -r; then
|
||||
print -n - "${tombpass}\n$TOMBSECRET" \
|
||||
| gpg --openpgp --force-mdc --cipher-algo ${algo} --batch \
|
||||
--no-options --no-tty --recipient `option_value -r` \
|
||||
--status-fd 2 -o - --encrypt --armor 2> $tmpres
|
||||
else
|
||||
print -n - "${tombpass}\n$TOMBSECRET" \
|
||||
| gpg --openpgp --force-mdc --cipher-algo ${algo} --batch \
|
||||
--no-options --no-tty --passphrase-fd 0 \
|
||||
--status-fd 2 -o - -c -a 2> $tmpres
|
||||
--status-fd 2 -o - --symmetric --armor 2> $tmpres
|
||||
fi
|
||||
# check result of gpg operation
|
||||
for i in ${(f)"$(cat $tmpres)"}; do
|
||||
_verbose "$i"
|
||||
|
Loading…
Reference in New Issue
Block a user