summaryrefslogtreecommitdiffstats
path: root/certs
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-07-12 17:59:21 +0200
committerGuilhem Moulin <guilhem@fripost.org>2016-07-12 17:59:21 +0200
commitd6e53310cff9accffbbfbb60c97872da8ff9ecfc (patch)
tree9790ceaf2de72804e49d968aac3fdfd40e0ec5b5 /certs
parente8cdae5ccc1aba3dc1e9991cce2942fdf93cabcb (diff)
typo
Diffstat (limited to 'certs')
-rwxr-xr-xcerts/gencerts.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/certs/gencerts.sh b/certs/gencerts.sh
index 590fcfa..5a2975f 100755
--- a/certs/gencerts.sh
+++ b/certs/gencerts.sh
@@ -14,41 +14,41 @@ GPG_OPTS='--no-auto-check-trustdb --batch --no-verbose --yes'
usage() {
echo "Usage: $0 /path/to/certs.asc" >&2
exit 1
}
x509fpr() {
local msg="$1" host pub h spki
host="${msg%%,*}"; host="${host%% *}"; host="${host#\`}"
pub="$DIR/${host%%:*}.pub"
spki=$(openssl pkey -pubin -outform DER <"$pub" | openssl dgst -sha256 | sed -nr 's/^[^=]+=\s*//p')
[ "$typ" = mdwn ] && printf '\n [%s](https://crt.sh/?spkisha256=%s&iCAID=16418&exclude=expired)\n\n' "$msg" "$spki" \
|| printf ' %s\n X.509: https://crt.sh/?spkisha256=%s&iCAID=16418&exclude=expired\n SPKI:\n' \
"$(printf '%s' "$msg" | tr -d '`' )" "$spki"
for h in sha1 sha256; do
x509fpr2 "$h" "$pub"
done
local backup=$(find "$DIR" -maxdepth 1 -type f -name "${host%%:*}.pub.back*")
if [ "$backup" -a "$typ" != mdwn ]; then
- echo " Backup SPKI:"
+ echo " Backup pubkey:"
for pub in $backup; do
x509fpr2 "$h" "$pub"
done
fi
}
x509fpr2() {
local h="$1" pub="$2" str dgst
[ "$typ" = mdwn ] && str= || str=' '
str="$str$(printf '%-6s' "$h" | tr '[a-z]' '[A-Z]')"
dgst="$(openssl pkey -pubin -outform DER <"$pub" | openssl dgst -"$h" -binary | base64)"
hd=$(printf '%s' "$dgst" | base64 -d | xxd -c256 -p | tr '[a-f]' '[A-F]' | sed -e 's/../&:/g' -e 's/:$//')
if [ $((${#indent} + ${#str} + 1 + ${#hd})) -le 72 ]; then
printf '%s %s\n' "$indent$str" "$hd"
else
printf '%s %s\n' "$indent$str" "$dgst"
fi
}
sshfpr() {