From d8ce6bc97f0f175586a043d2f179a7cae87348c9 Mon Sep 17 00:00:00 2001 From: Evgeny Margolis Date: Wed, 24 Aug 2022 20:07:24 -0700 Subject: [PATCH] chip-cert: Generated New Test Case with Wrong Certificate Validity (#22060) --- .../struct_dac_valid_in_future/cd.der | Bin 0 -> 236 bytes .../struct_dac_valid_in_future/dac-Cert.der | Bin 0 -> 466 bytes .../struct_dac_valid_in_future/dac-Cert.pem | 12 +++++ .../struct_dac_valid_in_future/dac-Key.der | Bin 0 -> 121 bytes .../struct_dac_valid_in_future/dac-Key.pem | 5 ++ .../struct_dac_valid_in_future/pai-Cert.der | Bin 0 -> 450 bytes .../struct_dac_valid_in_future/pai-Cert.pem | 12 +++++ .../struct_dac_valid_in_future/pai-Key.der | Bin 0 -> 121 bytes .../struct_dac_valid_in_future/pai-Key.pem | 5 ++ .../test_case_vector.json | 9 ++++ .../struct_dac_valid_in_past/cd.der | Bin 0 -> 237 bytes .../struct_dac_valid_in_past/dac-Cert.der | Bin 0 -> 466 bytes .../struct_dac_valid_in_past/dac-Cert.pem | 12 +++++ .../struct_dac_valid_in_past/dac-Key.der | Bin 0 -> 121 bytes .../struct_dac_valid_in_past/dac-Key.pem | 5 ++ .../struct_dac_valid_in_past/pai-Cert.der | Bin 0 -> 450 bytes .../struct_dac_valid_in_past/pai-Cert.pem | 12 +++++ .../struct_dac_valid_in_past/pai-Key.der | Bin 0 -> 121 bytes .../struct_dac_valid_in_past/pai-Key.pem | 5 ++ .../test_case_vector.json | 9 ++++ .../struct_pai_valid_in_future/cd.der | Bin 0 -> 235 bytes .../struct_pai_valid_in_future/dac-Cert.der | Bin 0 -> 466 bytes .../struct_pai_valid_in_future/dac-Cert.pem | 12 +++++ .../struct_pai_valid_in_future/dac-Key.der | Bin 0 -> 121 bytes .../struct_pai_valid_in_future/dac-Key.pem | 5 ++ .../struct_pai_valid_in_future/pai-Cert.der | Bin 0 -> 451 bytes .../struct_pai_valid_in_future/pai-Cert.pem | 12 +++++ .../struct_pai_valid_in_future/pai-Key.der | Bin 0 -> 121 bytes .../struct_pai_valid_in_future/pai-Key.pem | 5 ++ .../test_case_vector.json | 9 ++++ .../struct_pai_valid_in_past/cd.der | Bin 0 -> 236 bytes .../struct_pai_valid_in_past/dac-Cert.der | Bin 0 -> 465 bytes .../struct_pai_valid_in_past/dac-Cert.pem | 12 +++++ .../struct_pai_valid_in_past/dac-Key.der | Bin 0 -> 121 bytes .../struct_pai_valid_in_past/dac-Key.pem | 5 ++ .../struct_pai_valid_in_past/pai-Cert.der | Bin 0 -> 449 bytes .../struct_pai_valid_in_past/pai-Cert.pem | 12 +++++ .../struct_pai_valid_in_past/pai-Key.der | Bin 0 -> 121 bytes .../struct_pai_valid_in_past/pai-Key.pem | 5 ++ .../test_case_vector.json | 9 ++++ .../chip-cert/gen_com_dut_test_vectors.py | 48 +++++++++++++++--- 41 files changed, 212 insertions(+), 8 deletions(-) create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/cd.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/dac-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/dac-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/dac-Key.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/dac-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Key.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_future/test_case_vector.json create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/cd.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/dac-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/dac-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/dac-Key.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/dac-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Key.der create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_dac_valid_in_past/test_case_vector.json create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/cd.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/dac-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/dac-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/dac-Key.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/dac-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Key.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_future/test_case_vector.json create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/cd.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Key.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Cert.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Cert.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Key.der create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Key.pem create mode 100644 credentials/development/commissioner_dut/struct_pai_valid_in_past/test_case_vector.json diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_future/cd.der b/credentials/development/commissioner_dut/struct_dac_valid_in_future/cd.der new file mode 100644 index 0000000000000000000000000000000000000000..7803a7190a2d3177a3a9ead2cb57b9d52078cec3 GIT binary patch literal 236 zcmXqLe96YC)#lOmotKfFX+h&{gT@<7jLe3-2Hb3%32h#Xsmv@)j0Uad%?nI(J_N U?LCmc|6u$+&FZ@%q1)#H05Z!JkHs&Ff$n#7)lt3u`!3TF!S*H zCYF?>7Ab_J7MCalIC>h27znX(X|pl1Fg7i!VPfQAadUGsG*A%dH8wObGqNx=F)}tW zj*{TF1Oh`NV<0lMG_{N}aKmAyi=#7kGtoqucvvh9fFRO9n2jCmQYJ>IlbIRWnVlF| zURkN1((|05a-iI0x5S&4@GU|8wZ~mvE@C(|CAKwNbd&Lx>4(a7<}h7XycX%;AmTGY z`?B_p^9&Y~R+%Xr-}lREae_gd0T0mIvcimv|5=y}7!3G8Jbn-l7%c1!2C^VNABz}^ z$b^{M`M0Z=KYZ+)IJM)~vFnPzdj$>TLDI@Bz`$z|F?f*eD!wo=CzBLE0ZF_y_)Y=bGBdY&3TfrL31TN+RNE=iaqz;{Hu80>^sv{H|K$3*F(0K$}Ag=-bEGqjh&cPyL& b*CEzfKtL2skSo(G*v|kslBzZ!$G-YHgt9W+ literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_future/dac-Key.pem b/credentials/development/commissioner_dut/struct_dac_valid_in_future/dac-Key.pem new file mode 100644 index 00000000000000..61bcbe41a42d73 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_dac_valid_in_future/dac-Key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIFwY1xVBoky9uLjKW+QNOFIRDP5z1yGpGonkq9T/8JcnoAoGCCqGSM49 +AwEHoUQDQgAE6jonyi5JmCTAd0S7GOyEV7RSj33HROmiAMKUXYVrFbIztJfCdyyc +Atch1llAQBRMkCvTK9jPADiSqjYgx776Og== +-----END EC PRIVATE KEY----- diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Cert.der b/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Cert.der new file mode 100644 index 0000000000000000000000000000000000000000..d611b41f376eea7d9bdb807cce755c41f23f0da8 GIT binary patch literal 450 zcmXqLV%%rY#F(;xnTe5!iNklt4Y!@C^{NJ3Y#dr`9_MUXn3)U=3?&T2*qB3En0fep z6H7``ixfgqi%S#&932fs420OYwAmP07@HQ=FfsD5xVgC*8YqbK8W|Z_05KRuN$^_& zfuWHx5Sdz|i%BF+v^3%*f8{#K00=f0H@vvTVjurc4pVM- zhu%=lkI<~V`(*ArjT_sQe=;sLnH2mzGhSv_=cnSBho=S3-s1WC{QK8G>)jOP`@$Ee z8KeNc!5k_p%*gnkg~NaiNHH-o81R9__(5X8U|?i3kOlGiSj1RF3?5{=iZ4veN#^@& z{6N!tRq7)Bbq4YvX=N5*U^R$j{Z%TL50rniU(9iOy1<<~h6@YpkOP(3gTcU+Ns;0I ztp#k~R$PqhSCCtBEJN?J+qqr;Bdb4JrzID>|DwgZok_tt$k)iNEG0iidv>J4i%VV$ VW0NPGb>jMUXOUFL%h?;J0s#D>inRa$ literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Cert.pem b/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Cert.pem new file mode 100644 index 00000000000000..1af94cdddc32ae --- /dev/null +++ b/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Cert.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBvjCCAWSgAwIBAgIITbjYRrllfyUwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMjA4MjIw +MDAwMDBaGA85OTk5MTIzMTIzNTk1OVowMDEYMBYGA1UEAwwPTWF0dGVyIFRlc3Qg +UEFJMRQwEgYKKwYBBAGConwCAQwERkZGMTBZMBMGByqGSM49AgEGCCqGSM49AwEH +A0IABFt/2QNW0x1opUKEqw1AlNuLVdglb1gped3kne4o2Lcj+QGlNJJT92lfHLqJ +8nNc4csQzdoM9ef39fyvRiEfjlejZjBkMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQw4GtFF6FhbGMO/TPgKUuqZaIvrjAfBgNV +HSMEGDAWgBRq/SJ3H1Ef7L8WQZdnENzcMaFxfjAKBggqhkjOPQQDAgNIADBFAiEA +/9qgBvao0V6PIB6kxmgu80bOuv9Ze/E7ZmNw7/QqBbcCIENSTTJGdmRvXCubWSDo +0kqhXWOQzUIK+tyiGojpm7GV +-----END CERTIFICATE----- diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Key.der b/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Key.der new file mode 100644 index 0000000000000000000000000000000000000000..9982c9c6df91192030b602cf10428d18a0c1e8df GIT binary patch literal 121 zcmV-<0EYiCcLD(c1RxjISS;OF?#aa~*OV-5B>$?lRJ2QniopYnq~XrqM0n`2nRgl2i9- bUmUuL@^f6_%Mi`l4E5*t_580!As>!cC}KBi literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Key.pem b/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Key.pem new file mode 100644 index 00000000000000..e86524bcec9776 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_dac_valid_in_future/pai-Key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIBfWWCzdV+7JxSvXlCxsJP+qtVS0S4eKwQOMpOHO3kcjoAoGCCqGSM49 +AwEHoUQDQgAEW3/ZA1bTHWilQoSrDUCU24tV2CVvWCl53eSd7ijYtyP5AaU0klP3 +aV8cuonyc1zhyxDN2gz15/f1/K9GIR+OVw== +-----END EC PRIVATE KEY----- diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_future/test_case_vector.json b/credentials/development/commissioner_dut/struct_dac_valid_in_future/test_case_vector.json new file mode 100644 index 00000000000000..64815d0e9a55d4 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_dac_valid_in_future/test_case_vector.json @@ -0,0 +1,9 @@ +{ + "description": "DAC Test Vector: Certificate validity period starts in the future", + "is_success_case": "false", + "dac_cert": "308201ce30820174a003020102020846d84bc0a845f035300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313020170d3331303632383134323334335a180f39393939313233313233353935395a30463118301606035504030c0f4d617474657220546573742044414331143012060a2b0601040182a27c02010c044646463131143012060a2b0601040182a27c02020c04383030303059301306072a8648ce3d020106082a8648ce3d03010703420004ea3a27ca2e499824c07744bb18ec8457b4528f7dc744e9a200c2945d856b15b233b497c2772c9c02d721d6594040144c902bd32bd8cf003892aa3620c7befa3aa360305e300c0603551d130101ff04023000300e0603551d0f0101ff040403020780301d0603551d0e04160414905c7d9fdb7ba7e1e34d619588fac6d721fb8d11301f0603551d2304183016801430e06b4517a1616c630efd33e0294baa65a22fae300a06082a8648ce3d0403020348003045022100de7cf7d56cb7d58d6ce460b029a90d6701df662fb33eacb57a28abff2d7cd67902206328401615a358dca9a1744301201a24962f140eb0ac434078b80ee8a7f1e36f", + "pai_cert": "308201be30820164a00302010202084db8d846b9657f25300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414131143012060a2b0601040182a27c02010c04464646313020170d3232303832323030303030305a180f39393939313233313233353935395a30303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313059301306072a8648ce3d020106082a8648ce3d030107034200045b7fd90356d31d68a54284ab0d4094db8b55d8256f582979dde49dee28d8b723f901a5349253f7695f1cba89f2735ce1cb10cdda0cf5e7f7f5fcaf46211f8e57a366306430120603551d130101ff040830060101ff020100300e0603551d0f0101ff040403020106301d0603551d0e0416041430e06b4517a1616c630efd33e0294baa65a22fae301f0603551d230418301680146afd22771f511fecbf1641976710dcdc31a1717e300a06082a8648ce3d0403020348003045022100ffdaa006f6a8d15e8f201ea4c6682ef346cebaff597bf13b666370eff42a05b7022043524d324676646f5c2b9b5920e8d24aa15d6390cd420afadca21a88e99bb195", + "certification_declaration": "3081e906092a864886f70d010702a081db3081d8020103310d300b0609608648016503040201304506092a864886f70d010701a0380436152400012501f1ff360205008018250334122c04135a494732303134315a423333303030312d32342405002406002507769824080018317d307b020103801462fa823359acfaa9963e1cfa140addf504f37160300b0609608648016503040201300a06082a8648ce3d04030204473045022100922cd7b5dadac018efcb7529ec7b464014aa65955f9f6bedb274b2be5850538602204d75b379859d1b6b666bd5f9990b2cdde952bdc06fbfc15fbe297bdd1455b79e", + "dac_private_key": "5c18d71541a24cbdb8b8ca5be40d3852110cfe73d721a91a89e4abd4fff09727", + "dac_public_key": "04ea3a27ca2e499824c07744bb18ec8457b4528f7dc744e9a200c2945d856b15b233b497c2772c9c02d721d6594040144c902bd32bd8cf003892aa3620c7befa3a" +} diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_past/cd.der b/credentials/development/commissioner_dut/struct_dac_valid_in_past/cd.der new file mode 100644 index 0000000000000000000000000000000000000000..c6cc9f9ba51595297f3dd5d56571a3274ad7162a GIT binary patch literal 237 zcmXqLe8tA8)#lOmotKfFX+h&1gT|XojLe3-2Hb3%32h#Xsmv@)j0Ua`U)oTV^Y#dr`9_MUXn3)U=3?&T2*qB3En0fep z6H7``ixfgqi%S#&96b$1420OYwAmP07@HQ=FfsD5xVgC*8YqbK8W|dx8Ce*b7#W)w zM@jHo0)e5CF%X$rnp#E~xZyC<#nBnNnP{R+JS-LlKoDsl%*GCODH9{q$;^!G%uWm} zBG;#~hP}{h`#3kP?c&;Lbxj-6J3JOIEUd43s(1GzOI*ZRX%7(@S?lQOv+g_5uLm<;N4ahi6 literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_past/dac-Key.pem b/credentials/development/commissioner_dut/struct_dac_valid_in_past/dac-Key.pem new file mode 100644 index 00000000000000..4024c4b5f0b799 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_dac_valid_in_past/dac-Key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIFBUJNBC3tXdgaQ3v+GHxqTUa/38r940UzrRSJrsMLeioAoGCCqGSM49 +AwEHoUQDQgAEFNeVBVboLobxnWaG0a2WfoKwZ4hIo6Fxf3rlLt3xBF5Y8KSvNra5 +GXBCVt8kFouwyobGBO4yuArbXpLAQyDTNQ== +-----END EC PRIVATE KEY----- diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Cert.der b/credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Cert.der new file mode 100644 index 0000000000000000000000000000000000000000..dea87a5d2a7ac57d013f26b0aec79395a43aa9c8 GIT binary patch literal 450 zcmXqLV%%rY#F(;xnTe5!iNkpPcad%1^8F3C*f_M>JkHs&Ff$n#7)lt3u`!3TF!S*H zCYF?>7Ab_J7MCalI64}N7znX(X|pl1Fg7i!VPfQAadUGsG*A%dH8L`=0AetRlHj)l z0z)HXATqTywT!}JrY8R-%}@HR zd(n*j&soX$KNj2;yI0P?!{9*z=emw9PQEFHXP!;=b>11V)$ONk@9Y^x^#^y@InQ03 zW{?8(26L#aFeBrC77hb8AjQPUV890w;|GZWgMpFFKo-R3V-aH!VR}8=-r%_UiicC> zB$G4F6)m?=H8zk3Nh`Ae1FJzK>#tI|e4zZB{bG*O(*^F_FQ)?fvuavF*AN<<~F6q{y&g$`p^vYo-QDt{3Dk+|=`R V&3$>3d8_u?t5&@6+vgnk3IIQ_hhYE! literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Cert.pem b/credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Cert.pem new file mode 100644 index 00000000000000..fc9dd322359eac --- /dev/null +++ b/credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Cert.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBvjCCAWSgAwIBAgIIM6/3FLb2b08wCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMjA4MjIw +MDAwMDBaGA85OTk5MTIzMTIzNTk1OVowMDEYMBYGA1UEAwwPTWF0dGVyIFRlc3Qg +UEFJMRQwEgYKKwYBBAGConwCAQwERkZGMTBZMBMGByqGSM49AgEGCCqGSM49AwEH +A0IABEjDRNICkoYIMqcl90afYvst0TYH/M0Z7/ig2xbedw+4MOBgCa6ItEJNZHHM +5pNNQ7lYtUb5PY2bmHJ/wbg+Q52jZjBkMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBQC65s/MMcnqOGVHhljaM5ypzglMzAfBgNV +HSMEGDAWgBRq/SJ3H1Ef7L8WQZdnENzcMaFxfjAKBggqhkjOPQQDAgNIADBFAiBx +RqKMoAyIbzXnqAdBxcti2pAdHFCHj57eBrrUWk6PHAIhALCUlEh51jUwIkXQHtDZ +Lk1FbenZA7UrrdU6DV+3nMD1 +-----END CERTIFICATE----- diff --git a/credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Key.der b/credentials/development/commissioner_dut/struct_dac_valid_in_past/pai-Key.der new file mode 100644 index 0000000000000000000000000000000000000000..89aa7d89dd414573ae179d5b7aa53e97adf44099 GIT binary patch literal 121 zcmV-<0EYiCcLD(c1R#_JkHs&Ff$n#7)lt3u`!3TF!S*H zCYF?>7Ab_J7MCalIC>h27znX(X|pl1Fg7i!VPfQAadUGsG*A%dH8L`=0AetRlHj)l z0z)HXATqTywTv=w!(pb2qce6h(L|YeSS&zhM;ZvTv4dU8#0YgVGb1~*69bFW%}r~X ztzPpt$FDiCzgXATeVx3Hr8?ur1&nhoiYxw1G`3WmT&$*ZnyX3P!CQO3$^U}ICQq{t z1=!{;`!dl#aq;2=gE#{optog(85#exFc~ly@PT;zARaJS*c%LFL3}^0oeFcwoN4C#-)1UuATxU~ z7`QSiNFQ0YA@9ro2WmCj=G>d)RGISlOYsCP-S#t_4V+B7)U}ut8J2S_`StnG)k~R^ cmQH$9?lfb1d|6kV{`)4e&lgX>TXgd)0M<4eTm7$!*2|@*f_M>JkHs&Ff$n#7)lt3u`!3TF!S*H zCYF?>7Ab_J7MCalI64}N7znX(X|pl1Fg7i!VPfQAadUGsG*A%dH8wObGqNx=F)}tW zj*{TF1Oh`NV<0lMG_{PvW2Pq#Gb0Uz+1SBuVq%0kj+v32*@=Ng?Wy*W*(YC%dprMG z|HAXszki>Zj_|Uw&c9oGW?EOuZr}UN{A$wo7p#ADB;#XiPtK2}=dbIRKThimUzU^F z*4ln`ahgF2&>PI5vcimv|5-Q;*nkuhBZC1SNQ@sO1`Gy9HUn7@pN~b1MI?-;aG!_v z-#rygr@~w^XPP6_txnsDnunsv;nLQZ{ z+?W&@CN11=`(xSfd3=d^=lD7Nz0MU*tMnHwEj@PYUDkT735S77E?&CgyS&N%S4YCB aPLmm{rk?5E^ES(dnf1YfN~J4XYPkTMK#lwW literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Cert.pem b/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Cert.pem new file mode 100644 index 00000000000000..8a9d68b91280ab --- /dev/null +++ b/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Cert.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBvzCCAWSgAwIBAgIIIAWHpDSRw+wwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0zMTA2Mjgx +NDIzNDNaGA85OTk5MTIzMTIzNTk1OVowMDEYMBYGA1UEAwwPTWF0dGVyIFRlc3Qg +UEFJMRQwEgYKKwYBBAGConwCAQwERkZGMTBZMBMGByqGSM49AgEGCCqGSM49AwEH +A0IABCblK8SbyesXS0P8r+hJyv7+8wLEDQUFn919zJaKZLtN3wMPJhvfoK/ixGjx +hYxs+KXP1y9342aJV6ZsZYaFh9WjZjBkMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRWDHG+SCv9vHiCylZEaZk2Q/88lTAfBgNV +HSMEGDAWgBRq/SJ3H1Ef7L8WQZdnENzcMaFxfjAKBggqhkjOPQQDAgNJADBGAiEA +kqG/Pfim+54OYW7ODwhPSs5xlnlPFXV1xtruaq8qkMMCIQDR0tRNp4I/+ohgyok0 +mKqVzIu87Wo8AwXgoHki1LR9Cg== +-----END CERTIFICATE----- diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Key.der b/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Key.der new file mode 100644 index 0000000000000000000000000000000000000000..63ff4e13760dcca67c306aad02f7cdbb7ef8413b GIT binary patch literal 121 zcmV-<0EYiCcLD(c1R#F!hTRfqA(dC_WKd@Up*5cG({llY2rE-nQL7%&0k)tD1_&yK zNX|V20SBQ(13~} b;>2k2g^XSEg)bhJ}aKdx17g literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Key.pem b/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Key.pem new file mode 100644 index 00000000000000..a96a6024cd14a7 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_pai_valid_in_future/pai-Key.pem @@ -0,0 +1,5 @@ +-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIH7wht0SaCGVV+tkUGcCoTWe79NzAYQIK1NVUase0QG2oAoGCCqGSM49 +AwEHoUQDQgAEJuUrxJvJ6xdLQ/yv6EnK/v7zAsQNBQWf3X3Mlopku03fAw8mG9+g +r+LEaPGFjGz4pc/XL3fjZolXpmxlhoWH1Q== +-----END EC PRIVATE KEY----- diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_future/test_case_vector.json b/credentials/development/commissioner_dut/struct_pai_valid_in_future/test_case_vector.json new file mode 100644 index 00000000000000..5115b95a9ff111 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_pai_valid_in_future/test_case_vector.json @@ -0,0 +1,9 @@ +{ + "description": "PAI Test Vector: Certificate validity period starts in the future", + "is_success_case": "false", + "dac_cert": "308201ce30820174a00302010202083545de39b9ee9436300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313020170d3232303832323030303030305a180f39393939313233313233353935395a30463118301606035504030c0f4d617474657220546573742044414331143012060a2b0601040182a27c02010c044646463131143012060a2b0601040182a27c02020c04383030303059301306072a8648ce3d020106082a8648ce3d0301070342000442d9b2ac833aeb0f835facc0bf732d4d47ae1f2c392701b1a0019d387378fc913339269373262ccb0a821f404b2bbf34ff70a334e56ac2503d6da6f4914f61a3a360305e300c0603551d130101ff04023000300e0603551d0f0101ff040403020780301d0603551d0e041604140574e0a497265b4e1c0036fb4f6f3af5d2740688301f0603551d23041830168014560c71be482bfdbc7882ca564469993643ff3c95300a06082a8648ce3d040302034800304502201bc4a6b06ef4ffe0267cb69cde92427964e3f473902a2d87cc09800902ba272a022100a708a4faf3c2d5d26992a592e2774298975f768a5e2fef8216f3d1cbeea2d9f5", + "pai_cert": "308201bf30820164a0030201020208200587a43491c3ec300a06082a8648ce3d04030230303118301606035504030c0f4d617474657220546573742050414131143012060a2b0601040182a27c02010c04464646313020170d3331303632383134323334335a180f39393939313233313233353935395a30303118301606035504030c0f4d617474657220546573742050414931143012060a2b0601040182a27c02010c04464646313059301306072a8648ce3d020106082a8648ce3d0301070342000426e52bc49bc9eb174b43fcafe849cafefef302c40d05059fdd7dcc968a64bb4ddf030f261bdfa0afe2c468f1858c6cf8a5cfd72f77e3668957a66c65868587d5a366306430120603551d130101ff040830060101ff020100300e0603551d0f0101ff040403020106301d0603551d0e04160414560c71be482bfdbc7882ca564469993643ff3c95301f0603551d230418301680146afd22771f511fecbf1641976710dcdc31a1717e300a06082a8648ce3d040302034900304602210092a1bf3df8a6fb9e0e616ece0f084f4ace7196794f157575c6daee6aaf2a90c3022100d1d2d44da7823ffa8860ca893498aa95cc8bbced6a3c0305e0a07922d4b47d0a", + "certification_declaration": "3081e806092a864886f70d010702a081da3081d7020103310d300b0609608648016503040201304506092a864886f70d010701a0380436152400012501f1ff360205008018250334122c04135a494732303134315a423333303030312d32342405002406002507769824080018317c307a020103801462fa823359acfaa9963e1cfa140addf504f37160300b0609608648016503040201300a06082a8648ce3d04030204463044022040c1ccd18748a33c8a1a4085c1860f5578c91a926f3ff6f7fddf7d9c8d7226d1022051cedb3515d9130927802192e75a1fa212b960401674b443ee9e9bab4bbe6a87", + "dac_private_key": "3ddc544b9b83226739c90526d570cbd8dd00c8ebccae7d49e2bc679416d27eaf", + "dac_public_key": "0442d9b2ac833aeb0f835facc0bf732d4d47ae1f2c392701b1a0019d387378fc913339269373262ccb0a821f404b2bbf34ff70a334e56ac2503d6da6f4914f61a3" +} diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_past/cd.der b/credentials/development/commissioner_dut/struct_pai_valid_in_past/cd.der new file mode 100644 index 0000000000000000000000000000000000000000..cb6555be037cc5a86644cb75157bc753afa3327d GIT binary patch literal 236 zcmXqLe96YC)#lOmotKfFX+h&{gT@<7jLe3-2Hb3%32h#Xsmv@)j0UauP5F7O>UU{3^@~~^qxoSQ9B-Z`-w3JDaVbiJWjCIwvzTc+1nbaNd7JIOE T?LLcFtN2@Hmz=(8Q1T4`cr{3& literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Cert.der b/credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Cert.der new file mode 100644 index 0000000000000000000000000000000000000000..c178c6aee01b92f9eba72e59a37422bc95aa381c GIT binary patch literal 465 zcmXqLVmxcm#8|R`nTe5!iG$gqTw;lTrIG;`8;4e#$2nUTW+npzLkR;hHs(+kW*&au z#FCQKB88CD;u3`bM^8f$10gmpZ8k<0#->FzOpH7%ZfOM}CwHbgAlW~s92E}PBMh`LfI z-t)rOHl9wBxVSjMAkKgX=xteHM#ldvOa=@Fd>|e_hzAT7_67r45TB1lj78*`ZG*zC z2py+;ompI6{YEB#q}G2ikOxUCvj79HL1bRQ6K2WY3G>1hEPK@XaK`hy6|1%(2Qsre zgMkZ^0^cfcmFWd@T37e~J674PvCr%E#Jir?3SMtKkom4~&72iX3TCff&Q)BQtP=Ba b{+?YsPRM^(O6|4Qj^1G0`u&+kpnVYlG!2bM literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Cert.pem b/credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Cert.pem new file mode 100644 index 00000000000000..9861fbe051d653 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Cert.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBzTCCAXSgAwIBAgIIAzh3GKRPeSIwCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFJMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMjA4MjIw +MDAwMDBaGA85OTk5MTIzMTIzNTk1OVowRjEYMBYGA1UEAwwPTWF0dGVyIFRlc3Qg +REFDMRQwEgYKKwYBBAGConwCAQwERkZGMTEUMBIGCisGAQQBgqJ8AgIMBDgwMDAw +WTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAASGNhiEzu1Nm2NPYt0qHFiDitHMuQXM +NW8Tqb4BSqBefVoSdB7pMMPKsFiltjkkst0GPOVYfnVCDc8T1rHLYhjRo2AwXjAM +BgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDAdBgNVHQ4EFgQU5j2AINpYLELe +iWoKio8yNPwar/QwHwYDVR0jBBgwFoAUnlDkAxmNkJ5WoKbiieGY5914qrYwCgYI +KoZIzj0EAwIDRwAwRAIgDqpLJJdwnIWrj/7GeYsovkrrkd1J1nDrscBp7nGsnKgC +IDbq6Z0hqWMkXPGfvLq4yB/3ImWNOytbsDOF9+YoUT9y +-----END CERTIFICATE----- diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Key.der b/credentials/development/commissioner_dut/struct_pai_valid_in_past/dac-Key.der new file mode 100644 index 0000000000000000000000000000000000000000..384108f7d001866fe329c4d4c57d5610c5e25a68 GIT binary patch literal 121 zcmV-<0EYiCcLD(c1R&`tRAq9SQBubQ>m0ScjPgWu(A7jKJ2~PzIsweFptzt41_&yK zNX|V20SBQ(13~}0N$IQsi?8Lyb(Ps80Rr`O|?5FSj zD~Q&6Wb>6@sC}M>z)c48M|F>cm!yBtdhV+D`CFg%vb>0RexvP`=lg!_`I+PIE*@$j zvSi)jG=mhNH<&|Zg&7(Dvv3%&0VyU%1_M5j7(Yl17z~VT2C^VNABz}^$h?3j%#ytm z=7lX-_NepWjOTYNR&6to2T3cl00XN*B_%Z zE=&p%-qBa{wlx{A?SJvz*y`cj)CjJ!e;gM7Cf52-eis$P#iURxJ$cUG&aemnRT(sA Z>#h{v=FnLB^q=*Q){M*6^S%FC0027*iMjv) literal 0 HcmV?d00001 diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Cert.pem b/credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Cert.pem new file mode 100644 index 00000000000000..89a646b39013c3 --- /dev/null +++ b/credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Cert.pem @@ -0,0 +1,12 @@ +-----BEGIN CERTIFICATE----- +MIIBvTCCAWSgAwIBAgIIWxl2V64Pys8wCgYIKoZIzj0EAwIwMDEYMBYGA1UEAwwP +TWF0dGVyIFRlc3QgUEFBMRQwEgYKKwYBBAGConwCAQwERkZGMTAgFw0yMTA2Mjgx +NDIzNDNaGA85OTk5MTIzMTIzNTk1OVowMDEYMBYGA1UEAwwPTWF0dGVyIFRlc3Qg +UEFJMRQwEgYKKwYBBAGConwCAQwERkZGMTBZMBMGByqGSM49AgEGCCqGSM49AwEH +A0IABLE8m7IlP/47B8ve/nBbLuI89Q8Sh54oENkAN+J+4hOkZ/Aq50Uh8/aOK6Zu +WF8PMrd5z474vPlsT0cXVTgUpK6jZjBkMBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSeUOQDGY2QnlagpuKJ4Zjn3XiqtjAfBgNV +HSMEGDAWgBRq/SJ3H1Ef7L8WQZdnENzcMaFxfjAKBggqhkjOPQQDAgNHADBEAiAY +S1vVbraCM62P6PczOuGdZVgKdv4IOP6RfU+T7lpcCgIgfRuTnP2JVuD/JQApmy2p +F7ZAgXXl/jv4hWjTO59L/Tg= +-----END CERTIFICATE----- diff --git a/credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Key.der b/credentials/development/commissioner_dut/struct_pai_valid_in_past/pai-Key.der new file mode 100644 index 0000000000000000000000000000000000000000..b08d04fe680fb7b772bb879a4d7c966ce190d853 GIT binary patch literal 121 zcmV-<0EYiCcLD(c1R##BC-1LBI^ptumM^qP%EQ3(ALP0V{8EwB?#wWmPh+481_&yK zNX|V20SBQ(13~} None: subject_name = self.custom_cn_attribute vid_flag = ' -V 0x{:X}'.format(self.vid) pid_flag = ' -P 0x{:X}'.format(self.pid) + if (len(self.valid_from) == 0): + valid_from_flag = '' + else: + valid_from_flag = ' -f "' + self.valid_from + '"' if self.cert_type == CertType.PAI: if (len(subject_name) == 0): @@ -690,7 +710,7 @@ def make_certs_and_keys(self) -> None: return cmd = self.chipcert + ' gen-att-cert ' + type_flag + error_type_flag + ' -c "' + subject_name + '" -C ' + self.signer.cert_pem + ' -K ' + \ - self.signer.key_pem + vid_flag + pid_flag + ' -l 4294967295 -o ' + self.own.cert_pem + ' -O ' + self.own.key_pem + self.signer.key_pem + vid_flag + pid_flag + valid_from_flag + ' -l 4294967295 -o ' + self.own.cert_pem + ' -O ' + self.own.key_pem subprocess.run(cmd, shell=True) cmd = 'openssl x509 -inform pem -in ' + self.own.cert_pem + \ ' -out ' + self.own.cert_der + ' -outform DER' @@ -787,22 +807,34 @@ def main(): for test_cert in ['dac', 'pai']: for test_case in CERT_STRUCT_TEST_CASES: test_case_out_dir = args.outdir + '/struct_' + test_cert + '_' + test_case["test_folder"] + + if test_case["test_folder"] == 'valid_in_past': + valid_from = VALID_IN_PAST + elif test_case["test_folder"] == 'valid_in_future': + valid_from = VALID_IN_FUTURE + else: + valid_from = '' + if test_cert == 'dac': error_type_dac = test_case["error_flag"] error_type_pai = 'no-error' + dac_valid_from = valid_from + pai_valid_from = '' else: if test_case["error_flag"] == 'ext-skid-missing': error_type_dac = 'ext-akid-missing' else: error_type_dac = 'no-error' error_type_pai = test_case["error_flag"] + dac_valid_from = '' + pai_valid_from = valid_from vid = 0xFFF1 pid = 0x8000 # Generate PAI Cert/Key builder = DevCertBuilder(CertType.PAI, error_type_pai, args.paapath, test_case_out_dir, - chipcert, vid, PID_NOT_PRESENT, '') + chipcert, vid, PID_NOT_PRESENT, '', pai_valid_from) builder.make_certs_and_keys() if test_cert == 'pai': @@ -813,7 +845,7 @@ def main(): # Generate DAC Cert/Key builder = DevCertBuilder(CertType.DAC, error_type_dac, args.paapath, test_case_out_dir, - chipcert, vid, pid, '') + chipcert, vid, pid, '', dac_valid_from) builder.make_certs_and_keys() # Generate Certification Declaration (CD) @@ -859,12 +891,12 @@ def main(): # Generate PAI Cert/Key builder = DevCertBuilder(CertType.PAI, 'no-error', args.paapath, test_case_out_dir, - chipcert, vid_pai, pid_pai, common_name_pai) + chipcert, vid_pai, pid_pai, common_name_pai, '') builder.make_certs_and_keys() # Generate DAC Cert/Key builder = DevCertBuilder(CertType.DAC, 'no-error', args.paapath, test_case_out_dir, - chipcert, vid_dac, pid_dac, common_name_dac) + chipcert, vid_dac, pid_dac, common_name_dac, '') builder.make_certs_and_keys() # Generate Certification Declaration (CD) @@ -882,12 +914,12 @@ def main(): # Generate PAI Cert/Key builder = DevCertBuilder(CertType.PAI, 'no-error', args.paapath, test_case_out_dir, - chipcert, vid, pid, '') + chipcert, vid, pid, '', '') builder.make_certs_and_keys() # Generate DAC Cert/Key builder = DevCertBuilder(CertType.DAC, 'no-error', args.paapath, test_case_out_dir, - chipcert, vid, pid, '') + chipcert, vid, pid, '', '') builder.make_certs_and_keys() # Generate Certification Declaration (CD)