Skip to content

Commit

Permalink
Support New VID/PID Encoding in the Subject of Attestation Certs DN. (p…
Browse files Browse the repository at this point in the history
…roject-chip#16900)

* Updated OpenSSL and mbedTLS implementations to support that.
 * Updated chip-cert tool to support new format in addition to the old one.
 * Added new test verctors:
  -- Updated Matter Development DAC (PIDs 0x8010-0x8014) to use
     Fallback methods to encode VID and PID in the SubjectDN.
  -- Added new Matter Test DAC/PAI vectors that use Fallback methods
     to encode VID and PID in the SubjectDN.
  • Loading branch information
emargolis authored and chencheung committed Apr 6, 2022
1 parent dd91dc3 commit 33e56ab
Show file tree
Hide file tree
Showing 66 changed files with 1,389 additions and 322 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB6DCCAY6gAwIBAgIIQRJfuR0qtYEwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
MIIB5zCCAY6gAwIBAgIIRn9XYsjckNUwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
TWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZG
RjEwIBcNMjIwMjA2MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
RjEwIBcNMjIwMzMxMDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
HE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMTAxFDASBgorBgEEAYKifAIBDARG
RkYxMRQwEgYKKwYBBAGConwCAgwEODAxMDBZMBMGByqGSM49AgEGCCqGSM49AwEH
A0IABDnvbJ2cmXuixzGaTHPJv0fbzbxCxUE+7BRSdbiPwRqxrQvDPvFMJ5QEQp8v
XucKBRty5se55zVO2vkqtP/4hC+jYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/
BAQDAgeAMB0GA1UdDgQWBBQy/CfR71NDovNk8Cz0cMtnR4DlqjAfBgNVHSMEGDAW
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNIADBFAiB0KDniuINl
4nwCTJFvbWP3yZgDSc09ZVXPp8ZR3Gm99QIhAI5bZlt2pIGkJyJHpd69et1hclg2
SRIpst9EJFQ+ZSoM
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNHADBEAiBvEbIFC9PS
42wkYTAIbCIBsIz5nVp3sjqQBQD77wkTsgIgE2q2oLuL1PSt+AoSNM/vtn8K+3NV
8dykctoWrEo2ZOU=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB6DCCAY6gAwIBAgIIRNdB6F0oUAwwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
MIIB6TCCAY6gAwIBAgIIDlyIzBXj2uUwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
TWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZG
RjEwIBcNMjIwMjA2MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
RjEwIBcNMjIwMzMxMDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
HE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMTExFDASBgorBgEEAYKifAIBDARG
RkYxMRQwEgYKKwYBBAGConwCAgwEODAxMTBZMBMGByqGSM49AgEGCCqGSM49AwEH
A0IABFi0dfQbWeJeZuGKwmELisK+0oAQ8oS/WJNbIKzbvVXP6ZqFcr/KDSi2Yy/0
iD9JxpHa2Z3cqq2kHlwZGkwfkLSjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/
BAQDAgeAMB0GA1UdDgQWBBSWEIV/WCCgXxAs+9bk8mvO0iBvVDAfBgNVHSMEGDAW
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNIADBFAiEA0m2mksxI
giUoAnlrG/Qoi+MPL8cvZTSOtmZ/uqsidlICIE1cQuL12M3gbJOHYt5OnC+z27GD
MA9hZdbmOi2JJZNJ
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNJADBGAiEAk+acqnAZ
ISQgS1HaXKcHyp72ub3gZxDtvFkjrnDFTqYCIQDFTFl42qIeUyh8xfVzxUjIqIHU
s/l66cZxovK3lrMEvQ==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB6TCCAY6gAwIBAgIILAgPVJnuQh4wCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
MIIB6TCCAY6gAwIBAgIIQS3Hk+UVQJwwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
TWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZG
RjEwIBcNMjIwMjA2MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
RjEwIBcNMjIwMzMxMDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
HE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMTIxFDASBgorBgEEAYKifAIBDARG
RkYxMRQwEgYKKwYBBAGConwCAgwEODAxMjBZMBMGByqGSM49AgEGCCqGSM49AwEH
A0IABNwswWxNgInGBjczlqKGKgXvhReZ2fXucOYRUidpt9F8z5rUJ5YsLzK4qyIn
onYkHaCLbPZlcc6fKOLnVwNjd7OjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/
BAQDAgeAMB0GA1UdDgQWBBS3SLLL9TrJvHzqhAV869e1BNcE6jAfBgNVHSMEGDAW
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNJADBGAiEAr6uqGS7N
UjSopAYGBHpJ69OaW/CUQmwZwSVWFR1HRmgCIQCCs6WH8b8Fki+mQyQq1lXAKMbp
xGzmsG38cxZYuWk/wg==
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNJADBGAiEA0ed41M0e
Jq7fj0kLjlhXYGAE/SyLU3TJ2CxmfVHNqigCIQDoO8qhD7xhgMXuy3XZn54ylfQy
pJfaJecR4HHAETt1sw==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB5zCCAY6gAwIBAgIIEsKL6Q7QW4owCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
MIIB6DCCAY6gAwIBAgIIe01HLgWaxwswCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
TWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZG
RjEwIBcNMjIwMjA2MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
RjEwIBcNMjIwMzMxMDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
HE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMTMxFDASBgorBgEEAYKifAIBDARG
RkYxMRQwEgYKKwYBBAGConwCAgwEODAxMzBZMBMGByqGSM49AgEGCCqGSM49AwEH
A0IABDH7NK5PCcBb0LyvN7X6vk1Wfu0a6BSwDfhJxR6GbRqC+ckUH8fHzC+L09rs
MGJoxK1jv7/EzZG6VJ754/apenqjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/
BAQDAgeAMB0GA1UdDgQWBBRrg74NBV8oc8rAuhUhHd8WPZXLBTAfBgNVHSMEGDAW
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNHADBEAiEA+KQYq37H
8DbhYZ+/SR5IOBiCeenzwOFXcev4RnBqhnQCH3f314pJILwUEQl19mnYVPADirAT
Ws+HYn14tcbjwCI=
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNIADBFAiB9FQvwRe2r
0QkUKq604JfYqvkanOF+6TilbiQmJqhDSQIhAOgMMUtzj4ivjBYp1fWkYClWULUH
dwzCzDvE2ih6LSyf
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
-----BEGIN CERTIFICATE-----
MIIB5zCCAY6gAwIBAgIIeZnb+zmY6TMwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
MIIB6DCCAY6gAwIBAgIIaZAF4O2oUEcwCgYIKoZIzj0EAwIwPTElMCMGA1UEAwwc
TWF0dGVyIERldiBQQUkgMHhGRkYxIG5vIFBJRDEUMBIGCisGAQQBgqJ8AgEMBEZG
RjEwIBcNMjIwMjA2MDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
RjEwIBcNMjIwMzMxMDAwMDAwWhgPOTk5OTEyMzEyMzU5NTlaMFMxJTAjBgNVBAMM
HE1hdHRlciBEZXYgREFDIDB4RkZGMS8weDgwMTQxFDASBgorBgEEAYKifAIBDARG
RkYxMRQwEgYKKwYBBAGConwCAgwEODAxNDBZMBMGByqGSM49AgEGCCqGSM49AwEH
A0IABLceKQyrhzHIn5ldUczEoYmb80KiDtbdI0xOks4KeEMJpQHT1kD/Fp4TTN5a
x3ez2uZqVKMpR7kHBDhMUUSjxVCjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/
BAQDAgeAMB0GA1UdDgQWBBTD7MC2Ctky6YO1evTBTpp5vYVhHTAfBgNVHSMEGDAW
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNHADBEAiBi/dOUlf2i
2dIbtfqNZchHuqg3NwpRhFEt74/A/38VCQIgd7HckBf2YoMwTIA3pA+fsU/QI3ux
IEn8INdxtoB0uSE=
gBRjVA5H9kscONE4hKRi0WwZXY/7PDAKBggqhkjOPQQDAgNIADBFAiBnmLFREnAT
R4fiz5VAKd+x+o/oUOG9JDdWsEATpBTDCQIhANrlaZTzKHiA1l21ExqbvbsatU2l
EMgBLr6CYnPwDZnk
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBsDCCAVWgAwIBAgIIGSrY3njPsqwwCgYIKoZIzj0EAwIwJDEiMCAGA1UEAwwZ
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMjAgFw0yMTA2MjgxNDIzNDNaGA85OTk5
MTIzMTIzNTk1OVowMzExMC8GA1UEAwwoTWF0dGVyIFRlc3QgREFDIDAwMTggTXZp
ZDpGRkYyIE1waWQ6ODAwMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABFPuqPoD
Gmq9sDKfTVdjeag4w702QLebajV1x9MvgHKqOixKGXUaCE93zLGvrb4bejaT7/40
v1uN0UY5b+Z9B/2jYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMB0G
A1UdDgQWBBTgXTY9MQ9Djz3wVu3TxBJjafeQMjAfBgNVHSMEGDAWgBSjW/AA0ned
0o2RindE3lt/EeRNJzAKBggqhkjOPQQDAgNJADBGAiEAwiyOLaU++0oIjyoiM30b
u1SUlTAWNKawPdPAvRGjMawCIQCBD4++9rdk70swXpoGQnfyx2GMHAWLjBdPsOHq
uF8Qrg==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIJrs9o8Glj3dXkPjoo/K6rFvpjA8tbYLNIBP07yuueg0oAoGCCqGSM49
AwEHoUQDQgAEU+6o+gMaar2wMp9NV2N5qDjDvTZAt5tqNXXH0y+Acqo6LEoZdRoI
T3fMsa+tvht6NpPv/jS/W43RRjlv5n0H/Q==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBrzCCAVWgAwIBAgIIXbqoPGVmY5owCgYIKoZIzj0EAwIwJDEiMCAGA1UEAwwZ
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMjAgFw0yMTA2MjgxNDIzNDNaGA85OTk5
MTIzMTIzNTk1OVowMzExMC8GA1UEAwwoTWF0dGVyIFRlc3QgREFDIDAwMTkgTXZp
ZDpGRkYyIE1waWQ6ODAwMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABD4IxF68
hibRTRCp/1eQTsCChYAb5jvYr0sFNbz0vnps0c5n+qTAzqYhUlGEB23qH/Hnxlva
VYs0gKiwoT9dSfmjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMB0G
A1UdDgQWBBQcgat5YdFIqCo/oljpkKE9Oxu71jAfBgNVHSMEGDAWgBSjW/AA0ned
0o2RindE3lt/EeRNJzAKBggqhkjOPQQDAgNIADBFAiEAiq8ycetmaUTfobg6Gr0q
rLIhAK6VMpJfxik3hwpN4KoCIAPV1RxE7VA/xuzUbi7x5ROOqccSqfnKfQDu5GlV
ucER
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIAsvosoyN5UXyZkvI6pr8j1VhlLi9bzEK5QTjxfRn5PYoAoGCCqGSM49
AwEHoUQDQgAEPgjEXryGJtFNEKn/V5BOwIKFgBvmO9ivSwU1vPS+emzRzmf6pMDO
piFSUYQHbeof8efGW9pVizSAqLChP11J+Q==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBrzCCAVWgAwIBAgIIJIC4D0PPTYYwCgYIKoZIzj0EAwIwJDEiMCAGA1UEAwwZ
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMjAgFw0yMTA2MjgxNDIzNDNaGA85OTk5
MTIzMTIzNTk1OVowMzExMC8GA1UEAwwoTWF0dGVyIFRlc3QgREFDIDAwMUEgTXZp
ZDpGRkYyIE1waWQ6ODAwMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABDEn9w4w
qZlUfemZbU0ZTn0DVIvpaK03Be8G6GRH6V5MuMnyjzCCcJTLMXA5b9dVRVfaiBhd
TB7alC/NIwn4rcSjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMB0G
A1UdDgQWBBQKutK+uVnqosYL1WfS0ruLpsOoFTAfBgNVHSMEGDAWgBSjW/AA0ned
0o2RindE3lt/EeRNJzAKBggqhkjOPQQDAgNIADBFAiA2ZXfLInYlU+NwG3TQicjj
Zk8pZyU9+dNtTHqr+n8+TAIhAO5bXp2WQxJzbqL/+crejqaPVb1BlZmXwvMocsY/
SnaC
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIKlv1M5yO/p4QSowc1Ldw/Ll4uX6WbXbFm6MqNM5a0J2oAoGCCqGSM49
AwEHoUQDQgAEMSf3DjCpmVR96ZltTRlOfQNUi+lorTcF7wboZEfpXky4yfKPMIJw
lMsxcDlv11VFV9qIGF1MHtqUL80jCfitxA==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBrzCCAVWgAwIBAgIIDk6/jHMqYm8wCgYIKoZIzj0EAwIwJDEiMCAGA1UEAwwZ
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMjAgFw0yMTA2MjgxNDIzNDNaGA85OTk5
MTIzMTIzNTk1OVowMzExMC8GA1UEAwwoTWF0dGVyIFRlc3QgREFDIDAwMUIgTXZp
ZDpGRkYyIE1waWQ6ODAwMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABGWEEU6Y
L1hefOGO3sbmPxl0BFpg5lcu/X9i+VDEAiuj5zfuYYS373bxDzQYdHJqtIw2DjOA
be4A7DRA0EcmjoGjYDBeMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgeAMB0G
A1UdDgQWBBRmXpeaBbu/5K4pOtHIbMpZYRmKFjAfBgNVHSMEGDAWgBSjW/AA0ned
0o2RindE3lt/EeRNJzAKBggqhkjOPQQDAgNIADBFAiBwb6Aygr66cTayZiQsZdfZ
C9DT6d/pkr9r+3Z5frVO+gIhAK2NHuh0RPFECA8qVIE9WJyv7XxO+mhE8pOtySZ3
SXsb
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIG/j4QjE8hk2b46HqX5eiqU61L2KnrhdPe6/lOdByJoioAoGCCqGSM49
AwEHoUQDQgAEZYQRTpgvWF584Y7exuY/GXQEWmDmVy79f2L5UMQCK6PnN+5hhLfv
dvEPNBh0cmq0jDYOM4Bt7gDsNEDQRyaOgQ==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBuTCCAV+gAwIBAgIIPwQsfYTBN4MwCgYIKoZIzj0EAwIwLjEsMCoGA1UEAwwj
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMiBNcGlkOjgwMDQwIBcNMjEwNjI4MTQy
MzQzWhgPOTk5OTEyMzEyMzU5NTlaMDMxMTAvBgNVBAMMKE1hdHRlciBUZXN0IERB
QyAwMDFDIE12aWQ6RkZGMiBNcGlkOjgwMDQwWTATBgcqhkjOPQIBBggqhkjOPQMB
BwNCAATS1G7OS6R6dx3v3TVIE+dprjuvoLIOB/QoWOrZS2HnokpTaqG9+x0EbcA3
qLdqNM+Y0982KJndsj0n8ogjdpKMo2AwXjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB
/wQEAwIHgDAdBgNVHQ4EFgQUoQV3yh38jrP3DNn11kU0oiWqgHIwHwYDVR0jBBgw
FoAUQZgNTBcLidBxY4NtXsOoALk444cwCgYIKoZIzj0EAwIDSAAwRQIhAKnK60EK
/ByJtBAI44uULlxr5ftOakk5uD5Sdc5Pfu7LAiAtYj/9xuyJw3G7DEDS21x93h3S
FBCRrv7kBHIe/q3umQ==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIN+36O+qvjdrZh8dTemLFBsCWJB5BxChk3dSIGsgtkZuoAoGCCqGSM49
AwEHoUQDQgAE0tRuzkukencd7901SBPnaa47r6CyDgf0KFjq2Uth56JKU2qhvfsd
BG3AN6i3ajTPmNPfNiiZ3bI9J/KII3aSjA==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBujCCAV+gAwIBAgIIR4wY4yP20TkwCgYIKoZIzj0EAwIwLjEsMCoGA1UEAwwj
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMiBNcGlkOjgwMDQwIBcNMjEwNjI4MTQy
MzQzWhgPOTk5OTEyMzEyMzU5NTlaMDMxMTAvBgNVBAMMKE1hdHRlciBUZXN0IERB
QyAwMDFEIE12aWQ6RkZGMiBNcGlkOjgwMDQwWTATBgcqhkjOPQIBBggqhkjOPQMB
BwNCAAS5ycwSzdZnkdVS5MNWIqZoACGXrSONjDmXBz01UzpUCrjAFHjqhjmCCyEJ
4/8CwIHAbPOz2StysKTY5St6gwjOo2AwXjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB
/wQEAwIHgDAdBgNVHQ4EFgQUldDYyfGU4prCjHYfxzI7XqiCqTgwHwYDVR0jBBgw
FoAUQZgNTBcLidBxY4NtXsOoALk444cwCgYIKoZIzj0EAwIDSQAwRgIhANTYpDkc
ka6dyX9k+ey0pMdkWLTeRkox4Us5fOwKvZkcAiEAgP557EHTTbT87aDxea4evGNr
Yb70T3Fi/oi1PJwNzqw=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIOgDCXeOFHHNRVbML135UO78l+pdM1Cf0Tzf5HDYt3F4oAoGCCqGSM49
AwEHoUQDQgAEucnMEs3WZ5HVUuTDViKmaAAhl60jjYw5lwc9NVM6VAq4wBR46oY5
ggshCeP/AsCBwGzzs9krcrCk2OUreoMIzg==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBuTCCAV+gAwIBAgIIK0hqYkbEiY0wCgYIKoZIzj0EAwIwLjEsMCoGA1UEAwwj
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMiBNcGlkOjgwMDQwIBcNMjEwNjI4MTQy
MzQzWhgPOTk5OTEyMzEyMzU5NTlaMDMxMTAvBgNVBAMMKE1hdHRlciBUZXN0IERB
QyAwMDFFIE12aWQ6RkZGMiBNcGlkOjgwMDQwWTATBgcqhkjOPQIBBggqhkjOPQMB
BwNCAAR7FkXn9bdBH8wKiYVhI+iOk0wsjMnUYhqwza+IYGzevA9xPPai7gncwMse
ZCDzRF0h4m6YJqtsyj2JC2934Mkko2AwXjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB
/wQEAwIHgDAdBgNVHQ4EFgQUMkdklwuYFhVufr0+HNtoVp31GVgwHwYDVR0jBBgw
FoAUQZgNTBcLidBxY4NtXsOoALk444cwCgYIKoZIzj0EAwIDSAAwRQIgJdu4bLad
HuKsBMxgIMWx1mYzCoMBmhtVW6vtGZUWLDECIQCjz8uB1L7SxMRWSkbxlsHnlQhB
rFKY4tnMybU2+UUYaA==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIJNHv2rJFEpOqbpgE7So/JIE+b2g4w3ky3+OkojKJUbboAoGCCqGSM49
AwEHoUQDQgAEexZF5/W3QR/MComFYSPojpNMLIzJ1GIasM2viGBs3rwPcTz2ou4J
3MDLHmQg80RdIeJumCarbMo9iQtvd+DJJA==
-----END EC PRIVATE KEY-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-----BEGIN CERTIFICATE-----
MIIBuTCCAV+gAwIBAgIId4YK+X9vDwAwCgYIKoZIzj0EAwIwLjEsMCoGA1UEAwwj
TWF0dGVyIFRlc3QgUEFJIE12aWQ6RkZGMiBNcGlkOjgwMDQwIBcNMjEwNjI4MTQy
MzQzWhgPOTk5OTEyMzEyMzU5NTlaMDMxMTAvBgNVBAMMKE1hdHRlciBUZXN0IERB
QyAwMDFGIE12aWQ6RkZGMiBNcGlkOjgwMDQwWTATBgcqhkjOPQIBBggqhkjOPQMB
BwNCAATxCuZZ0nb4bBXCe038q3cEOyFV/wl06EiQWnyajDopyNXYFJH+pR5H+kMu
LPC+NYMuFmsOGb1wAOGJEeHh3bito2AwXjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB
/wQEAwIHgDAdBgNVHQ4EFgQUAfv0xXFbATOVT5B+B2VTzM50b2swHwYDVR0jBBgw
FoAUQZgNTBcLidBxY4NtXsOoALk444cwCgYIKoZIzj0EAwIDSAAwRQIgIaB8WNic
7HJ6UevKdrwLkeb2QOGAWD1DythJJ2rH4QsCIQCgR9hYGYuZt7cKzKcxvFtQbaRH
fKXlZbJMiXVdAhS9vg==
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEILqJ71ZkLlwUw98ZzjO/vyfsTg4r3tNfbWwzkp7FW8XroAoGCCqGSM49
AwEHoUQDQgAE8QrmWdJ2+GwVwntN/Kt3BDshVf8JdOhIkFp8mow6KcjV2BSR/qUe
R/pDLizwvjWDLhZrDhm9cADhiRHh4d24rQ==
-----END EC PRIVATE KEY-----
Binary file not shown.
11 changes: 11 additions & 0 deletions credentials/test/attestation/Chip-Test-PAI-FFF2-8004-FB-Cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN CERTIFICATE-----
MIIBpjCCAUygAwIBAgIIKIT2F0CUBJowCgYIKoZIzj0EAwIwGjEYMBYGA1UEAwwP
TWF0dGVyIFRlc3QgUEFBMCAXDTIxMDYyODE0MjM0M1oYDzk5OTkxMjMxMjM1OTU5
WjAuMSwwKgYDVQQDDCNNYXR0ZXIgVGVzdCBQQUkgTXZpZDpGRkYyIE1waWQ6ODAw
NDBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABP6DovY2zhAPjkwDrqWNtu/eTkNX
MjwysI32kk2/5OSrfTZ3BNAtPCa+wJYzGqBL0ooqwQ4j25bnJ0+0GQmHZaKjZjBk
MBIGA1UdEwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRB
mA1MFwuJ0HFjg21ew6gAuTjjhzAfBgNVHSMEGDAWgBTg/NfyInCrstRnWEcQ9eSH
doB6JjAKBggqhkjOPQQDAgNIADBFAiEApQHH015v7esx58M4MBNVdERBMFiwUPCm
kuZgD5cIR+4CIAoVm+v4gzvv/luqOqNrPJwJm3aN2UyZQd6X3aCOOQEF
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIKEIoeUnUudWDQrty6TVXSmCeLCMcuAGkHPXreKi+OIKoAoGCCqGSM49
AwEHoUQDQgAE/oOi9jbOEA+OTAOupY22795OQ1cyPDKwjfaSTb/k5Kt9NncE0C08
Jr7AljMaoEvSiirBDiPblucnT7QZCYdlog==
-----END EC PRIVATE KEY-----
Binary file not shown.
11 changes: 11 additions & 0 deletions credentials/test/attestation/Chip-Test-PAI-FFF2-NoPID-FB-Cert.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-----BEGIN CERTIFICATE-----
MIIBnDCCAUKgAwIBAgIIKSU+QSx/hrwwCgYIKoZIzj0EAwIwGjEYMBYGA1UEAwwP
TWF0dGVyIFRlc3QgUEFBMCAXDTIxMDYyODE0MjM0M1oYDzk5OTkxMjMxMjM1OTU5
WjAkMSIwIAYDVQQDDBlNYXR0ZXIgVGVzdCBQQUkgTXZpZDpGRkYyMFkwEwYHKoZI
zj0CAQYIKoZIzj0DAQcDQgAELSZJp9i6n8CZtM4wkygwprWwecNzod+DVacnzdLb
XlbM7uE5UmiGKR7McB5O//JVkbOP9P6WDSvKbNwpZ2j4y6NmMGQwEgYDVR0TAQH/
BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFKNb8ADSd53SjZGK
d0TeW38R5E0nMB8GA1UdIwQYMBaAFOD81/IicKuy1GdYRxD15Id2gHomMAoGCCqG
SM49BAMCA0gAMEUCIAJosJqDISH2y8suNVkUV++XlbFQBtGTFA2AzTbI1Ai+AiEA
n2idHTVCObWDte3PPdz+oynPdndR3Wuvn1W7pqlBF9s=
-----END CERTIFICATE-----
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIPeMoAnZpIF2eWLeXZiXJcxFDdSiy8Vp996Rdh+Qx38OoAoGCCqGSM49
AwEHoUQDQgAELSZJp9i6n8CZtM4wkygwprWwecNzod+DVacnzdLbXlbM7uE5UmiG
KR7McB5O//JVkbOP9P6WDSvKbNwpZ2j4yw==
-----END EC PRIVATE KEY-----
52 changes: 47 additions & 5 deletions credentials/test/gen-test-attestation-certs.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

#
# Copyright (c) 2021 Project CHIP Authors
# Copyright (c) 2021-2022 Project CHIP Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,7 +32,7 @@
# Second example also generates C-Style file with those certificates/keys to be use by the SDK tests:
# ./credentials/test/gen-test-attestation-certs.sh ./out/debug/standalone/chip-cert src/credentials/tests/CHIPAttCert_test_vectors
#
# In addision to the DER/PEM files this command also generates the following C-Style files:
# In addition to the DER/PEM files this command also generates the following C-Style files:
# src/credentials/tests/CHIPAttCert_test_vectors.cpp
# src/credentials/tests/CHIPAttCert_test_vectors.h
#
Expand Down Expand Up @@ -131,13 +131,55 @@ cert_lifetime=4294967295
done
}

