external backends genKey and verifyKeyContent implemented

Only key translation for HasExt remains..
This commit is contained in:
Joey Hess 2020-07-29 16:35:14 -04:00
parent f75be32166
commit b6fa4cb42f
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 106 additions and 44 deletions

View file

@ -11,7 +11,7 @@ hashfile () {
local contentfile="$1"
# could send PROGRESS while doing this, but it's
# hard to implement that in shell
return "$(md5sum "$contentfile" | cut -d ' ' -f 1 || echo '')"
md5sum "$contentfile" | cut -d ' ' -f 1 || echo ''
}
while read line; do
@ -45,7 +45,7 @@ while read line; do
contentfile="$3"
hash=$(hashfile "$contentfile")
khash=$(echo "$key" | sed 's/.*--//')
if [ "$hash" == "$khash" ]; then
if [ "$hash" = "$khash" ]; then
echo "VERIFYKEYCONTENT-SUCCESS"
else
echo "VERIFYKEYCONTENT-FAILURE"