summaryrefslogtreecommitdiffstats
path: root/certs/gencerts.sh
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2016-03-28 01:07:44 +0300
committerGuilhem Moulin <guilhem@fripost.org>2016-03-28 01:07:50 +0300
commitf81d8c68ba20100c13859ed522c41bed4f27d88b (patch)
tree776d43b0613a47c023f4cdbc1dc0338a39a0387d /certs/gencerts.sh
parent67689b1deb57def7c2512b59ad911bc94ae78aa3 (diff)
gencerts.sh: typo
Diffstat (limited to 'certs/gencerts.sh')
-rwxr-xr-xcerts/gencerts.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/certs/gencerts.sh b/certs/gencerts.sh
index 9c25f6c..ac28eeb 100755
--- a/certs/gencerts.sh
+++ b/certs/gencerts.sh
@@ -19,41 +19,41 @@ usage() {
x509fpr() {
local msg="$1" host cert h spki
host="${msg%%,*}"; host="${host%% *}"; host="${host#\`}"
cert="$DIR/${host%%:*}.pem"
spki=$(openssl x509 -noout -pubkey<"$cert" | openssl pkey -pubin -outform DER | openssl dgst -sha1 | sed -nr 's/^[^=]+=\s*//p')
[ "$typ" = mdwn ] && printf '\n [[%s|https://crt.sh/?spkisha1=%s&iCAID=16418]]\n\n' "$msg" "$spki" \
|| printf ' %s\n X.509: https://crt.sh/?spkisha1=%s&iCAID=16418\n SPKI:\n' \
"$( echo "$msg" | tr -d '`' )" "$spki"
for h in sha1 sha256; do
[ "$typ" = mdwn ] || echo -n ' '
echo -n "$h" | tr '[a-z]' '[A-Z]'
for i in $(seq 1 $((7 - ${#h}))); do echo -n ' '; done
openssl x509 -noout -pubkey<"$cert" | openssl pkey -pubin -outform DER | openssl dgst -"$h" -c | sed -nr 's/^[^=]+=\s*//p'
done | sed -r "s/(\S+)(.*)/$indent\1\U\2/"
}
sshfpr() {
local msg="$1" host t h fpr
host="${msg%%,*}"; host="${host%% *}"; host="${host#*@}"; host="${host#\`}"; host="${host%\`}"
- [ "$typ" = mdwn ] && { echo; echo " $msg"; echo; } || { echo " $msg" | tr -d '`'; }
+ [ "$typ" = mdwn ] && { echo; echo " $msg"; echo; } || { echo " $msg" | tr -d '`'; }
[ "${host#*:}" != 22 ] || host="${host%%:*}"
for h in MD5 SHA256; do
ssh-keygen -E "$h" -f "$DIR/../ssh_known_hosts" -lF "${host#*@}"
done | sed -nr 's/^[^ #]+\s+//p' | sed -r 's/^(\S+)\s+(MD5|SHA256):/\1 \2 /' |
while read t h fpr; do
echo -n "$indent$t"
for i in $(seq 1 $((7 - ${#h}))); do echo -n ' '; done
echo "$h:$fpr"
done
}
allfpr() {
local typ="$1"
[ "$typ" = mdwn ] && indent=' ' || indent=' '
cat <<- EOF
* IMAP server
$(x509fpr '`imap.fripost.org:993` (IMAP over SSL), `sieve.fripost.org:4190` (ManageSieve, `STARTTLS`)')
* SMTP servers
$(x509fpr '`smtp.fripost.org:587` (Mail Submission Agent, `STARTTLS`)')