From e514b78676604f3b89a969f2ee364e9a0a65ba42 Mon Sep 17 00:00:00 2001 From: bviktor Date: Fri, 27 Jan 2017 00:49:00 +0100 Subject: [PATCH] Redundancy is bad mmkay? --- hpkpinx.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hpkpinx.sh b/hpkpinx.sh index 520041b..969e933 100644 --- a/hpkpinx.sh +++ b/hpkpinx.sh @@ -16,10 +16,11 @@ generate_pin () set -e if [ ${USE_RSA} -eq 1 ] then - PIN=$(openssl rsa -in ${1} -pubout 2>/dev/null | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64) + ALGO='rsa' else - PIN=$(openssl ec -in ${1} -pubout 2>/dev/null | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64) + ALGO='ec' fi + PIN=$(openssl ${ALGO} -in ${1} -pubout 2>/dev/null | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | base64) if [ ${PIN} == '47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=' ] then echo -n 'MISSING KEY!'