# In addision to PEM format also create certificates in DER form.
# Set #4:
# - PAA Subject doesn't include VID (the same PAA from Set #2 is used)
# - PAI Subject doesn't include VID and PID encoded using fallback method
# - DAC Subject VID and PID are encoded using fallback method
{
pid=8003
dac_ids=(0018 0019 001A 001B)

pai_key_file="$dest_dir/Chip-Test-PAI-$vid-NoPID-FB-Key"
pai_cert_file="$dest_dir/Chip-Test-PAI-$vid-NoPID-FB-Cert"

"$chip_cert_tool" gen-att-cert --type i --subject-cn "Matter Test PAI" --subject-vid "$vid" --vid-pid-as-cn --valid-from "$cert_valid_from" --lifetime "$cert_lifetime" --ca-key "$paa_key_file".pem --ca-cert "$paa_cert_file".pem --out-key "$pai_key_file".pem --out "$pai_cert_file".pem

for dac in "${dac_ids[@]}"; do
dac_key_file="$dest_dir/Chip-Test-DAC-$vid-$pid-$dac-FB-Key"
dac_cert_file="$dest_dir/Chip-Test-DAC-$vid-$pid-$dac-FB-Cert"

"$chip_cert_tool" gen-att-cert --type d --subject-cn "Matter Test DAC $dac" --subject-vid "$vid" --subject-pid "$pid" --vid-pid-as-cn --valid-from "$cert_valid_from" --lifetime "$cert_lifetime" --ca-key "$pai_key_file".pem --ca-cert "$pai_cert_file".pem --out-key "$dac_key_file".pem --out "$dac_cert_file".pem
done
}

