mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-22 04:25:12 +00:00
Check for KDF header in is_valid_key
This commit is contained in:
parent
629841c0e7
commit
1ba3c55241
8
tomb
8
tomb
@ -921,6 +921,14 @@ is_valid_key() {
|
||||
_message "Key is an image, it might be valid."
|
||||
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" ]] && {
|
||||
_message "Key is valid."
|
||||
return 0 }
|
||||
|
Loading…
Reference in New Issue
Block a user