Check for KDF header in is_valid_key

This commit is contained in:
James Reed 2018-11-03 15:15:48 -06:00
parent 629841c0e7
commit 1ba3c55241
No known key found for this signature in database
GPG Key ID: 8F79994F6B8378C1

8
tomb
View File

@ -921,6 +921,14 @@ is_valid_key() {
_message "Key is an image, it might be valid." _message "Key is an image, it might be valid."
return 0 } return 0 }
[[ $KDF == 1 ]] && { ! option_is_set -g } && { option_is_set --kdf } && {
_head="${key[(f)1]}"
[[ $_head =~ '^_KDF_' ]] || {
_warning "Key is missing KDF header."
return 1
}
}
[[ $key =~ "BEGIN PGP" ]] && { [[ $key =~ "BEGIN PGP" ]] && {
_message "Key is valid." _message "Key is valid."
return 0 } return 0 }