20-cert-select.conf.in 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795
  1. # -*- mode: perl; -*-
  2. ## SSL test configurations
  3. use strict;
  4. use warnings;
  5. package ssltests;
  6. use OpenSSL::Test::Utils;
  7. my $server = {
  8. "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
  9. "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
  10. "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
  11. "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
  12. "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
  13. "Ed448.PrivateKey" => test_pem("server-ed448-key.pem"),
  14. "MaxProtocol" => "TLSv1.2"
  15. };
  16. my $server_pss = {
  17. "PSS.Certificate" => test_pem("server-pss-cert.pem"),
  18. "PSS.PrivateKey" => test_pem("server-pss-key.pem"),
  19. "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
  20. "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
  21. "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
  22. "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
  23. "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
  24. "Ed448.PrivateKey" => test_pem("server-ed448-key.pem"),
  25. "MaxProtocol" => "TLSv1.2"
  26. };
  27. my $server_pss_only = {
  28. "Certificate" => test_pem("server-pss-cert.pem"),
  29. "PrivateKey" => test_pem("server-pss-key.pem"),
  30. };
  31. our @tests = (
  32. {
  33. name => "ECDSA CipherString Selection",
  34. server => $server,
  35. client => {
  36. "CipherString" => "aECDSA",
  37. "MaxProtocol" => "TLSv1.2",
  38. "RequestCAFile" => test_pem("root-cert.pem"),
  39. },
  40. test => {
  41. "ExpectedServerCertType" =>, "P-256",
  42. "ExpectedServerSignType" =>, "EC",
  43. # Note: certificate_authorities not sent for TLS < 1.3
  44. "ExpectedServerCANames" =>, "empty",
  45. "ExpectedResult" => "Success"
  46. },
  47. },
  48. {
  49. name => "ECDSA CipherString Selection",
  50. server => {
  51. "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
  52. "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
  53. "MaxProtocol" => "TLSv1.2",
  54. #Deliberately set supported_groups to one not in the cert. This
  55. #should be tolerated
  56. "Groups" => "P-384"
  57. },
  58. client => {
  59. "CipherString" => "aECDSA",
  60. "MaxProtocol" => "TLSv1.2",
  61. "Groups" => "P-256:P-384",
  62. "RequestCAFile" => test_pem("root-cert.pem"),
  63. },
  64. test => {
  65. "ExpectedServerCertType" =>, "P-256",
  66. "ExpectedServerSignType" =>, "EC",
  67. # Note: certificate_authorities not sent for TLS < 1.3
  68. "ExpectedServerCANames" =>, "empty",
  69. "ExpectedResult" => "Success"
  70. },
  71. },
  72. {
  73. name => "ECDSA CipherString Selection",
  74. server => {
  75. "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
  76. "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
  77. "MaxProtocol" => "TLSv1.2",
  78. "Groups" => "P-256:P-384"
  79. },
  80. client => {
  81. "CipherString" => "aECDSA",
  82. "MaxProtocol" => "TLSv1.2",
  83. #Deliberately set groups to not include the certificate group. This
  84. #should fail
  85. "Groups" => "P-384",
  86. "RequestCAFile" => test_pem("root-cert.pem"),
  87. },
  88. test => {
  89. "ExpectedResult" => "ServerFail"
  90. },
  91. },
  92. {
  93. name => "Ed25519 CipherString and Signature Algorithm Selection",
  94. server => $server,
  95. client => {
  96. "CipherString" => "aECDSA",
  97. "MaxProtocol" => "TLSv1.2",
  98. "SignatureAlgorithms" => "ed25519:ECDSA+SHA256",
  99. "RequestCAFile" => test_pem("root-cert.pem"),
  100. },
  101. test => {
  102. "ExpectedServerCertType" =>, "Ed25519",
  103. "ExpectedServerSignType" =>, "Ed25519",
  104. # Note: certificate_authorities not sent for TLS < 1.3
  105. "ExpectedServerCANames" =>, "empty",
  106. "ExpectedResult" => "Success"
  107. },
  108. },
  109. {
  110. name => "Ed448 CipherString and Signature Algorithm Selection",
  111. server => $server,
  112. client => {
  113. "CipherString" => "aECDSA",
  114. "MaxProtocol" => "TLSv1.2",
  115. "SignatureAlgorithms" => "ed448:ECDSA+SHA256",
  116. "RequestCAFile" => test_pem("root-cert.pem"),
  117. },
  118. test => {
  119. "ExpectedServerCertType" =>, "Ed448",
  120. "ExpectedServerSignType" =>, "Ed448",
  121. # Note: certificate_authorities not sent for TLS < 1.3
  122. "ExpectedServerCANames" =>, "empty",
  123. "ExpectedResult" => "Success"
  124. },
  125. },
  126. {
  127. name => "RSA CipherString Selection",
  128. server => $server,
  129. client => {
  130. "CipherString" => "aRSA",
  131. "MaxProtocol" => "TLSv1.2",
  132. },
  133. test => {
  134. "ExpectedServerCertType" =>, "RSA",
  135. "ExpectedServerSignType" =>, "RSA-PSS",
  136. "ExpectedResult" => "Success"
  137. },
  138. },
  139. {
  140. name => "RSA-PSS Certificate CipherString Selection",
  141. server => $server_pss,
  142. client => {
  143. "CipherString" => "aRSA",
  144. "MaxProtocol" => "TLSv1.2",
  145. },
  146. test => {
  147. "ExpectedServerCertType" =>, "RSA-PSS",
  148. "ExpectedServerSignType" =>, "RSA-PSS",
  149. "ExpectedResult" => "Success"
  150. },
  151. },
  152. {
  153. name => "P-256 CipherString and Signature Algorithm Selection",
  154. server => $server,
  155. client => {
  156. "CipherString" => "aECDSA",
  157. "MaxProtocol" => "TLSv1.2",
  158. "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
  159. },
  160. test => {
  161. "ExpectedServerCertType" => "P-256",
  162. "ExpectedServerSignHash" => "SHA256",
  163. "ExpectedServerSignType" => "EC",
  164. "ExpectedResult" => "Success"
  165. },
  166. },
  167. {
  168. name => "Ed25519 CipherString and Curves Selection",
  169. server => $server,
  170. client => {
  171. "CipherString" => "aECDSA",
  172. "MaxProtocol" => "TLSv1.2",
  173. "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
  174. # Excluding P-256 from the supported curves list means server
  175. # certificate should be Ed25519 and not P-256
  176. "Curves" => "X25519"
  177. },
  178. test => {
  179. "ExpectedServerCertType" =>, "Ed25519",
  180. "ExpectedServerSignType" =>, "Ed25519",
  181. "ExpectedResult" => "Success"
  182. },
  183. },
  184. {
  185. name => "Ed448 CipherString and Curves Selection",
  186. server => $server,
  187. client => {
  188. "CipherString" => "aECDSA",
  189. "MaxProtocol" => "TLSv1.2",
  190. "SignatureAlgorithms" => "ECDSA+SHA256:ed448",
  191. # Excluding P-256 from the supported curves list means server
  192. # certificate should be Ed25519 and not P-256
  193. "Curves" => "X448"
  194. },
  195. test => {
  196. "ExpectedServerCertType" =>, "Ed448",
  197. "ExpectedServerSignType" =>, "Ed448",
  198. "ExpectedResult" => "Success"
  199. },
  200. },
  201. {
  202. name => "ECDSA CipherString Selection, no ECDSA certificate",
  203. server => {
  204. "MaxProtocol" => "TLSv1.2"
  205. },
  206. client => {
  207. "CipherString" => "aECDSA",
  208. "MaxProtocol" => "TLSv1.2"
  209. },
  210. test => {
  211. "ExpectedResult" => "ServerFail"
  212. },
  213. },
  214. {
  215. name => "ECDSA Signature Algorithm Selection",
  216. server => $server,
  217. client => {
  218. "SignatureAlgorithms" => "ECDSA+SHA256",
  219. },
  220. test => {
  221. "ExpectedServerCertType" => "P-256",
  222. "ExpectedServerSignHash" => "SHA256",
  223. "ExpectedServerSignType" => "EC",
  224. "ExpectedResult" => "Success"
  225. },
  226. },
  227. {
  228. name => "ECDSA Signature Algorithm Selection SHA384",
  229. server => $server,
  230. client => {
  231. "SignatureAlgorithms" => "ECDSA+SHA384",
  232. },
  233. test => {
  234. "ExpectedServerCertType" => "P-256",
  235. "ExpectedServerSignHash" => "SHA384",
  236. "ExpectedServerSignType" => "EC",
  237. "ExpectedResult" => "Success"
  238. },
  239. },
  240. {
  241. name => "ECDSA Signature Algorithm Selection SHA1",
  242. server => $server,
  243. client => {
  244. "SignatureAlgorithms" => "ECDSA+SHA1",
  245. },
  246. test => {
  247. "ExpectedServerCertType" => "P-256",
  248. "ExpectedServerSignHash" => "SHA1",
  249. "ExpectedServerSignType" => "EC",
  250. "ExpectedResult" => "Success"
  251. },
  252. },
  253. {
  254. name => "ECDSA Signature Algorithm Selection compressed point",
  255. server => {
  256. "ECDSA.Certificate" => test_pem("server-cecdsa-cert.pem"),
  257. "ECDSA.PrivateKey" => test_pem("server-cecdsa-key.pem"),
  258. "MaxProtocol" => "TLSv1.2"
  259. },
  260. client => {
  261. "SignatureAlgorithms" => "ECDSA+SHA256",
  262. },
  263. test => {
  264. "ExpectedServerCertType" => "P-256",
  265. "ExpectedServerSignHash" => "SHA256",
  266. "ExpectedServerSignType" => "EC",
  267. "ExpectedResult" => "Success"
  268. },
  269. },
  270. {
  271. name => "ECDSA Signature Algorithm Selection, no ECDSA certificate",
  272. server => {
  273. "MaxProtocol" => "TLSv1.2"
  274. },
  275. client => {
  276. "SignatureAlgorithms" => "ECDSA+SHA256",
  277. },
  278. test => {
  279. "ExpectedResult" => "ServerFail"
  280. },
  281. },
  282. {
  283. name => "RSA Signature Algorithm Selection",
  284. server => $server,
  285. client => {
  286. "SignatureAlgorithms" => "RSA+SHA256",
  287. },
  288. test => {
  289. "ExpectedServerCertType" => "RSA",
  290. "ExpectedServerSignHash" => "SHA256",
  291. "ExpectedServerSignType" => "RSA",
  292. "ExpectedResult" => "Success"
  293. },
  294. },
  295. {
  296. name => "RSA-PSS Signature Algorithm Selection",
  297. server => $server,
  298. client => {
  299. "SignatureAlgorithms" => "RSA-PSS+SHA256",
  300. },
  301. test => {
  302. "ExpectedServerCertType" => "RSA",
  303. "ExpectedServerSignHash" => "SHA256",
  304. "ExpectedServerSignType" => "RSA-PSS",
  305. "ExpectedResult" => "Success"
  306. },
  307. },
  308. {
  309. name => "RSA-PSS Certificate Legacy Signature Algorithm Selection",
  310. server => $server_pss,
  311. client => {
  312. "SignatureAlgorithms" => "RSA-PSS+SHA256",
  313. },
  314. test => {
  315. "ExpectedServerCertType" => "RSA",
  316. "ExpectedServerSignHash" => "SHA256",
  317. "ExpectedServerSignType" => "RSA-PSS",
  318. "ExpectedResult" => "Success"
  319. },
  320. },
  321. {
  322. name => "RSA-PSS Certificate Unified Signature Algorithm Selection",
  323. server => $server_pss,
  324. client => {
  325. "SignatureAlgorithms" => "rsa_pss_pss_sha256",
  326. },
  327. test => {
  328. "ExpectedServerCertType" => "RSA-PSS",
  329. "ExpectedServerSignHash" => "SHA256",
  330. "ExpectedServerSignType" => "RSA-PSS",
  331. "ExpectedResult" => "Success"
  332. },
  333. },
  334. {
  335. name => "Only RSA-PSS Certificate",
  336. server => $server_pss_only,
  337. client => {},
  338. test => {
  339. "ExpectedServerCertType" => "RSA-PSS",
  340. "ExpectedServerSignHash" => "SHA256",
  341. "ExpectedServerSignType" => "RSA-PSS",
  342. "ExpectedResult" => "Success"
  343. },
  344. },
  345. {
  346. name => "RSA-PSS Certificate, no PSS signature algorithms",
  347. server => $server_pss_only,
  348. client => {
  349. "SignatureAlgorithms" => "RSA+SHA256",
  350. },
  351. test => {
  352. "ExpectedResult" => "ServerFail"
  353. },
  354. },
  355. {
  356. name => "Suite B P-256 Hash Algorithm Selection",
  357. server => {
  358. "ECDSA.Certificate" => test_pem("p256-server-cert.pem"),
  359. "ECDSA.PrivateKey" => test_pem("p256-server-key.pem"),
  360. "MaxProtocol" => "TLSv1.2",
  361. "CipherString" => "SUITEB128"
  362. },
  363. client => {
  364. "VerifyCAFile" => test_pem("p384-root.pem"),
  365. "SignatureAlgorithms" => "ECDSA+SHA384:ECDSA+SHA256"
  366. },
  367. test => {
  368. "ExpectedServerCertType" => "P-256",
  369. "ExpectedServerSignHash" => "SHA256",
  370. "ExpectedServerSignType" => "EC",
  371. "ExpectedResult" => "Success"
  372. },
  373. },
  374. {
  375. name => "Suite B P-384 Hash Algorithm Selection",
  376. server => {
  377. "ECDSA.Certificate" => test_pem("p384-server-cert.pem"),
  378. "ECDSA.PrivateKey" => test_pem("p384-server-key.pem"),
  379. "MaxProtocol" => "TLSv1.2",
  380. "CipherString" => "SUITEB128"
  381. },
  382. client => {
  383. "VerifyCAFile" => test_pem("p384-root.pem"),
  384. "SignatureAlgorithms" => "ECDSA+SHA256:ECDSA+SHA384"
  385. },
  386. test => {
  387. "ExpectedServerCertType" => "P-384",
  388. "ExpectedServerSignHash" => "SHA384",
  389. "ExpectedServerSignType" => "EC",
  390. "ExpectedResult" => "Success"
  391. },
  392. },
  393. {
  394. name => "TLS 1.2 Ed25519 Client Auth",
  395. server => {
  396. "VerifyCAFile" => test_pem("root-cert.pem"),
  397. "VerifyMode" => "Require"
  398. },
  399. client => {
  400. "Ed25519.Certificate" => test_pem("client-ed25519-cert.pem"),
  401. "Ed25519.PrivateKey" => test_pem("client-ed25519-key.pem"),
  402. "MinProtocol" => "TLSv1.2",
  403. "MaxProtocol" => "TLSv1.2"
  404. },
  405. test => {
  406. "ExpectedClientCertType" => "Ed25519",
  407. "ExpectedClientSignType" => "Ed25519",
  408. "ExpectedResult" => "Success"
  409. },
  410. },
  411. {
  412. name => "TLS 1.2 Ed448 Client Auth",
  413. server => {
  414. "VerifyCAFile" => test_pem("root-cert.pem"),
  415. "VerifyMode" => "Require"
  416. },
  417. client => {
  418. "Ed448.Certificate" => test_pem("client-ed448-cert.pem"),
  419. "Ed448.PrivateKey" => test_pem("client-ed448-key.pem"),
  420. "MinProtocol" => "TLSv1.2",
  421. "MaxProtocol" => "TLSv1.2"
  422. },
  423. test => {
  424. "ExpectedClientCertType" => "Ed448",
  425. "ExpectedClientSignType" => "Ed448",
  426. "ExpectedResult" => "Success"
  427. },
  428. },
  429. );
  430. my @tests_tls_1_1 = (
  431. {
  432. name => "Only RSA-PSS Certificate, TLS v1.1",
  433. server => $server_pss_only,
  434. client => {
  435. "MaxProtocol" => "TLSv1.1",
  436. },
  437. test => {
  438. "ExpectedResult" => "ServerFail"
  439. },
  440. },
  441. );
  442. push @tests, @tests_tls_1_1 unless disabled("tls1_1");
  443. my $server_tls_1_3 = {
  444. "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
  445. "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
  446. "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
  447. "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
  448. "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
  449. "Ed448.PrivateKey" => test_pem("server-ed448-key.pem"),
  450. "MinProtocol" => "TLSv1.3",
  451. "MaxProtocol" => "TLSv1.3"
  452. };
  453. my $server_tls_1_3_pss = {
  454. "PSS.Certificate" => test_pem("server-pss-cert.pem"),
  455. "PSS.PrivateKey" => test_pem("server-pss-key.pem"),
  456. "ECDSA.Certificate" => test_pem("server-ecdsa-cert.pem"),
  457. "ECDSA.PrivateKey" => test_pem("server-ecdsa-key.pem"),
  458. "Ed25519.Certificate" => test_pem("server-ed25519-cert.pem"),
  459. "Ed25519.PrivateKey" => test_pem("server-ed25519-key.pem"),
  460. "Ed448.Certificate" => test_pem("server-ed448-cert.pem"),
  461. "Ed448.PrivateKey" => test_pem("server-ed449-key.pem"),
  462. "MinProtocol" => "TLSv1.3",
  463. "MaxProtocol" => "TLSv1.3"
  464. };
  465. my $client_tls_1_3 = {
  466. "RSA.Certificate" => test_pem("ee-client-chain.pem"),
  467. "RSA.PrivateKey" => test_pem("ee-key.pem"),
  468. "ECDSA.Certificate" => test_pem("ee-ecdsa-client-chain.pem"),
  469. "ECDSA.PrivateKey" => test_pem("ee-ecdsa-key.pem"),
  470. "MinProtocol" => "TLSv1.3",
  471. "MaxProtocol" => "TLSv1.3"
  472. };
  473. my @tests_tls_1_3 = (
  474. {
  475. name => "TLS 1.3 ECDSA Signature Algorithm Selection",
  476. server => $server_tls_1_3,
  477. client => {
  478. "SignatureAlgorithms" => "ECDSA+SHA256",
  479. },
  480. test => {
  481. "ExpectedServerCertType" => "P-256",
  482. "ExpectedServerSignHash" => "SHA256",
  483. "ExpectedServerSignType" => "EC",
  484. "ExpectedServerCANames" => "empty",
  485. "ExpectedResult" => "Success"
  486. },
  487. },
  488. {
  489. name => "TLS 1.3 ECDSA Signature Algorithm Selection compressed point",
  490. server => {
  491. "ECDSA.Certificate" => test_pem("server-cecdsa-cert.pem"),
  492. "ECDSA.PrivateKey" => test_pem("server-cecdsa-key.pem"),
  493. "MinProtocol" => "TLSv1.3",
  494. "MaxProtocol" => "TLSv1.3"
  495. },
  496. client => {
  497. "SignatureAlgorithms" => "ECDSA+SHA256",
  498. },
  499. test => {
  500. "ExpectedServerCertType" => "P-256",
  501. "ExpectedServerSignHash" => "SHA256",
  502. "ExpectedServerSignType" => "EC",
  503. "ExpectedServerCANames" => "empty",
  504. "ExpectedResult" => "Success"
  505. },
  506. },
  507. {
  508. name => "TLS 1.3 ECDSA Signature Algorithm Selection SHA1",
  509. server => $server_tls_1_3,
  510. client => {
  511. "SignatureAlgorithms" => "ECDSA+SHA1",
  512. },
  513. test => {
  514. "ExpectedResult" => "ServerFail"
  515. },
  516. },
  517. {
  518. name => "TLS 1.3 ECDSA Signature Algorithm Selection with PSS",
  519. server => $server_tls_1_3,
  520. client => {
  521. "SignatureAlgorithms" => "ECDSA+SHA256:RSA-PSS+SHA256",
  522. "RequestCAFile" => test_pem("root-cert.pem"),
  523. },
  524. test => {
  525. "ExpectedServerCertType" => "P-256",
  526. "ExpectedServerSignHash" => "SHA256",
  527. "ExpectedServerSignType" => "EC",
  528. "ExpectedServerCANames" => test_pem("root-cert.pem"),
  529. "ExpectedResult" => "Success"
  530. },
  531. },
  532. {
  533. name => "TLS 1.3 RSA Signature Algorithm Selection SHA384 with PSS",
  534. server => $server_tls_1_3,
  535. client => {
  536. "SignatureAlgorithms" => "ECDSA+SHA384:RSA-PSS+SHA384",
  537. },
  538. test => {
  539. "ExpectedServerCertType" => "RSA",
  540. "ExpectedServerSignHash" => "SHA384",
  541. "ExpectedServerSignType" => "RSA-PSS",
  542. "ExpectedResult" => "Success"
  543. },
  544. },
  545. {
  546. name => "TLS 1.3 ECDSA Signature Algorithm Selection, no ECDSA certificate",
  547. server => {
  548. "MinProtocol" => "TLSv1.3",
  549. "MaxProtocol" => "TLSv1.3"
  550. },
  551. client => {
  552. "SignatureAlgorithms" => "ECDSA+SHA256",
  553. },
  554. test => {
  555. "ExpectedResult" => "ServerFail"
  556. },
  557. },
  558. {
  559. name => "TLS 1.3 RSA Signature Algorithm Selection, no PSS",
  560. server => $server_tls_1_3,
  561. client => {
  562. "SignatureAlgorithms" => "RSA+SHA256",
  563. },
  564. test => {
  565. "ExpectedResult" => "ServerFail"
  566. },
  567. },
  568. {
  569. name => "TLS 1.3 RSA-PSS Signature Algorithm Selection",
  570. server => $server_tls_1_3,
  571. client => {
  572. "SignatureAlgorithms" => "RSA-PSS+SHA256",
  573. },
  574. test => {
  575. "ExpectedServerCertType" => "RSA",
  576. "ExpectedServerSignHash" => "SHA256",
  577. "ExpectedServerSignType" => "RSA-PSS",
  578. "ExpectedResult" => "Success"
  579. },
  580. },
  581. {
  582. name => "TLS 1.3 Ed25519 Signature Algorithm Selection",
  583. server => $server_tls_1_3,
  584. client => {
  585. "SignatureAlgorithms" => "ed25519",
  586. },
  587. test => {
  588. "ExpectedServerCertType" => "Ed25519",
  589. "ExpectedServerSignType" => "Ed25519",
  590. "ExpectedResult" => "Success"
  591. },
  592. },
  593. {
  594. name => "TLS 1.3 Ed448 Signature Algorithm Selection",
  595. server => $server_tls_1_3,
  596. client => {
  597. "SignatureAlgorithms" => "ed448",
  598. },
  599. test => {
  600. "ExpectedServerCertType" => "Ed448",
  601. "ExpectedServerSignType" => "Ed448",
  602. "ExpectedResult" => "Success"
  603. },
  604. },
  605. {
  606. name => "TLS 1.3 Ed25519 CipherString and Groups Selection",
  607. server => $server_tls_1_3,
  608. client => {
  609. "SignatureAlgorithms" => "ECDSA+SHA256:ed25519",
  610. # Excluding P-256 from the supported groups list should
  611. # mean server still uses a P-256 certificate because supported
  612. # groups is not used in signature selection for TLS 1.3
  613. "Groups" => "X25519"
  614. },
  615. test => {
  616. "ExpectedServerCertType" =>, "P-256",
  617. "ExpectedServerSignType" =>, "EC",
  618. "ExpectedResult" => "Success"
  619. },
  620. },
  621. {
  622. name => "TLS 1.3 Ed448 CipherString and Groups Selection",
  623. server => $server_tls_1_3,
  624. client => {
  625. "SignatureAlgorithms" => "ECDSA+SHA256:ed448",
  626. # Excluding P-256 from the supported groups list should
  627. # mean server still uses a P-256 certificate because supported
  628. # groups is not used in signature selection for TLS 1.3
  629. "Groups" => "X448"
  630. },
  631. test => {
  632. "ExpectedServerCertType" =>, "P-256",
  633. "ExpectedServerSignType" =>, "EC",
  634. "ExpectedResult" => "Success"
  635. },
  636. },
  637. {
  638. name => "TLS 1.3 RSA Client Auth Signature Algorithm Selection",
  639. server => {
  640. "ClientSignatureAlgorithms" => "PSS+SHA256",
  641. "VerifyCAFile" => test_pem("root-cert.pem"),
  642. "VerifyMode" => "Require"
  643. },
  644. client => $client_tls_1_3,
  645. test => {
  646. "ExpectedClientCertType" => "RSA",
  647. "ExpectedClientSignHash" => "SHA256",
  648. "ExpectedClientSignType" => "RSA-PSS",
  649. "ExpectedClientCANames" => "empty",
  650. "ExpectedResult" => "Success"
  651. },
  652. },
  653. {
  654. name => "TLS 1.3 RSA Client Auth Signature Algorithm Selection non-empty CA Names",
  655. server => {
  656. "ClientSignatureAlgorithms" => "PSS+SHA256",
  657. "VerifyCAFile" => test_pem("root-cert.pem"),
  658. "RequestCAFile" => test_pem("root-cert.pem"),
  659. "VerifyMode" => "Require"
  660. },
  661. client => $client_tls_1_3,
  662. test => {
  663. "ExpectedClientCertType" => "RSA",
  664. "ExpectedClientSignHash" => "SHA256",
  665. "ExpectedClientSignType" => "RSA-PSS",
  666. "ExpectedClientCANames" => test_pem("root-cert.pem"),
  667. "ExpectedResult" => "Success"
  668. },
  669. },
  670. {
  671. name => "TLS 1.3 ECDSA Client Auth Signature Algorithm Selection",
  672. server => {
  673. "ClientSignatureAlgorithms" => "ECDSA+SHA256",
  674. "VerifyCAFile" => test_pem("root-cert.pem"),
  675. "VerifyMode" => "Require"
  676. },
  677. client => $client_tls_1_3,
  678. test => {
  679. "ExpectedClientCertType" => "P-256",
  680. "ExpectedClientSignHash" => "SHA256",
  681. "ExpectedClientSignType" => "EC",
  682. "ExpectedResult" => "Success"
  683. },
  684. },
  685. {
  686. name => "TLS 1.3 Ed25519 Client Auth",
  687. server => {
  688. "VerifyCAFile" => test_pem("root-cert.pem"),
  689. "VerifyMode" => "Require"
  690. },
  691. client => {
  692. "EdDSA.Certificate" => test_pem("client-ed25519-cert.pem"),
  693. "EdDSA.PrivateKey" => test_pem("client-ed25519-key.pem"),
  694. "MinProtocol" => "TLSv1.3",
  695. "MaxProtocol" => "TLSv1.3"
  696. },
  697. test => {
  698. "ExpectedClientCertType" => "Ed25519",
  699. "ExpectedClientSignType" => "Ed25519",
  700. "ExpectedResult" => "Success"
  701. },
  702. },
  703. {
  704. name => "TLS 1.3 Ed448 Client Auth",
  705. server => {
  706. "VerifyCAFile" => test_pem("root-cert.pem"),
  707. "VerifyMode" => "Require"
  708. },
  709. client => {
  710. "EdDSA.Certificate" => test_pem("client-ed448-cert.pem"),
  711. "EdDSA.PrivateKey" => test_pem("client-ed448-key.pem"),
  712. "MinProtocol" => "TLSv1.3",
  713. "MaxProtocol" => "TLSv1.3"
  714. },
  715. test => {
  716. "ExpectedClientCertType" => "Ed448",
  717. "ExpectedClientSignType" => "Ed448",
  718. "ExpectedResult" => "Success"
  719. },
  720. },
  721. );
  722. push @tests, @tests_tls_1_3 unless disabled("tls1_3");
  723. my @tests_dsa_tls_1_2 = (
  724. {
  725. name => "TLS 1.2 DSA Certificate Test",
  726. server => {
  727. "DSA.Certificate" => test_pem("server-dsa-cert.pem"),
  728. "DSA.PrivateKey" => test_pem("server-dsa-key.pem"),
  729. "DHParameters" => test_pem("dhp2048.pem"),
  730. "MinProtocol" => "TLSv1.2",
  731. "MaxProtocol" => "TLSv1.2",
  732. "CipherString" => "ALL",
  733. },
  734. client => {
  735. "SignatureAlgorithms" => "DSA+SHA256:DSA+SHA1",
  736. "CipherString" => "ALL",
  737. },
  738. test => {
  739. "ExpectedResult" => "Success"
  740. },
  741. },
  742. );
  743. my @tests_dsa_tls_1_3 = (
  744. {
  745. name => "TLS 1.3 Client Auth No TLS 1.3 Signature Algorithms",
  746. server => {
  747. "ClientSignatureAlgorithms" => "ECDSA+SHA1:DSA+SHA256:RSA+SHA256",
  748. "VerifyCAFile" => test_pem("root-cert.pem"),
  749. "VerifyMode" => "Request"
  750. },
  751. client => {},
  752. test => {
  753. "ExpectedResult" => "ServerFail"
  754. },
  755. },
  756. {
  757. name => "TLS 1.3 DSA Certificate Test",
  758. server => {
  759. "DSA.Certificate" => test_pem("server-dsa-cert.pem"),
  760. "DSA.PrivateKey" => test_pem("server-dsa-key.pem"),
  761. "MinProtocol" => "TLSv1.3",
  762. "MaxProtocol" => "TLSv1.3",
  763. "CipherString" => "ALL",
  764. },
  765. client => {
  766. "SignatureAlgorithms" => "DSA+SHA1:DSA+SHA256:ECDSA+SHA256",
  767. "CipherString" => "ALL",
  768. },
  769. test => {
  770. "ExpectedResult" => "ServerFail"
  771. },
  772. },
  773. );
  774. if (!disabled("dsa")) {
  775. push @tests, @tests_dsa_tls_1_2 unless disabled("dh");
  776. push @tests, @tests_dsa_tls_1_3 unless disabled("tls1_3");
  777. }