summaryrefslogtreecommitdiff
path: root/regress/unittests/hostkeys/mktestdata.sh
diff options
context:
space:
mode:
Diffstat (limited to 'regress/unittests/hostkeys/mktestdata.sh')
-rw-r--r--regress/unittests/hostkeys/mktestdata.sh16
1 files changed, 4 insertions, 12 deletions
diff --git a/regress/unittests/hostkeys/mktestdata.sh b/regress/unittests/hostkeys/mktestdata.sh
index 36890ba11..5a46de990 100644
--- a/regress/unittests/hostkeys/mktestdata.sh
+++ b/regress/unittests/hostkeys/mktestdata.sh
@@ -1,11 +1,11 @@
1#!/bin/sh 1#!/bin/sh
2# $OpenBSD: mktestdata.sh,v 1.1 2015/02/16 22:18:34 djm Exp $ 2# $OpenBSD: mktestdata.sh,v 1.2 2017/04/30 23:33:48 djm Exp $
3 3
4set -ex 4set -ex
5 5
6cd testdata 6cd testdata
7 7
8rm -f rsa1* rsa* dsa* ecdsa* ed25519* 8rm -f rsa* dsa* ecdsa* ed25519*
9rm -f known_hosts* 9rm -f known_hosts*
10 10
11gen_all() { 11gen_all() {
@@ -13,13 +13,12 @@ gen_all() {
13 _ecdsa_bits=256 13 _ecdsa_bits=256
14 test "x$_n" = "x1" && _ecdsa_bits=384 14 test "x$_n" = "x1" && _ecdsa_bits=384
15 test "x$_n" = "x2" && _ecdsa_bits=521 15 test "x$_n" = "x2" && _ecdsa_bits=521
16 ssh-keygen -qt rsa1 -b 1024 -C "RSA1 #$_n" -N "" -f rsa1_$_n
17 ssh-keygen -qt rsa -b 1024 -C "RSA #$_n" -N "" -f rsa_$_n 16 ssh-keygen -qt rsa -b 1024 -C "RSA #$_n" -N "" -f rsa_$_n
18 ssh-keygen -qt dsa -b 1024 -C "DSA #$_n" -N "" -f dsa_$_n 17 ssh-keygen -qt dsa -b 1024 -C "DSA #$_n" -N "" -f dsa_$_n
19 ssh-keygen -qt ecdsa -b $_ecdsa_bits -C "ECDSA #$_n" -N "" -f ecdsa_$_n 18 ssh-keygen -qt ecdsa -b $_ecdsa_bits -C "ECDSA #$_n" -N "" -f ecdsa_$_n
20 ssh-keygen -qt ed25519 -C "ED25519 #$_n" -N "" -f ed25519_$_n 19 ssh-keygen -qt ed25519 -C "ED25519 #$_n" -N "" -f ed25519_$_n
21 # Don't need private keys 20 # Don't need private keys
22 rm -f rsa1_$_n rsa_$_n dsa_$_n ecdsa_$_n ed25519_$_n 21 rm -f rsa_$_n dsa_$_n ecdsa_$_n ed25519_$_n
23} 22}
24 23
25hentries() { 24hentries() {
@@ -64,7 +63,6 @@ rm -f known_hosts_hash_frag.old
64 echo 63 echo
65 64
66 echo "# Revoked and CA keys" 65 echo "# Revoked and CA keys"
67 printf "@revoked sisyphus.example.com " ; cat rsa1_4.pub
68 printf "@revoked sisyphus.example.com " ; cat ed25519_4.pub 66 printf "@revoked sisyphus.example.com " ; cat ed25519_4.pub
69 printf "@cert-authority prometheus.example.com " ; cat ecdsa_4.pub 67 printf "@cert-authority prometheus.example.com " ; cat ecdsa_4.pub
70 printf "@cert-authority *.example.com " ; cat dsa_4.pub 68 printf "@cert-authority *.example.com " ; cat dsa_4.pub
@@ -72,19 +70,13 @@ rm -f known_hosts_hash_frag.old
72 printf "\n" 70 printf "\n"
73 echo "# Some invalid lines" 71 echo "# Some invalid lines"
74 # Invalid marker 72 # Invalid marker
75 printf "@what sisyphus.example.com " ; cat rsa1_1.pub 73 printf "@what sisyphus.example.com " ; cat dsa_1.pub
76 # Key missing 74 # Key missing
77 echo "sisyphus.example.com " 75 echo "sisyphus.example.com "
78 # Key blob missing 76 # Key blob missing
79 echo "prometheus.example.com ssh-ed25519 " 77 echo "prometheus.example.com ssh-ed25519 "
80 # Key blob truncated 78 # Key blob truncated
81 echo "sisyphus.example.com ssh-dsa AAAATgAAAAdz" 79 echo "sisyphus.example.com ssh-dsa AAAATgAAAAdz"
82 # RSA1 key truncated after key bits
83 echo "prometheus.example.com 1024 "
84 # RSA1 key truncated after exponent
85 echo "sisyphus.example.com 1024 65535 "
86 # RSA1 key incorrect key bits
87 printf "prometheus.example.com 1025 " ; cut -d' ' -f2- < rsa1_1.pub
88 # Invalid type 80 # Invalid type
89 echo "sisyphus.example.com ssh-XXX AAAATgAAAAdzc2gtWFhYAAAAP0ZVQ0tPRkZGVUNLT0ZGRlVDS09GRkZVQ0tPRkZGVUNLT0ZGRlVDS09GRkZVQ0tPRkZGVUNLT0ZGRlVDS09GRg==" 81 echo "sisyphus.example.com ssh-XXX AAAATgAAAAdzc2gtWFhYAAAAP0ZVQ0tPRkZGVUNLT0ZGRlVDS09GRkZVQ0tPRkZGVUNLT0ZGRlVDS09GRkZVQ0tPRkZGVUNLT0ZGRlVDS09GRg=="
90 # Type mismatch with blob 82 # Type mismatch with blob