xref: /freebsd/crypto/openssh/regress/keygen-sshfp.sh (revision 924226fba12cc9a228c73b956e1b7fa24c60b055)
1#	$OpenBSD: keygen-sshfp.sh,v 1.2 2021/07/19 02:29:28 dtucker Exp $
2#	Placed in the Public Domain.
3
4tid="keygen-sshfp"
5
6trace "keygen fingerprints"
7fp=`${SSHKEYGEN} -r test -f ${SRC}/ed25519_openssh.pub | \
8    awk '$5=="1"{print $6}'`
9if [ "$fp" != "8a8647a7567e202ce317e62606c799c53d4c121f" ]; then
10	fail "keygen fingerprint sha1"
11fi
12fp=`${SSHKEYGEN} -r test -f ${SRC}/ed25519_openssh.pub | \
13    awk '$5=="2"{print $6}'`
14if [ "$fp" != \
15    "54a506fb849aafb9f229cf78a94436c281efcb4ae67c8a430e8c06afcb5ee18f" ]; then
16	fail "keygen fingerprint sha256"
17fi
18
19if ${SSH} -Q key-plain | grep ssh-rsa >/dev/null; then
20	fp=`${SSHKEYGEN} -r test -f ${SRC}/rsa_openssh.pub | awk '$5=="1"{print $6}'`
21	if [ "$fp" != "99c79cc09f5f81069cc017cdf9552cfc94b3b929" ]; then
22		fail "keygen fingerprint sha1"
23	fi
24	fp=`${SSHKEYGEN} -r test -f ${SRC}/rsa_openssh.pub | awk '$5=="2"{print $6}'`
25	if [ "$fp" != \
26	    "e30d6b9eb7a4de495324e4d5870b8220577993ea6af417e8e4a4f1c5bf01a9b6" ]; then
27		fail "keygen fingerprint sha256"
28	fi
29fi
30