|
2 | 2 | # and signature algorithm, and checks whether the stock BoringSSL
|
3 | 3 | # client and server can establish a handshake with the choices.
|
4 | 4 |
|
| 5 | +import argparse |
5 | 6 | import os
|
6 | 7 | import random
|
7 | 8 | import subprocess
|
|
13 | 14 | kexs = [
|
14 | 15 | ##### OQS_TEMPLATE_FRAGMENT_LIST_ALL_KEXS_START
|
15 | 16 | "frodokem-640-aes-sha256",
|
16 |
| - # "ecdh-nistp256-frodokem-640-aesr2-sha256@openquantumsafe.org", |
| 17 | + "ecdh-nistp256-frodokem-640-aesr2-sha256@openquantumsafe.org", |
17 | 18 | "frodokem-976-aes-sha384",
|
18 |
| - # "ecdh-nistp384-frodokem-976-aesr2-sha384@openquantumsafe.org", |
| 19 | + "ecdh-nistp384-frodokem-976-aesr2-sha384@openquantumsafe.org", |
19 | 20 | "frodokem-1344-aes-sha512",
|
20 |
| - # "ecdh-nistp521-frodokem-1344-aesr2-sha512@openquantumsafe.org", |
| 21 | + "ecdh-nistp521-frodokem-1344-aesr2-sha512@openquantumsafe.org", |
21 | 22 | "frodokem-640-shake-sha256",
|
22 |
| - # "ecdh-nistp256-frodokem-640-shaker2-sha256@openquantumsafe.org", |
| 23 | + "ecdh-nistp256-frodokem-640-shaker2-sha256@openquantumsafe.org", |
23 | 24 | "frodokem-976-shake-sha384",
|
24 |
| - # "ecdh-nistp384-frodokem-976-shaker2-sha384@openquantumsafe.org", |
| 25 | + "ecdh-nistp384-frodokem-976-shaker2-sha384@openquantumsafe.org", |
25 | 26 | "frodokem-1344-shake-sha512",
|
26 |
| - # "ecdh-nistp521-frodokem-1344-shaker2-sha512@openquantumsafe.org", |
| 27 | + "ecdh-nistp521-frodokem-1344-shaker2-sha512@openquantumsafe.org", |
27 | 28 | "kyber-512-sha256",
|
28 |
| - # "ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org", |
| 29 | + "ecdh-nistp256-kyber-512r3-sha256-d00@openquantumsafe.org", |
29 | 30 | "kyber-768-sha384",
|
30 |
| - # "ecdh-nistp384-kyber-768r3-sha384-d00@openquantumsafe.org", |
| 31 | + "ecdh-nistp384-kyber-768r3-sha384-d00@openquantumsafe.org", |
31 | 32 | "kyber-1024-sha512",
|
32 |
| - # "ecdh-nistp521-kyber-1024r3-sha512-d00@openquantumsafe.org", |
| 33 | + "ecdh-nistp521-kyber-1024r3-sha512-d00@openquantumsafe.org", |
33 | 34 | "bike-l1-sha512",
|
34 |
| - # "ecdh-nistp256-bike-l1r3-sha512@openquantumsafe.org", |
| 35 | + "ecdh-nistp256-bike-l1r3-sha512@openquantumsafe.org", |
35 | 36 | "bike-l3-sha512",
|
36 |
| - # "ecdh-nistp384-bike-l3r3-sha512@openquantumsafe.org", |
| 37 | + "ecdh-nistp384-bike-l3r3-sha512@openquantumsafe.org", |
37 | 38 | "classic-mceliece-348864-sha256",
|
38 |
| - # "ecdh-nistp256-classic-mceliece-348864r4-sha256@openquantumsafe.org", |
| 39 | + "ecdh-nistp256-classic-mceliece-348864r4-sha256@openquantumsafe.org", |
39 | 40 | "classic-mceliece-348864f-sha256",
|
40 |
| - # "ecdh-nistp256-classic-mceliece-348864fr4-sha256@openquantumsafe.org", |
| 41 | + "ecdh-nistp256-classic-mceliece-348864fr4-sha256@openquantumsafe.org", |
41 | 42 | "classic-mceliece-460896-sha512",
|
42 |
| - # "ecdh-nistp384-classic-mceliece-460896r4-sha512@openquantumsafe.org", |
| 43 | + "ecdh-nistp384-classic-mceliece-460896r4-sha512@openquantumsafe.org", |
43 | 44 | "classic-mceliece-460896f-sha512",
|
44 |
| - # "ecdh-nistp384-classic-mceliece-460896fr4-sha512@openquantumsafe.org", |
| 45 | + "ecdh-nistp384-classic-mceliece-460896fr4-sha512@openquantumsafe.org", |
45 | 46 | "classic-mceliece-6688128-sha512",
|
46 |
| - # "ecdh-nistp521-classic-mceliece-6688128r4-sha512@openquantumsafe.org", |
| 47 | + "ecdh-nistp521-classic-mceliece-6688128r4-sha512@openquantumsafe.org", |
47 | 48 | "classic-mceliece-6688128f-sha512",
|
48 |
| - # "ecdh-nistp521-classic-mceliece-6688128fr4-sha512@openquantumsafe.org", |
| 49 | + "ecdh-nistp521-classic-mceliece-6688128fr4-sha512@openquantumsafe.org", |
49 | 50 | "classic-mceliece-6960119-sha512",
|
50 |
| - # "ecdh-nistp521-classic-mceliece-6960119r4-sha512@openquantumsafe.org", |
| 51 | + "ecdh-nistp521-classic-mceliece-6960119r4-sha512@openquantumsafe.org", |
51 | 52 | "classic-mceliece-6960119f-sha512",
|
52 |
| - # "ecdh-nistp521-classic-mceliece-6960119fr4-sha512@openquantumsafe.org", |
| 53 | + "ecdh-nistp521-classic-mceliece-6960119fr4-sha512@openquantumsafe.org", |
53 | 54 | "classic-mceliece-8192128-sha512",
|
54 |
| - # "ecdh-nistp521-classic-mceliece-8192128r4-sha512@openquantumsafe.org", |
| 55 | + "ecdh-nistp521-classic-mceliece-8192128r4-sha512@openquantumsafe.org", |
55 | 56 | "classic-mceliece-8192128f-sha512",
|
56 |
| - # "ecdh-nistp521-classic-mceliece-8192128fr4-sha512@openquantumsafe.org", |
| 57 | + "ecdh-nistp521-classic-mceliece-8192128fr4-sha512@openquantumsafe.org", |
57 | 58 | "hqc-128-sha256",
|
58 |
| - # "ecdh-nistp256-hqc-128r3-sha256@openquantumsafe.org", |
| 59 | + "ecdh-nistp256-hqc-128r3-sha256@openquantumsafe.org", |
59 | 60 | "hqc-192-sha384",
|
60 |
| - # "ecdh-nistp384-hqc-192r3-sha384@openquantumsafe.org", |
| 61 | + "ecdh-nistp384-hqc-192r3-sha384@openquantumsafe.org", |
61 | 62 | "hqc-256-sha512",
|
62 |
| - # "ecdh-nistp521-hqc-256r3-sha512@openquantumsafe.org", |
| 63 | + "ecdh-nistp521-hqc-256r3-sha512@openquantumsafe.org", |
63 | 64 | ##### OQS_TEMPLATE_FRAGMENT_LIST_ALL_KEXS_END
|
64 | 65 | ]
|
65 | 66 |
|
66 | 67 | sigs = [
|
67 | 68 | ##### OQS_TEMPLATE_FRAGMENT_LIST_ALL_SIGS_START
|
68 | 69 | "ssh-falcon512",
|
69 |
| - # "ssh-rsa3072-falcon512", |
70 |
| - # "ssh-ecdsa-nistp256-falcon512", |
| 70 | + "ssh-rsa3072-falcon512", |
| 71 | + "ssh-ecdsa-nistp256-falcon512", |
71 | 72 | "ssh-falcon1024",
|
72 |
| - # "ssh-ecdsa-nistp521-falcon1024", |
| 73 | + "ssh-ecdsa-nistp521-falcon1024", |
73 | 74 | "ssh-dilithium2",
|
74 |
| - # "ssh-rsa3072-dilithium2", |
75 |
| - # "ssh-ecdsa-nistp256-dilithium2", |
| 75 | + "ssh-rsa3072-dilithium2", |
| 76 | + "ssh-ecdsa-nistp256-dilithium2", |
76 | 77 | "ssh-dilithium3",
|
77 |
| - # "ssh-ecdsa-nistp384-dilithium3", |
| 78 | + "ssh-ecdsa-nistp384-dilithium3", |
78 | 79 | "ssh-dilithium5",
|
79 |
| - # "ssh-ecdsa-nistp521-dilithium5", |
| 80 | + "ssh-ecdsa-nistp521-dilithium5", |
80 | 81 | "ssh-sphincssha2128fsimple",
|
81 |
| - # "ssh-rsa3072-sphincssha2128fsimple", |
82 |
| - # "ssh-ecdsa-nistp256-sphincssha2128fsimple", |
| 82 | + "ssh-rsa3072-sphincssha2128fsimple", |
| 83 | + "ssh-ecdsa-nistp256-sphincssha2128fsimple", |
83 | 84 | "ssh-sphincssha2256fsimple",
|
84 |
| - # "ssh-ecdsa-nistp521-sphincssha2256fsimple", |
| 85 | + "ssh-ecdsa-nistp521-sphincssha2256fsimple", |
85 | 86 | ##### OQS_TEMPLATE_FRAGMENT_LIST_ALL_SIGS_END
|
86 | 87 | ]
|
87 | 88 |
|
@@ -131,8 +132,11 @@ def try_handshake(ssh, sshd, dorandom="random"):
|
131 | 132 | do_handshake(ssh, sshd, test_sig, test_kex)
|
132 | 133 |
|
133 | 134 | if __name__ == '__main__':
|
134 |
| - if len(sys.argv)==1: |
135 |
| - try_handshake(os.path.abspath('ssh'), os.path.abspath('sshd')) |
136 |
| - else: |
137 |
| - try_handshake(os.path.abspath('ssh'), os.path.abspath('sshd'), dorandom=sys.argv[1]) |
| 135 | + parser = argparse.ArgumentParser(description="Test connections between ssh and sshd using PQ algorithms.") |
| 136 | + parser.add_argument("--ssh", default=os.path.abspath('ssh'), type=str, help="Override the ssh binary.") |
| 137 | + parser.add_argument("--sshd", default=os.path.abspath('sshd'), type=str, help="Override the sshd binary.") |
| 138 | + parser.add_argument("dorandom", type=str, default="random", choices=["doall", "doone", "random"], |
| 139 | + help="Slice of test cases to run.") |
| 140 | + args = parser.parse_args() |
| 141 | + try_handshake(args.ssh, args.sshd, args.dorandom) |
138 | 142 |
|
0 commit comments