# Set #5:
# - PAA Subject doesn't include VID (the same PAA from Set #2 is used)
# - PAI Subject includes PID and both VID and PID are encoded using fallback method
# - DAC Subject VID and PID are encoded using fallback method
{
pid=8004
dac_ids=(001C 001D 001E 001F)

pai_key_file="$dest_dir/Chip-Test-PAI-$vid-$pid-FB-Key"
pai_cert_file="$dest_dir/Chip-Test-PAI-$vid-$pid-FB-Cert"

"$chip_cert_tool" gen-att-cert --type i --subject-cn "Matter Test PAI" --subject-vid "$vid" --subject-pid "$pid" --vid-pid-as-cn --valid-from "$cert_valid_from" --lifetime "$cert_lifetime" --ca-key "$paa_key_file".pem --ca-cert "$paa_cert_file".pem --out-key "$pai_key_file".pem --out "$pai_cert_file".pem

for dac in "${dac_ids[@]}"; do
dac_key_file="$dest_dir/Chip-Test-DAC-$vid-$pid-$dac-FB-Key"
dac_cert_file="$dest_dir/Chip-Test-DAC-$vid-$pid-$dac-FB-Cert"

"$chip_cert_tool" gen-att-cert --type d --subject-cn "Matter Test DAC $dac" --subject-vid "$vid" --subject-pid "$pid" --vid-pid-as-cn --valid-from "$cert_valid_from" --lifetime "$cert_lifetime" --ca-key "$pai_key_file".pem --ca-cert "$pai_cert_file".pem --out-key "$dac_key_file".pem --out "$dac_cert_file".pem
done
}

# In addition to PEM format also create certificates in DER form.
for cert_file_pem in "$dest_dir"/*Cert.pem; do
cert_file_der="${cert_file_pem/.pem/.der}"
"$chip_cert_tool" convert-cert "$cert_file_pem" "$cert_file_der" --x509-der
done

# In addision to PEM format also create private key in DER form.
# In addition to PEM format also create private key in DER form.
for key_file_pem in "$dest_dir"/*Key.pem; do
key_file_der="${key_file_pem/.pem/.der}"
"$chip_cert_tool" convert-key "$key_file_pem" "$key_file_der" --x509-der
Expand All @@ -148,7 +190,7 @@ if [ ! -z "$output_cstyle_file" ]; then

copyright_note='/*
*
* Copyright (c) 2021 Project CHIP Authors
* Copyright (c) 2021-2022 Project CHIP Authors
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Loading

0 comments on commit 33e56ab

Please sign in to comment.