Importing gpg full public keys from the control panel
This commit is contained in:
parent
8f13c6e193
commit
7f8609a3aa
|
@ -439,7 +439,7 @@ function add_gpg_key {
|
|||
trap "rm -f $data" 0 1 2 5 15
|
||||
dialog --title $"Add someone's PGP/GPG key" \
|
||||
--backtitle $"Freedombone User Control Panel" \
|
||||
--inputbox $"Enter their email address or Key ID below" 8 60 2>$data
|
||||
--inputbox $"Enter their email address, Key ID or full key below" 8 60 2>$data
|
||||
sel=$?
|
||||
case $sel in
|
||||
0)
|
||||
|
@ -448,18 +448,29 @@ function add_gpg_key {
|
|||
|
||||
address_is_valid=
|
||||
|
||||
if [[ $ADD_EMAIL_ADDRESS == *"@"* && $ADD_EMAIL_ADDRESS == *"."* ]]; then
|
||||
if [[ "$ADD_EMAIL_ADDRESS" == *"@"* && "$ADD_EMAIL_ADDRESS" == *"."* ]]; then
|
||||
address_is_valid=1
|
||||
else
|
||||
if [[ $ADD_EMAIL_ADDRESS == "0x"* ]]; then
|
||||
address_is_valid=1
|
||||
fi
|
||||
fi
|
||||
if [[ "$ADD_EMAIL_ADDRESS" == "0x"* ]]; then
|
||||
address_is_valid=1
|
||||
fi
|
||||
publicstr=$"BEGIN PGP PUBLIC KEY BLOCK"
|
||||
if [[ "$ADD_EMAIL_ADDRESS" == *"$publicstr"* ]]; then
|
||||
address_is_valid=1
|
||||
fi
|
||||
|
||||
|
||||
if [ $address_is_valid ]; then
|
||||
clear
|
||||
gpg --search-keys "$ADD_EMAIL_ADDRESS"
|
||||
gpg_set_trust "$ADD_EMAIL_ADDRESS"
|
||||
if [[ "$ADD_EMAIL_ADDRESS" == *"$publicstr"* ]]; then
|
||||
echo "$ADD_EMAIL_ADDRESS" | gpg --import
|
||||
dialog --title $"Add someone's PGP/GPG key" \
|
||||
--backtitle $"Freedombone User Control Panel" \
|
||||
--msgbox $"GPG public key was imported" 6 50
|
||||
else
|
||||
gpg --search-keys "$ADD_EMAIL_ADDRESS"
|
||||
gpg_set_trust "$ADD_EMAIL_ADDRESS"
|
||||
fi
|
||||
else
|
||||
dialog --title $"Unrecognised email address" \
|
||||
--backtitle $"Freedombone User Control Panel" \
|
||||
|
|
Loading…
Reference in New Issue