2
0

80-test_ssl_old.t 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. #! /usr/bin/env perl
  2. # Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
  3. #
  4. # Licensed under the Apache License 2.0 (the "License"). You may not use
  5. # this file except in compliance with the License. You can obtain a copy
  6. # in the file LICENSE in the source distribution or at
  7. # https://www.openssl.org/source/license.html
  8. use strict;
  9. use warnings;
  10. use POSIX;
  11. use File::Basename;
  12. use File::Copy;
  13. use OpenSSL::Test qw/:DEFAULT with bldtop_file bldtop_dir srctop_file srctop_dir cmdstr/;
  14. use OpenSSL::Test::Utils;
  15. BEGIN {
  16. setup("test_ssl");
  17. }
  18. use lib srctop_dir('Configurations');
  19. use lib bldtop_dir('.');
  20. use platform;
  21. my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
  22. my $infile = bldtop_file('providers', platform->dso('fips'));
  23. my ($no_rsa, $no_dsa, $no_dh, $no_ec, $no_psk,
  24. $no_ssl3, $no_tls1, $no_tls1_1, $no_tls1_2, $no_tls1_3,
  25. $no_dtls, $no_dtls1, $no_dtls1_2, $no_ct) =
  26. anydisabled qw/rsa dsa dh ec psk
  27. ssl3 tls1 tls1_1 tls1_2 tls1_3
  28. dtls dtls1 dtls1_2 ct/;
  29. my $no_anytls = alldisabled(available_protocols("tls"));
  30. my $no_anydtls = alldisabled(available_protocols("dtls"));
  31. plan skip_all => "No SSL/TLS/DTLS protocol is support by this OpenSSL build"
  32. if $no_anytls && $no_anydtls;
  33. my $digest = "-sha1";
  34. my @reqcmd = ("openssl", "req");
  35. my @x509cmd = ("openssl", "x509", $digest);
  36. my @verifycmd = ("openssl", "verify");
  37. my @genpkeycmd = ("openssl", "genpkey");
  38. my $dummycnf = srctop_file("apps", "openssl.cnf");
  39. my $cnf = srctop_file("test", "ca-and-certs.cnf");
  40. my $CAkey = "keyCA.ss";
  41. my $CAcert="certCA.ss";
  42. my $CAserial="certCA.srl";
  43. my $CAreq="reqCA.ss";
  44. my $CAreq2="req2CA.ss"; # temp
  45. my $Ukey="keyU.ss";
  46. my $Ureq="reqU.ss";
  47. my $Ucert="certU.ss";
  48. my $Dkey="keyD.ss";
  49. my $Dreq="reqD.ss";
  50. my $Dcert="certD.ss";
  51. my $Ekey="keyE.ss";
  52. my $Ereq="reqE.ss";
  53. my $Ecert="certE.ss";
  54. my $proxycnf=srctop_file("test", "proxy.cnf");
  55. my $P1key="keyP1.ss";
  56. my $P1req="reqP1.ss";
  57. my $P1cert="certP1.ss";
  58. my $P1intermediate="tmp_intP1.ss";
  59. my $P2key="keyP2.ss";
  60. my $P2req="reqP2.ss";
  61. my $P2cert="certP2.ss";
  62. my $P2intermediate="tmp_intP2.ss";
  63. my $server_sess="server.ss";
  64. my $client_sess="client.ss";
  65. # ssltest_old.c is deprecated in favour of the new framework in ssl_test.c
  66. # If you're adding tests here, you probably want to convert them to the
  67. # new format in ssl_test.c and add recipes to 80-test_ssl_new.t instead.
  68. plan tests =>
  69. ($no_fips ? 0 : 1 + 5) # For fipsinstall + testssl with fips provider
  70. + 1 # For testss
  71. + 5 # For the testssl with default provider
  72. ;
  73. unless ($no_fips) {
  74. ok(run(app(['openssl', 'fipsinstall',
  75. '-out', bldtop_file('providers', 'fipsmodule.cnf'),
  76. '-module', $infile])),
  77. "fipsinstall");
  78. }
  79. subtest 'test_ss' => sub {
  80. if (testss()) {
  81. open OUT, ">", "intP1.ss";
  82. copy($CAcert, \*OUT); copy($Ucert, \*OUT);
  83. close OUT;
  84. open OUT, ">", "intP2.ss";
  85. copy($CAcert, \*OUT); copy($Ucert, \*OUT); copy($P1cert, \*OUT);
  86. close OUT;
  87. }
  88. };
  89. note('test_ssl -- key U');
  90. testssl("keyU.ss", $Ucert, $CAcert, "default", srctop_file("test","default.cnf"));
  91. unless ($no_fips) {
  92. testssl("keyU.ss", $Ucert, $CAcert, "fips",
  93. srctop_file("test","fips-and-base.cnf"));
  94. }
  95. # -----------
  96. # subtest functions
  97. sub testss {
  98. my @req_dsa = ("-newkey",
  99. "dsa:".srctop_file("apps", "dsa1024.pem"));
  100. my $dsaparams = srctop_file("apps", "dsa1024.pem");
  101. my @req_new;
  102. if ($no_rsa) {
  103. @req_new = @req_dsa;
  104. } else {
  105. @req_new = ("-new");
  106. }
  107. plan tests => 17;
  108. SKIP: {
  109. skip 'failure', 16 unless
  110. ok(run(app([@reqcmd, "-config", $cnf,
  111. "-out", $CAreq, "-keyout", $CAkey,
  112. @req_new])),
  113. 'make cert request');
  114. skip 'failure', 15 unless
  115. ok(run(app([@x509cmd, "-CAcreateserial", "-in", $CAreq, "-days", "30",
  116. "-req", "-out", $CAcert, "-signkey", $CAkey,
  117. "-extfile", $cnf, "-extensions", "v3_ca"],
  118. stdout => "err.ss")),
  119. 'convert request into self-signed cert');
  120. skip 'failure', 14 unless
  121. ok(run(app([@x509cmd, "-in", $CAcert,
  122. "-x509toreq", "-signkey", $CAkey, "-out", $CAreq2],
  123. stdout => "err.ss")),
  124. 'convert cert into a cert request');
  125. skip 'failure', 13 unless
  126. ok(run(app([@reqcmd, "-config", $dummycnf,
  127. "-verify", "-in", $CAreq, "-noout"])),
  128. 'verify request 1');
  129. skip 'failure', 12 unless
  130. ok(run(app([@reqcmd, "-config", $dummycnf,
  131. "-verify", "-in", $CAreq2, "-noout"])),
  132. 'verify request 2');
  133. skip 'failure', 11 unless
  134. ok(run(app([@verifycmd, "-CAfile", $CAcert, $CAcert])),
  135. 'verify signature');
  136. skip 'failure', 10 unless
  137. ok(run(app([@reqcmd, "-config", $cnf, "-section", "userreq",
  138. "-out", $Ureq, "-keyout", $Ukey, @req_new],
  139. stdout => "err.ss")),
  140. 'make a user cert request');
  141. skip 'failure', 9 unless
  142. ok(run(app([@x509cmd, "-CAcreateserial", "-in", $Ureq, "-days", "30",
  143. "-req", "-out", $Ucert,
  144. "-CA", $CAcert, "-CAkey", $CAkey, "-CAserial", $CAserial,
  145. "-extfile", $cnf, "-extensions", "v3_ee"],
  146. stdout => "err.ss"))
  147. && run(app([@verifycmd, "-CAfile", $CAcert, $Ucert])),
  148. 'sign user cert request');
  149. skip 'failure', 8 unless
  150. ok(run(app([@x509cmd,
  151. "-subject", "-issuer", "-startdate", "-enddate",
  152. "-noout", "-in", $Ucert])),
  153. 'Certificate details');
  154. skip 'failure', 7 unless
  155. subtest 'DSA certificate creation' => sub {
  156. plan skip_all => "skipping DSA certificate creation"
  157. if $no_dsa;
  158. plan tests => 5;
  159. SKIP: {
  160. $ENV{CN2} = "DSA Certificate";
  161. skip 'failure', 4 unless
  162. ok(run(app([@genpkeycmd, "-out", $Dkey,
  163. "-paramfile", $dsaparams],
  164. stdout => "err.ss")),
  165. "make a DSA key");
  166. skip 'failure', 3 unless
  167. ok(run(app([@reqcmd, "-new", "-config", $cnf,
  168. "-section", "userreq",
  169. "-out", $Dreq, "-key", $Dkey],
  170. stdout => "err.ss")),
  171. "make a DSA user cert request");
  172. skip 'failure', 2 unless
  173. ok(run(app([@x509cmd, "-CAcreateserial",
  174. "-in", $Dreq,
  175. "-days", "30",
  176. "-req",
  177. "-out", $Dcert,
  178. "-CA", $CAcert, "-CAkey", $CAkey,
  179. "-CAserial", $CAserial,
  180. "-extfile", $cnf,
  181. "-extensions", "v3_ee_dsa"],
  182. stdout => "err.ss")),
  183. "sign DSA user cert request");
  184. skip 'failure', 1 unless
  185. ok(run(app([@verifycmd, "-CAfile", $CAcert, $Dcert])),
  186. "verify DSA user cert");
  187. skip 'failure', 0 unless
  188. ok(run(app([@x509cmd,
  189. "-subject", "-issuer",
  190. "-startdate", "-enddate", "-noout",
  191. "-in", $Dcert])),
  192. "DSA Certificate details");
  193. }
  194. };
  195. skip 'failure', 6 unless
  196. subtest 'ECDSA/ECDH certificate creation' => sub {
  197. plan skip_all => "skipping ECDSA/ECDH certificate creation"
  198. if $no_ec;
  199. plan tests => 5;
  200. SKIP: {
  201. $ENV{CN2} = "ECDSA Certificate";
  202. skip 'failure', 4 unless
  203. ok(run(app(["openssl", "genpkey", "-genparam",
  204. "-algorithm", "EC",
  205. "-pkeyopt", "ec_paramgen_curve:P-256",
  206. "-pkeyopt", "ec_param_enc:named_curve",
  207. "-out", "ecp.ss"])),
  208. "make EC parameters");
  209. skip 'failure', 3 unless
  210. ok(run(app([@reqcmd, "-config", $cnf,
  211. "-section", "userreq",
  212. "-out", $Ereq, "-keyout", $Ekey,
  213. "-newkey", "ec:ecp.ss"],
  214. stdout => "err.ss")),
  215. "make a ECDSA/ECDH user cert request");
  216. skip 'failure', 2 unless
  217. ok(run(app([@x509cmd, "-CAcreateserial",
  218. "-in", $Ereq,
  219. "-days", "30",
  220. "-req",
  221. "-out", $Ecert,
  222. "-CA", $CAcert, "-CAkey", $CAkey,
  223. "-CAserial", $CAserial,
  224. "-extfile", $cnf,
  225. "-extensions", "v3_ee_ec"],
  226. stdout => "err.ss")),
  227. "sign ECDSA/ECDH user cert request");
  228. skip 'failure', 1 unless
  229. ok(run(app([@verifycmd, "-CAfile", $CAcert, $Ecert])),
  230. "verify ECDSA/ECDH user cert");
  231. skip 'failure', 0 unless
  232. ok(run(app([@x509cmd,
  233. "-subject", "-issuer",
  234. "-startdate", "-enddate", "-noout",
  235. "-in", $Ecert])),
  236. "ECDSA Certificate details");
  237. }
  238. };
  239. skip 'failure', 5 unless
  240. ok(run(app([@reqcmd, "-config", $proxycnf,
  241. "-out", $P1req, "-keyout", $P1key, @req_new],
  242. stdout => "err.ss")),
  243. 'make a proxy cert request');
  244. skip 'failure', 4 unless
  245. ok(run(app([@x509cmd, "-CAcreateserial", "-in", $P1req, "-days", "30",
  246. "-req", "-out", $P1cert,
  247. "-CA", $Ucert, "-CAkey", $Ukey,
  248. "-extfile", $proxycnf, "-extensions", "proxy"],
  249. stdout => "err.ss")),
  250. 'sign proxy with user cert');
  251. copy($Ucert, $P1intermediate);
  252. run(app([@verifycmd, "-CAfile", $CAcert,
  253. "-untrusted", $P1intermediate, $P1cert]));
  254. ok(run(app([@x509cmd,
  255. "-subject", "-issuer", "-startdate", "-enddate",
  256. "-noout", "-in", $P1cert])),
  257. 'Certificate details');
  258. skip 'failure', 2 unless
  259. ok(run(app([@reqcmd, "-config", $proxycnf, "-section", "proxy2_req",
  260. "-out", $P2req, "-keyout", $P2key,
  261. @req_new],
  262. stdout => "err.ss")),
  263. 'make another proxy cert request');
  264. skip 'failure', 1 unless
  265. ok(run(app([@x509cmd, "-CAcreateserial", "-in", $P2req, "-days", "30",
  266. "-req", "-out", $P2cert,
  267. "-CA", $P1cert, "-CAkey", $P1key,
  268. "-extfile", $proxycnf, "-extensions", "proxy_2"],
  269. stdout => "err.ss")),
  270. 'sign second proxy cert request with the first proxy cert');
  271. open OUT, ">", $P2intermediate;
  272. copy($Ucert, \*OUT); copy($P1cert, \*OUT);
  273. close OUT;
  274. run(app([@verifycmd, "-CAfile", $CAcert,
  275. "-untrusted", $P2intermediate, $P2cert]));
  276. ok(run(app([@x509cmd,
  277. "-subject", "-issuer", "-startdate", "-enddate",
  278. "-noout", "-in", $P2cert])),
  279. 'Certificate details');
  280. }
  281. }
  282. sub testssl {
  283. my ($key, $cert, $CAtmp, $provider, $configfile) = @_;
  284. my @CA = $CAtmp ? ("-CAfile", $CAtmp) : ("-CApath", bldtop_dir("certs"));
  285. my @ssltest = ("ssltest_old",
  286. "-s_key", $key, "-s_cert", $cert,
  287. "-c_key", $key, "-c_cert", $cert,
  288. "-provider", $provider,
  289. "-config", $configfile);
  290. my $serverinfo = srctop_file("test","serverinfo.pem");
  291. my $dsa_cert = 0;
  292. if (grep /DSA Public Key/, run(app(["openssl", "x509", "-in", $cert,
  293. "-text", "-noout"]), capture => 1)) {
  294. $dsa_cert = 1;
  295. }
  296. # plan tests => 11;
  297. subtest 'standard SSL tests' => sub {
  298. ######################################################################
  299. plan tests => 13;
  300. SKIP: {
  301. skip "SSLv3 is not supported by this OpenSSL build", 4
  302. if disabled("ssl3");
  303. skip "SSLv3 is not supported by the FIPS provider", 4
  304. if $provider eq "fips";
  305. ok(run(test([@ssltest, "-bio_pair", "-ssl3"])),
  306. 'test sslv3 via BIO pair');
  307. ok(run(test([@ssltest, "-bio_pair", "-ssl3", "-server_auth", @CA])),
  308. 'test sslv3 with server authentication via BIO pair');
  309. ok(run(test([@ssltest, "-bio_pair", "-ssl3", "-client_auth", @CA])),
  310. 'test sslv3 with client authentication via BIO pair');
  311. ok(run(test([@ssltest, "-bio_pair", "-ssl3", "-server_auth", "-client_auth", @CA])),
  312. 'test sslv3 with both server and client authentication via BIO pair');
  313. }
  314. SKIP: {
  315. skip "Neither SSLv3 nor any TLS version are supported by this OpenSSL build", 1
  316. if $no_anytls;
  317. ok(run(test([@ssltest, "-bio_pair"])),
  318. 'test sslv2/sslv3 via BIO pair');
  319. }
  320. SKIP: {
  321. skip "Neither SSLv3 nor any TLS version are supported by this OpenSSL build", 8
  322. if $no_anytls;
  323. SKIP: {
  324. skip "skipping test of sslv2/sslv3 w/o (EC)DHE test", 1 if $dsa_cert;
  325. ok(run(test([@ssltest, "-bio_pair", "-no_dhe", "-no_ecdhe"])),
  326. 'test sslv2/sslv3 w/o (EC)DHE via BIO pair');
  327. }
  328. ok(run(test([@ssltest, "-bio_pair", "-dhe1024dsa", "-v"])),
  329. 'test sslv2/sslv3 with 1024bit DHE via BIO pair');
  330. ok(run(test([@ssltest, "-bio_pair", "-server_auth", @CA])),
  331. 'test sslv2/sslv3 with server authentication');
  332. ok(run(test([@ssltest, "-bio_pair", "-client_auth", @CA])),
  333. 'test sslv2/sslv3 with client authentication via BIO pair');
  334. ok(run(test([@ssltest, "-bio_pair", "-server_auth", "-client_auth", @CA])),
  335. 'test sslv2/sslv3 with both client and server authentication via BIO pair');
  336. ok(run(test([@ssltest, "-bio_pair", "-server_auth", "-client_auth", "-app_verify", @CA])),
  337. 'test sslv2/sslv3 with both client and server authentication via BIO pair and app verify');
  338. SKIP: {
  339. skip "No IPv4 available on this machine", 1
  340. unless !disabled("sock") && have_IPv4();
  341. ok(run(test([@ssltest, "-ipv4"])),
  342. 'test TLS via IPv4');
  343. }
  344. SKIP: {
  345. skip "No IPv6 available on this machine", 1
  346. unless !disabled("sock") && have_IPv6();
  347. ok(run(test([@ssltest, "-ipv6"])),
  348. 'test TLS via IPv6');
  349. }
  350. }
  351. };
  352. subtest "Testing ciphersuites" => sub {
  353. my @exkeys = ();
  354. my $ciphers = "-PSK:-SRP";
  355. if (!$no_dsa) {
  356. push @exkeys, "-s_cert", "certD.ss", "-s_key", "keyD.ss";
  357. }
  358. if (!$no_ec) {
  359. push @exkeys, "-s_cert", "certE.ss", "-s_key", "keyE.ss";
  360. }
  361. my @protocols = ();
  362. # We only use the flags that ssltest_old understands
  363. push @protocols, "-tls1_3" unless $no_tls1_3;
  364. push @protocols, "-tls1_2" unless $no_tls1_2;
  365. push @protocols, "-tls1" unless $no_tls1 || $provider eq "fips";
  366. push @protocols, "-ssl3" unless $no_ssl3 || $provider eq "fips";
  367. my $protocolciphersuitecount = 0;
  368. my %ciphersuites = ();
  369. my %ciphersstatus = ();
  370. foreach my $protocol (@protocols) {
  371. my $ciphersstatus = undef;
  372. my @ciphers = run(app(["openssl", "ciphers", "-s", $protocol,
  373. "ALL:$ciphers"]),
  374. capture => 1, statusvar => \$ciphersstatus);
  375. @ciphers = grep {!/CAMELLIA|ARIA|CHACHA/} @ciphers;
  376. $ciphersstatus{$protocol} = $ciphersstatus;
  377. if ($ciphersstatus) {
  378. $ciphersuites{$protocol} = [ map { s|\R||; split(/:/, $_) }
  379. @ciphers ];
  380. $protocolciphersuitecount += scalar @{$ciphersuites{$protocol}};
  381. }
  382. }
  383. plan skip_all => "None of the ciphersuites to test are available in this OpenSSL build"
  384. if $protocolciphersuitecount + scalar(keys %ciphersuites) == 0;
  385. # The count of protocols is because in addition to the ciphersuites
  386. # we got above, we're running a weak DH test for each protocol (except
  387. # TLSv1.3)
  388. my $testcount = scalar(@protocols) + $protocolciphersuitecount
  389. + scalar(keys %ciphersuites);
  390. $testcount-- unless $no_tls1_3;
  391. plan tests => $testcount;
  392. foreach my $protocol (@protocols) {
  393. ok($ciphersstatus{$protocol}, "Getting ciphers for $protocol");
  394. }
  395. foreach my $protocol (sort keys %ciphersuites) {
  396. note "Testing ciphersuites for $protocol";
  397. # ssltest_old doesn't know -tls1_3, but that's fine, since that's
  398. # the default choice if TLSv1.3 enabled
  399. my $flag = $protocol eq "-tls1_3" ? "" : $protocol;
  400. my $ciphersuites = "";
  401. foreach my $cipher (@{$ciphersuites{$protocol}}) {
  402. if ($protocol eq "-ssl3" && $cipher =~ /ECDH/ ) {
  403. note "*****SKIPPING $protocol $cipher";
  404. ok(1);
  405. } else {
  406. if ($protocol eq "-tls1_3") {
  407. $ciphersuites = $cipher;
  408. $cipher = "";
  409. }
  410. ok(run(test([@ssltest, @exkeys, "-cipher", $cipher,
  411. "-ciphersuites", $ciphersuites, $flag || ()])),
  412. "Testing $cipher");
  413. }
  414. }
  415. next if $protocol eq "-tls1_3";
  416. is(run(test([@ssltest,
  417. "-s_cipher", "EDH",
  418. "-c_cipher", 'EDH:@SECLEVEL=1',
  419. "-dhe512",
  420. $protocol])), 0,
  421. "testing connection with weak DH, expecting failure");
  422. }
  423. };
  424. subtest 'RSA/(EC)DHE/PSK tests' => sub {
  425. ######################################################################
  426. plan tests => 5;
  427. SKIP: {
  428. skip "TLSv1.0 is not supported by this OpenSSL build", 5
  429. if $no_tls1 || $provider eq "fips";
  430. SKIP: {
  431. skip "skipping anonymous DH tests", 1
  432. if ($no_dh);
  433. ok(run(test([@ssltest, "-v", "-bio_pair", "-tls1", "-cipher", "ADH", "-dhe1024dsa", "-num", "10", "-f", "-time"])),
  434. 'test tlsv1 with 1024bit anonymous DH, multiple handshakes');
  435. }
  436. SKIP: {
  437. skip "skipping RSA tests", 2
  438. if $no_rsa;
  439. ok(run(test(["ssltest_old", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-no_dhe", "-no_ecdhe", "-num", "10", "-f", "-time"])),
  440. 'test tlsv1 with 1024bit RSA, no (EC)DHE, multiple handshakes');
  441. skip "skipping RSA+DHE tests", 1
  442. if $no_dh;
  443. ok(run(test(["ssltest_old", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-dhe1024dsa", "-num", "10", "-f", "-time"])),
  444. 'test tlsv1 with 1024bit RSA, 1024bit DHE, multiple handshakes');
  445. }
  446. SKIP: {
  447. skip "skipping PSK tests", 2
  448. if ($no_psk);
  449. ok(run(test([@ssltest, "-tls1", "-cipher", "PSK", "-psk", "abc123"])),
  450. 'test tls1 with PSK');
  451. ok(run(test([@ssltest, "-bio_pair", "-tls1", "-cipher", "PSK", "-psk", "abc123"])),
  452. 'test tls1 with PSK via BIO pair');
  453. }
  454. }
  455. };
  456. subtest 'Custom Extension tests' => sub {
  457. ######################################################################
  458. plan tests => 1;
  459. SKIP: {
  460. skip "TLSv1.0 is not supported by this OpenSSL build", 1
  461. if $no_tls1 || $provider eq "fips";
  462. ok(run(test([@ssltest, "-bio_pair", "-tls1", "-custom_ext"])),
  463. 'test tls1 with custom extensions');
  464. }
  465. };
  466. subtest 'Serverinfo tests' => sub {
  467. ######################################################################
  468. plan tests => 5;
  469. SKIP: {
  470. skip "TLSv1.0 is not supported by this OpenSSL build", 5
  471. if $no_tls1 || $provider eq "fips";
  472. note('echo test tls1 with serverinfo');
  473. ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo])));
  474. ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo, "-serverinfo_sct"])));
  475. ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo, "-serverinfo_tack"])));
  476. ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo, "-serverinfo_sct", "-serverinfo_tack"])));
  477. ok(run(test([@ssltest, "-bio_pair", "-tls1", "-custom_ext", "-serverinfo_file", $serverinfo, "-serverinfo_sct", "-serverinfo_tack"])));
  478. }
  479. };
  480. }