From b9f350ee20251746c540ff352e7082e66b9c5ac8 Mon Sep 17 00:00:00 2001 From: kaotisk Date: Fri, 26 Jul 2024 01:44:31 +0300 Subject: ak-gpg: new flag --verify-file --- lib/_ak_gpg | 17 +++++++++++++++++ lib/_ak_zblock | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/_ak_gpg b/lib/_ak_gpg index af65fcb..b381067 100755 --- a/lib/_ak_gpg +++ b/lib/_ak_gpg @@ -149,6 +149,23 @@ _ak_gpg_encrypt_for_self(){ fi } +_ak_gpg_verify_clear_signature(){ + if [ ! -z $1 ] && [ -n "$1" ] && [ -f "$1" ] + then + fingerprint="$(cat $1 | _ak_gpg 2>&1 | grep RSA | awk '{print $5}')" + if [ $? -ne 0 ] + then + _ak_log_error "Could not verify signature" + exit 1 + fi + _ak_log_debug "$1 signed with $fingerprint" + cat $1 | _ak_gpg 2> /dev/null + else + _ak_log_error "Failed to verify detached signature $1 against $2" + exit 1 + fi +} + _ak_gpg_verify_signature(){ if [ ! -z $1 ] && [ -n "$1" ] && [ -f "$1" ] && [ ! -z $2 ] && [ -n "$2" ] && [ -f "$2" ] then diff --git a/lib/_ak_zblock b/lib/_ak_zblock index 73f5f9e..6657c25 100755 --- a/lib/_ak_zblock +++ b/lib/_ak_zblock @@ -685,7 +685,7 @@ _ak_zblock_repack(){ } _ak_zblock_pack(){ - if [ ! -z $2 ]; + if [ ! -z $2 ] then MESSAGE="$2" ACTION="$1" -- cgit v1.2.3