Skip to content
This repository has been archived by the owner on Jul 31, 2019. It is now read-only.

Commit

Permalink
Redundancy is bad mmkay?
Browse files Browse the repository at this point in the history
  • Loading branch information
bviktor authored Jan 26, 2017
1 parent 9046229 commit e514b78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions hpkpinx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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!'
Expand Down

0 comments on commit e514b78

Please sign in to comment.