summaryrefslogtreecommitdiff
path: root/regress/usr.bin/ssh/keygen-change.sh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2002-07-16 09:14:07 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2002-07-16 09:14:07 +0000
commit1e408212f76cc6002ff198a3b83971fd82ec9068 (patch)
tree7121e44b41d4f6b04ef966ec62842a34398773bf /regress/usr.bin/ssh/keygen-change.sh
parent9b97c81d9deafdeb34a91f3d1ce51bbe94d50651 (diff)
test ssh-keygen -p (change passphrase for key)
Diffstat (limited to 'regress/usr.bin/ssh/keygen-change.sh')
-rw-r--r--regress/usr.bin/ssh/keygen-change.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/regress/usr.bin/ssh/keygen-change.sh b/regress/usr.bin/ssh/keygen-change.sh
new file mode 100644
index 00000000000..6262ad0f0ee
--- /dev/null
+++ b/regress/usr.bin/ssh/keygen-change.sh
@@ -0,0 +1,23 @@
+# $OpenBSD: keygen-change.sh,v 1.1 2002/07/16 09:14:06 markus Exp $
+# Placed in the Public Domain.
+
+tid="change passphrase for key"
+
+S1="secret1"
+S2="2secret"
+
+for t in rsa dsa rsa1; do
+ # generate user key for agent
+ trace "generating $t key"
+ rm -f $OBJ/$t-key
+ ${SSHKEYGEN} -q -N ${S1} -t $t -f $OBJ/$t-key
+ if [ $? -eq 0 ]; then
+ ${SSHKEYGEN} -p -P ${S1} -N ${S2} -f $OBJ/$t-key > /dev/null
+ if [ $? -ne 0 ]; then
+ fail "ssh-keygen -p failed for $t-key"
+ fi
+ else
+ fail "ssh-keygen for $t-key failed"
+ fi
+ rm -f $OBJ/$t-key
+done