Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/external/bsd/netpgp/dist check both host and user ssh...



details:   https://anonhg.NetBSD.org/src/rev/f82612d65cd8
branches:  trunk
changeset: 755973:f82612d65cd8
user:      agc <agc%NetBSD.org@localhost>
date:      Thu Jul 01 03:51:07 2010 +0000

description:
check both host and user ssh keys match the host and user keys from netpgpkeys.

also echo the keys being compared

diffstat:

 crypto/external/bsd/netpgp/dist/tst |  17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diffs (34 lines):

diff -r da7a3b7e3946 -r f82612d65cd8 crypto/external/bsd/netpgp/dist/tst
--- a/crypto/external/bsd/netpgp/dist/tst       Thu Jul 01 02:38:26 2010 +0000
+++ b/crypto/external/bsd/netpgp/dist/tst       Thu Jul 01 03:51:07 2010 +0000
@@ -31,7 +31,7 @@
        su root -c "make install"'
 
 passed=0
-total=33
+total=34
 rm -f passed
 date > passed
 echo "======> sign/verify 180938 file"
@@ -164,10 +164,17 @@
 echo "======> ascii detached armoured sig detection and verification"
 /usr/bin/netpgp --verify i.asc && passed=$(expr $passed + 1)
 echo "32 " $passed >> passed
-echo "======> ssh fingerprint and netpgp fingerprint"
-/usr/bin/netpgpkeys --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub --list-keys --hash=md5
-/usr/bin/ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub 
-passed=$(expr $passed + 1)
+echo "======> host ssh fingerprint and netpgp fingerprint"
+netpgpkey=$(/usr/bin/netpgpkeys --ssh-keys --sshkeyfile=/etc/ssh/ssh_host_rsa_key.pub --list-keys --hash=md5 | awk 'NR == 3 { print $3 $4 $5 $6 $7 $8 $9 $10 }')
+sshkey=$(/usr/bin/ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub | awk '{ gsub(":", "", $2); print $2 }')
+echo "host sshkey \"$sshkey\" = netpgpkey \"$netpgpkey\""
+[ $sshkey = $netpgpkey ] && passed=$(expr $passed + 1)
 echo "33 " $passed >> passed
+echo "======> user ssh fingerprint and netpgp fingerprint"
+netpgpkey=$(/usr/bin/netpgpkeys --ssh-keys --sshkeyfile=/home/agc/.ssh/id_rsa.pub --list-keys --hash=md5 | awk 'NR == 3 { print $3 $4 $5 $6 $7 $8 $9 $10 }')
+sshkey=$(/usr/bin/ssh-keygen -l -f /home/agc/.ssh/id_rsa.pub | awk '{ gsub(":", "", $2); print $2 }')
+echo "user sshkey \"$sshkey\" = netpgpkey \"$netpgpkey\""
+[ $sshkey = $netpgpkey ] && passed=$(expr $passed + 1)
+echo "34 " $passed >> passed
 rm -f a a.gpg b b.gpg c c.gpg d d.gpg e f f.sig g g.asc g2 a2 a3 a4 a5 h h.sig i i.asc
 echo "Passed ${passed}/${total} tests"



Home | Main Index | Thread Index | Old Index