20-cert-select.conf.in 27 KB

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