Path: blob/main/contrib/bearssl/test/x509/alltests.txt
39566 views
; Most/all of these test chains use the same structure:1; root -> ica1 -> ica2 -> ee2; "ica1" is "Intermediate CA 1"3; "ee" is "end-entity", i.e. the client or server certificate itself4;5; In SSL/TLS order, the EE comes first. The root may or may not be included6; as a self-signed certificate.78[key]9name = root-rsa204810type = RSA11n = B6D934D450FDB3AF7A73F1CE38BF5D6F45E1FD4EB198C6608326D217D1C5B79AA3C1DE6339979CF05E5CC81C17B988196DF0B62E3050A1546E93C0DBCF30CB9F1E2779F1C3995235AA3DB6DFB0AD7CCB49CDC0EDE766102AE9CE281F2150FA774C2DDAEF3C58EB4EBFCEE9FB1ADAA383A3CDA3CA9380DCDAF317CC7AAB33809CB2D47F463FC53CDC6194B727296E2ABC5B0936D4C63B0DEBBECEDB1D1CBC106A7171B3F2CA289A77F28AEC42EFB14A8EE2F21A322ACDC0A6462C9AC28537917F46A19381A17466DFBAB339209193FA1DA1A885E7E4F907F610F6A82701B67F12C340C3C9E2B0AB49183A64B659B795B59636DF2269AA726A544E2729A30E971512e = 0100011314[key]15name = root-p25616type = EC17curve = P-25618q = 047174BAABB9302E81D5E557F9F320680C9CF964DBB4200D6DEA40D04A6E42FDB69A682544F6DF7BC4FCDEDD7BBBC5DB7C763F4166406EDBA787C2E5D8C5F37F8D1920[key]21name = root-p38422type = EC23curve = P-38424q = 040ED28B3F7F0A38A6DB72CB4DAC8198C3D595BFABEE2E4A3CC6797F1A272C57AD715F96B5FDA29C4DD87B75B1438B6A92C4FD0282A3080A857F28AB31FF8B49F805470A01EE551F7F27C914E7E780AE474558D6F5539BAE806626514FE560478B2526[key]27name = root-p52128type = EC29curve = P-52130q = 040168E669615D1B20F2E753D2C86312F51094D3E5C6CF49E8D73418278CD769FE40A84AD4F34865D59D94D5685B389E0CFD0450754CAE81ED1D4A91D0773F7A002ED701DEF2DBDEFC7554E74CD600693DBDE1A7E09CD9044774C744C7CE575BF8B645FF79FCCE06116F61D44FDAE62D3046F4EB41DECB8219B279A5B8CE2A47F3DF0D463B3132[key]33name = root-new34type = EC35curve = P-25636q = 0465D02336D3ACEB9A000B33A6EECA9745EFD72A0F7C0B138FAAA564E705A3269A479BB5A041DC1D244EA1D2BB9639C79187D3D63CEF79EDD1DC65E80027E759973738[key]39name = ica1-rsa204840type = RSA41n = B3E86BAF9C1652E3810C50AB25CECC0DC7F21F7F50DF2C5C35D6622E632741A7E453A84B27FA1391A3FA094A2F3B5ECF77B38AC1CD49959C750D6474EFE4D74BB9A19B68D2307148EAF74B14DF3F47A9D8BBEC8F28CCFADFB41F947C96FC080528F9E8F42F2FEE629C8A3AE0855860B60F2D30B4C04154914C1F5FADF119F0C022A67DD83F793459427B5BB541C4647F52CF3C3722A12F7925942441C23FFAC775FB48B50D18A7F454F32E6ED84358C4AB50E805AD91B61E0175B3549CDEA09915FBACF15C974951CCEF58126F736BB33414010F5A9DFAAAD693D3E2EAC3ABBC4EEDCC51A1B8F894B6B42CA8862B1FF6514329525E1389B36A78604E4EC01BA542e = 0100014344[key]45name = ica2-rsa204846type = RSA47n = AE15F7CBEEE3961BCA63D22681B2D8163423735684FCFDB2E98E9DD0D9D0D706A191EF8D4F604E16BDE6529EE557867B7A7FFCBC34AD86EC9150ADD5C7D18D83E95ABA2FDB0DB92131FAA2FD91EC37836261809C6A82253309DF8F7893EACFDB93B0A2687CEA873E369C4B379A71E52084C3789A2BA42C7E76D561A9131272F14B411BC6A555BA9D8965C06699C0F17C9B61B24E6601B0A9C4FDC8C1D0C789BE2746DE6271BA27F52A850F436026BC2A9D07AAD608DC26D86956A1D308DED858936B0EC2AF783E2574D49F001820BFD7158DB9D13D8900A01264E186C0D580F124B2D2FB4C677CAE3DC9BF47026DE47C0D4490518CCD026237F86FB96701C69548e = 0100014950[key]51name = ee-rsa204852type = RSA53n = D47A1D27BA2B3A67B2916AFBE78344CAED1C75ADDD4D8362D6AA6895B224217B15AE2A996815ED66F0B858E7D3F52EC6D92A5EE70E2EE7FC6759C0C8617D4BA46FDD9FD9C8858764C7BA1A0F29D496A8789A6B6220A932D0EEA98C286147A2502A63F621DEDAD8D5F07FC5008270E6A3BF5C89274F51927703C3B0CC2E3BEC23F22F5341AF8993FFD280B14397DED619A092127A3D6679E1C1BCE17770A28B3D4684533FE44E424137921E1FFD38B3F7EF873980D356CFF4E013DE64B072A40384C441ED6FFA3EE2CA0420D2D7DC2C822B7AE26DA11C48DBCF894F34973D28A853DAE7C1E17315A330767F8F2342143D5134D25AAD3C9BCBC8FE7F6E8E40F3BD54e = 0100015556[key]57name = ee-p25658type = EC59curve = P-25660q = 045F389DA7FF4D8AAFF63439461AFC3ADFF423AAA9EAFBC508DE008EBE79A537584C6DDD01CAAB47DF89B6C7171F38FC1D2014DD45C0E08F934E380BFCE999A1496162[key]63name = ee-p38464type = EC65curve = P-38466q = 0415A488877F3D14830E29A1C2F2C0745CE8CF5E684304D1668972389BA615B34E9648D5A7861E49DFFFBFFFEAD7FC6AF11BC4516C3557332DD86DDFDE2A236CCEA844EBD594CCD3ED5B7AE0061BD6595737B59FE754BCDAB6FE38D34D93DBBF306768[key]69name = ee-p52170type = EC71curve = P-52172q = 040060547ACA9D520FB3272833236CBF8E71AC286A3001FBB1E2C3FD8BAB0817DDE4E4FA53550F120D678F4D55AE4FF36C7C8EAE9E32A08A44FC66F45331E08946077A0139B87FE54B986012A94838C8006034941CD0512E596436D2E8E61CA93585D5C06EAD5094585B5B2A3E013803B3E6AAA1D4156EF09E8352029BB70AC6BF338F918B7374; Trust anchor: the root.75[anchor]76name = root77DN_file = dn-root.der78key = root-rsa204879type = CA8081; Trust anchor: root with an ECDSA key (in P-256 curve)82[anchor]83name = root-p25684DN_file = dn-root.der85key = root-p25686type = CA8788; Trust anchor: root with an ECDSA key (in P-384 curve)89[anchor]90name = root-p38491DN_file = dn-root.der92key = root-p38493type = CA9495; Trust anchor: root with an ECDSA key (in P-521 curve)96[anchor]97name = root-p52198DN_file = dn-root.der99key = root-p521100type = CA101102; Trust anchor: another root with an ECDSA key (in P-256 curve)103[anchor]104name = root-new105DN_file = dn-root-new.der106key = root-new107type = CA108109; Intermediate CA 1 as trust anchor.110[anchor]111name = ica1112DN_file = dn-ica1.der113key = ica1-rsa2048114type = CA115116; Intermediate CA 2 as trust anchor.117[anchor]118name = ica2119DN_file = dn-ica2.der120key = ica2-rsa2048121type = CA122123; EE certificate as trust anchor (direct trust only).124[anchor]125name = ee126DN_file = dn-ee.der127key = ee-rsa2048128type = EE129130; Base valid chain.131[chain]132name = base133anchors = root134chain = ee.crt ica2.crt ica1.crt135servername = www.example.com136keytype = RSA137keyusage = KEYX138eekey = ee-rsa2048139status = 0140141; Valid chain except that no trust anchor is provided; this should fail142; with BR_ERR_X509_NOT_TRUSTED.143[chain]144name = noTA145anchors =146chain = ee.crt ica2.crt ica1.crt147servername = www.example.com148keytype = RSA149keyusage = KEYX150status = 62151152; Use of intermediate CA 1 as anchor (extra certificates are ignored).153[chain]154name = anchorICA1155anchors = ica1156chain = ee.crt ica2.crt junk.crt junk.crt157servername = www.example.com158keytype = RSA159keyusage = KEYX160eekey = ee-rsa2048161status = 0162163; Use of intermediate CA 2 as anchor (extra certificates are ignored).164[chain]165name = anchorICA2166anchors = ica2167chain = ee.crt junk.crt junk.crt168servername = www.example.com169keytype = RSA170keyusage = KEYX171eekey = ee-rsa2048172status = 0173174; Direct trust of EE.175[chain]176name = directTrust177anchors = ee178chain = ee.crt junk.crt junk.crt179servername = www.example.com180keytype = RSA181keyusage = KEYX182eekey = ee-rsa2048183status = 0184185; Server name check: name does not match the SAN nor the CN.186[chain]187name = wrongName1188anchors = root189chain = ee.crt ica2.crt ica1.crt190servername = foo.example.com191keytype = RSA192keyusage = KEYX193status = 56194195; Server name check: name matches the CN but not the SAN, and there is196; a SAN so the CN is ignored.197[chain]198name = wrongName2199anchors = root200chain = ee-names.crt ica2.crt ica1.crt201servername = www.example.com202keytype = RSA203keyusage = KEYX204status = 56205206; Server name check: name does not match CN, but matches the first SAN207; name.208[chain]209name = goodName1210anchors = root211chain = ee-names.crt ica2.crt ica1.crt212servername = foo.example.com213keytype = RSA214keyusage = KEYX215eekey = ee-rsa2048216status = 0217218; Server name check: name does not match CN, but matches the second SAN219; name.220[chain]221name = goodName2222anchors = root223chain = ee-names.crt ica2.crt ica1.crt224servername = barqux.example.com225keytype = RSA226keyusage = KEYX227eekey = ee-rsa2048228status = 0229230; Server name check: no SAN, but the CN matches the server name.231[chain]232name = goodName3233anchors = root234chain = ee-names2.crt ica2.crt ica1.crt235servername = www.example.com236keytype = RSA237keyusage = KEYX238eekey = ee-rsa2048239status = 0240241; Server name check: no SAN, and the CN does not match the server name.242[chain]243name = wrongName3244anchors = root245chain = ee-names2.crt ica2.crt ica1.crt246servername = foo.example.com247keytype = RSA248keyusage = KEYX249status = 56250251; Server name check: no SAN, and the CN does not match the server name,252; although its byte contents seem to match (but with BMPString encoding).253[chain]254name = wrongName4255anchors = root256chain = ee-names3.crt ica2.crt ica1.crt257servername = www1.example.com258keytype = RSA259keyusage = KEYX260status = 56261262; Server name check: no SAN, and the CN uses BMPString encoding, but we263; do not actually request a server name check, so this should pass.264[chain]265name = ignoreName1266anchors = root267chain = ee-names3.crt ica2.crt ica1.crt268keytype = RSA269keyusage = KEYX270eekey = ee-rsa2048271status = 0272273; Wildcard processing: the name 'localhost' should not match because274; the engine recognises the wildcard only in a '*.' starting sequence,275; so the lone '*' in a SAN will not be accepted.276[chain]277name = wildcard1278anchors = root279chain = ee-names4.crt ica2.crt ica1.crt280servername = localhost281keytype = RSA282keyusage = KEYX283status = 56284285; Wildcard processing: the name 'example.com' will be matched by '*.com'.286[chain]287name = wildcard2288anchors = root289chain = ee-names4.crt ica2.crt ica1.crt290servername = example.com291keytype = RSA292keyusage = KEYX293eekey = ee-rsa2048294status = 0295296; Wildcard processing: the name 'www.example.com' will be matched by297; '*.example.com'.298[chain]299name = wildcard3300anchors = root301chain = ee-names4.crt ica2.crt ica1.crt302servername = www.example.com303keytype = RSA304keyusage = KEYX305eekey = ee-rsa2048306status = 0307308; Wildcard processing: the name 'foo.foo.example.com' will not be matched by309; 'foo.*.example.com' because we accept the wildcard only in the first name310; component.311[chain]312name = wildcard4313anchors = root314chain = ee-names4.crt ica2.crt ica1.crt315servername = foo.foo.example.com316keytype = RSA317keyusage = KEYX318status = 56319320; Wildcard processing: the name 'foo.bar.example.com' will not be matched by321; 'foo.*.example.com', but '*.bar.example.com' will fit.322[chain]323name = wildcard5324anchors = root325chain = ee-names4.crt ica2.crt ica1.crt326servername = foo.bar.example.com327keytype = RSA328keyusage = KEYX329eekey = ee-rsa2048330status = 0331332; Wildcard processing: the name 'foo.bar.example.foobar' will not be matched by333; '*.*.example.foobar' because we support only a single level of wildcard.334[chain]335name = wildcard6336anchors = root337chain = ee-names4.crt ica2.crt ica1.crt338servername = foo.bar.example.foobar339keytype = RSA340keyusage = KEYX341status = 56342343; Wildcard processing: the name 'foo.*.example.foobar' will be matched344; by '*.*.example.foobar' because the '*' in the provided server name matches345; the second '*' in '*.*.example.foobar'. This is a corner case with no346; practical impact because expected server names are usually extracted from347; URL and cannot have embedded '*' in them.348[chain]349name = wildcard7350anchors = root351chain = ee-names4.crt ica2.crt ica1.crt352servername = foo.*.example.com353keytype = RSA354keyusage = KEYX355eekey = ee-rsa2048356status = 0357358; Hash function support: the chain uses only SHA-256.359[chain]360name = hashSHA256Only361anchors = root362chain = ee.crt ica2.crt ica1.crt363servername = www.example.com364keytype = RSA365keyusage = KEYX366hashes = sha256367eekey = ee-rsa2048368status = 0369370; Hash function support: the chain uses only SHA-256.371[chain]372name = hashSHA256Unsupported373anchors = root374chain = ee.crt ica2.crt ica1.crt375servername = www.example.com376keytype = RSA377keyusage = KEYX378hashes = md5 sha1 sha224 sha384 sha512379status = 49380381; Hash function support: signature on EE uses SHA-1.382[chain]383name = hashSHA1384anchors = root385chain = ee-sha1.crt ica2.crt ica1.crt386servername = www.example.com387keytype = RSA388keyusage = KEYX389eekey = ee-rsa2048390status = 0391392; Hash function support: signature on EE uses SHA-224.393[chain]394name = hashSHA224395anchors = root396chain = ee-sha224.crt ica2.crt ica1.crt397servername = www.example.com398keytype = RSA399keyusage = KEYX400eekey = ee-rsa2048401status = 0402403; Hash function support: signature on EE uses SHA-384.404[chain]405name = hashSHA384406anchors = root407chain = ee-sha384.crt ica2.crt ica1.crt408servername = www.example.com409keytype = RSA410keyusage = KEYX411eekey = ee-rsa2048412status = 0413414; Hash function support: signature on EE uses SHA-512.415[chain]416name = hashSHA512417anchors = root418chain = ee-sha512.crt ica2.crt ica1.crt419servername = www.example.com420keytype = RSA421keyusage = KEYX422eekey = ee-rsa2048423status = 0424425; Hash function support: signature on EE uses MD5. This is rejected by426; the engine (even though MD5 is supported as a hash function).427[chain]428name = hashMD5429anchors = root430chain = ee-md5.crt ica2.crt ica1.crt431servername = www.example.com432keytype = RSA433keyusage = KEYX434status = 49435436; EE certificate has trailing garbage (an extra byte), which should be437; rejected.438[chain]439name = trailingGarbage440anchors = root441chain = ee-trailing.crt ica2.crt ica1.crt442servername = www.example.com443keytype = RSA444keyusage = KEYX445status = 40446447; Signature on EE certificate is incorrect (one byte modified in signature).448[chain]449name = badSignature1450anchors = root451chain = ee-badsig1.crt ica2.crt ica1.crt452servername = www.example.com453keytype = RSA454keyusage = KEYX455status = 52456457; Signature on EE certificate is incorrect (one byte modified in serial458; number).459[chain]460name = badSignature2461anchors = root462chain = ee-badsig2.crt ica2.crt ica1.crt463servername = www.example.com464keytype = RSA465keyusage = KEYX466status = 52467468; Signature on EE certificate is incorrect but this is ignored because we469; use a direct trust model here.470[chain]471name = ignoredSignature1472anchors = ee473chain = ee-badsig1.crt ica2.crt ica1.crt474servername = www.example.com475keytype = RSA476keyusage = KEYX477eekey = ee-rsa2048478status = 0479480; Signature on EE certificate is incorrect but this is ignored because we481; use a direct trust model here.482[chain]483name = ignoredSignature2484anchors = ee485chain = ee-badsig2.crt ica2.crt ica1.crt486servername = www.example.com487keytype = RSA488keyusage = KEYX489eekey = ee-rsa2048490status = 0491492; Intermediate CA 1 has a 1016-bit RSA key, which should be rejected493; with BR_ERR_X509_WEAK_PUBLIC_KEY.494[chain]495name = rsa1016496anchors = root497chain = ee.crt ica2-1016.crt ica1-1016.crt498servername = www.example.com499keytype = RSA500keyusage = KEYX501status = 60502503; Intermediate CA 1 has a 1017-bit RSA key, which should be accepted504; (because that's 128 bytes, which is the lower limit).505[chain]506name = rsa1017507anchors = root508chain = ee.crt ica2-1017.crt ica1-1017.crt509servername = www.example.com510keytype = RSA511keyusage = KEYX512eekey = ee-rsa2048513status = 0514515; Intermediate CA 1 has a 4096-bit RSA key, which should be supported.516[chain]517name = rsa4096518anchors = root519chain = ee.crt ica2-4096.crt ica1-4096.crt520servername = www.example.com521keytype = RSA522keyusage = KEYX523eekey = ee-rsa2048524status = 0525526; EE is valid from 2010/02/17 11:40:35 to 2098/07/20 15:11:08. The527; start date is in UTCTime, the end date is in GeneralizedTime.528[chain]529name = date1530anchors = ica2531chain = ee-dates.crt ica2.crt ica1.crt532time = 2010-02-17 11:40:34Z533servername = www.example.com534keytype = RSA535keyusage = KEYX536status = 54537538; EE is valid from 2010/02/17 11:40:35 to 2098/07/20 15:11:08. The539; start date is in UTCTime, the end date is in GeneralizedTime.540[chain]541name = date2542anchors = ica2543chain = ee-dates.crt ica2.crt ica1.crt544time = 2010-02-17 11:40:36Z545servername = www.example.com546keytype = RSA547keyusage = KEYX548eekey = ee-rsa2048549status = 0550551; EE is valid from 2010/02/17 11:40:35 to 2098/07/20 15:11:08. The552; start date is in UTCTime, the end date is in GeneralizedTime.553[chain]554name = date3555anchors = ica2556chain = ee-dates.crt ica2.crt ica1.crt557time = 2098-07-20 15:11:07Z558servername = www.example.com559keytype = RSA560keyusage = KEYX561eekey = ee-rsa2048562status = 0563564; EE is valid from 2010/02/17 11:40:35 to 2098/07/20 15:11:08. The565; start date is in UTCTime, the end date is in GeneralizedTime.566[chain]567name = date4568anchors = ica2569chain = ee-dates.crt ica2.crt ica1.crt570time = 2098-07-20 15:11:09Z571servername = www.example.com572keytype = RSA573keyusage = KEYX574status = 54575576; Intermediate CA 2 certificate is not a CA.577[chain]578name = notCA579anchors = root580chain = ee-dates.crt ica2-notCA.crt ica1.crt581servername = www.example.com582keytype = RSA583keyusage = KEYX584status = 58585586; A chain using ECDSA with P-256.587[chain]588name = secp256r1589anchors = root-p256590chain = ee-p256.crt ica2-p256.crt ica1-p256.crt591servername = www.example.com592keytype = EC593keyusage = SIGN594eekey = ee-p256595status = 0596597; A chain using ECDSA with P-384.598[chain]599name = secp384r1600anchors = root-p384601chain = ee-p384.crt ica2-p384.crt ica1-p384.crt602servername = www.example.com603keytype = EC604keyusage = SIGN605eekey = ee-p384606status = 0607608; A chain using ECDSA with P-521.609[chain]610name = secp521r1611anchors = root-p521612chain = ee-p521.crt ica2-p521.crt ica1-p521.crt613servername = www.example.com614keytype = EC615keyusage = SIGN616eekey = ee-p521617status = 0618619; A chain using ECDSA with P-256, signature on EE uses SHA-1.620[chain]621name = secp256r1-sha1622anchors = root-p256623chain = ee-p256-sha1.crt ica2-p256.crt ica1-p256.crt624servername = www.example.com625keytype = EC626keyusage = SIGN627eekey = ee-p256628status = 0629630; A chain using ECDSA with P-256, signature on EE uses SHA-224.631[chain]632name = secp256r1-sha224633anchors = root-p256634chain = ee-p256-sha224.crt ica2-p256.crt ica1-p256.crt635servername = www.example.com636keytype = EC637keyusage = SIGN638eekey = ee-p256639status = 0640641; A chain using ECDSA with P-256, signature on EE uses SHA-256.642[chain]643name = secp256r1-sha256644anchors = root-p256645chain = ee-p256-sha256.crt ica2-p256.crt ica1-p256.crt646servername = www.example.com647keytype = EC648keyusage = SIGN649eekey = ee-p256650status = 0651652; A chain using ECDSA with P-256, signature on EE uses SHA-384.653[chain]654name = secp256r1-sha384655anchors = root-p256656chain = ee-p256-sha384.crt ica2-p256.crt ica1-p256.crt657servername = www.example.com658keytype = EC659keyusage = SIGN660eekey = ee-p256661status = 0662663; A chain using ECDSA with P-256, signature on EE uses SHA-512.664[chain]665name = secp256r1-sha512666anchors = root-p256667chain = ee-p256-sha512.crt ica2-p256.crt ica1-p256.crt668servername = www.example.com669keytype = EC670keyusage = SIGN671eekey = ee-p256672status = 0673674; EE certificate has a Certificate Policies extension, but it is not675; critical.676[chain]677name = certpol-noncrit678anchors = root-new679chain = ee-cp1.crt680servername = www.example.com681keytype = RSA682keyusage = KEYX683eekey = ee-rsa2048684status = 0685686; EE certificate has a critical Certificate Policies extension, but it687; contains no policy qualifier.688[chain]689name = certpol-noqual690anchors = root-new691chain = ee-cp2.crt692servername = www.example.com693keytype = RSA694keyusage = KEYX695eekey = ee-rsa2048696status = 0697698; EE certificate has a critical Certificate Policies extension, and it699; contains some qualifiers, but they are all id-qt-cps.700[chain]701name = certpol-qualcps702anchors = root-new703chain = ee-cp3.crt704servername = www.example.com705keytype = RSA706keyusage = KEYX707eekey = ee-rsa2048708status = 0709710; EE certificate has a critical Certificate Policies extension, and it711; contains a qualifier distinct from id-qt-cps. This implies rejection712; of the path.713[chain]714name = certpol-qualother715anchors = root-new716chain = ee-cp4.crt717servername = www.example.com718keytype = RSA719keyusage = KEYX720eekey = ee-rsa2048721status = 57722723724