From 1ba3c552417a4e239f4ed9e3f3fc3d132d525551 Mon Sep 17 00:00:00 2001 From: James Reed Date: Sat, 3 Nov 2018 15:15:48 -0600 Subject: [PATCH] Check for KDF header in is_valid_key --- tomb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tomb b/tomb index 7612c0b..3acdc07 100755 --- a/tomb +++ b/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 }