1
1
#! /usr/bin/env bash
2
2
3
3
#
4
- # Copyright (c) 2021-2022 Project CHIP Authors
4
+ # Copyright (c) 2021-2023 Project CHIP Authors
5
5
#
6
6
# Licensed under the Apache License, Version 2.0 (the "License");
7
7
# you may not use this file except in compliance with the License.
@@ -340,6 +340,59 @@ cert_lifetime=4294967295
340
340
" $chip_cert_tool " gen-att-cert --type i --subject-cn " Matter Test PAI" --subject-vid " $vid " --valid-from " $cert_valid_from " --lifetime " $cert_lifetime " --ca-key " $paa_key_file " .pem --ca-cert " $paa_cert_file " .pem --key " $pai_key_file " .pem --out " $pai_cert_file " .pem
341
341
}
342
342
343
+ # Set #8:
344
+ # - Generate DACs with CRL Distribution Point (CDP) Extensions (Valid and Invalid cases)
345
+ {
346
+ vid=FFF1
347
+ pid=8000
348
+ dac=0000
349
+
350
+ pai_key_file=" $dest_dir /Chip-Test-PAI-$vid -$pid -Key"
351
+ pai_cert_file=" $dest_dir /Chip-Test-PAI-$vid -$pid -Cert"
352
+
353
+ dac_key_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-Key"
354
+ dac_cert_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-Cert"
355
+
356
+ cdp_example=" URI:http://example.com/crl.pem"
357
+
358
+ " $chip_cert_tool " gen-att-cert --type d --subject-cn " Matter Test DAC $dac CDP (HTTP)" --subject-vid " $vid " --subject-pid " $pid " --valid-from " $cert_valid_from " --lifetime " $cert_lifetime " --cpd-ext " $cdp_example " --ca-key " $pai_key_file " .pem --ca-cert " $pai_cert_file " .pem --out-key " $dac_key_file " .pem --out " $dac_cert_file " .pem
359
+
360
+ dac_key_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-HTTPS-Key"
361
+ dac_cert_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-HTTPS-Cert"
362
+
363
+ cdp_example=" URI:https://example.com/crl.pem"
364
+
365
+ " $chip_cert_tool " gen-att-cert --type d --subject-cn " Matter Test DAC $dac CDP (HTTPS)" --subject-vid " $vid " --subject-pid " $pid " --valid-from " $cert_valid_from " --lifetime " $cert_lifetime " --cpd-ext " $cdp_example " --ca-key " $pai_key_file " .pem --ca-cert " $pai_cert_file " .pem --out-key " $dac_key_file " .pem --out " $dac_cert_file " .pem
366
+
367
+ dac_key_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -2CDPs-Key"
368
+ dac_cert_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -2CDPs-Cert"
369
+
370
+ cdp_example2=" URI:http://example.com/crl2.pem"
371
+
372
+ " $chip_cert_tool " gen-att-cert --type d --subject-cn " Matter Test DAC $dac Two CDPs" --subject-vid " $vid " --subject-pid " $pid " --valid-from " $cert_valid_from " --lifetime " $cert_lifetime " --cpd-ext " $cdp_example " --cpd-ext " $cdp_example2 " --ca-key " $pai_key_file " .pem --ca-cert " $pai_cert_file " .pem --out-key " $dac_key_file " .pem --out " $dac_cert_file " .pem
373
+
374
+ dac_key_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-2URIs-Key"
375
+ dac_cert_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-2URIs-Cert"
376
+
377
+ cdp_example2in1=" URI:http://example.com/crl.pem,URI:http://example.com/crl2.pem"
378
+
379
+ " $chip_cert_tool " gen-att-cert --type d --subject-cn " Matter Test DAC $dac CDP (Two URIs)" --subject-vid " $vid " --subject-pid " $pid " --valid-from " $cert_valid_from " --lifetime " $cert_lifetime " --cpd-ext " $cdp_example2in1 " --ca-key " $pai_key_file " .pem --ca-cert " $pai_cert_file " .pem --out-key " $dac_key_file " .pem --out " $dac_cert_file " .pem
380
+
381
+ dac_key_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-Long-Key"
382
+ dac_cert_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-Long-Cert"
383
+
384
+ cdp_example=" URI:https://example.com/this-is-an-example-of-crl-distribution-point-extension-which-is-101-chars/crl.pem"
385
+
386
+ " $chip_cert_tool " gen-att-cert --type d --subject-cn " Long" --subject-vid " $vid " --subject-pid " $pid " --valid-from " $cert_valid_from " --lifetime " $cert_lifetime " --cpd-ext " $cdp_example " --ca-key " $pai_key_file " .pem --ca-cert " $pai_cert_file " .pem --out-key " $dac_key_file " .pem --out " $dac_cert_file " .pem
387
+
388
+ dac_key_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-Wrong-Prefix-Key"
389
+ dac_cert_file=" $dest_dir /Chip-Test-DAC-$vid -$pid -$dac -CDP-Wrong-Prefix-Cert"
390
+
391
+ cdp_example=" URI:www.example.com/crl.pem"
392
+
393
+ " $chip_cert_tool " gen-att-cert --type d --subject-cn " Long" --subject-vid " $vid " --subject-pid " $pid " --valid-from " $cert_valid_from " --lifetime " $cert_lifetime " --cpd-ext " $cdp_example " --ca-key " $pai_key_file " .pem --ca-cert " $pai_cert_file " .pem --out-key " $dac_key_file " .pem --out " $dac_cert_file " .pem
394
+ }
395
+
343
396
# In addition to PEM format also create certificates in DER form.
344
397
for cert_file_pem in " $dest_dir " /* Cert.pem; do
345
398
cert_file_der=" ${cert_file_pem/ .pem/ .der} "
@@ -357,7 +410,7 @@ if [ ! -z "$output_cstyle_file" ]; then
357
410
358
411
copyright_note=' /*
359
412
*
360
- * Copyright (c) 2021-2022 Project CHIP Authors
413
+ * Copyright (c) 2021-2023 Project CHIP Authors
361
414
* All rights reserved.
362
415
*
363
416
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -380,6 +433,8 @@ if [ ! -z "$output_cstyle_file" ]; then
380
433
'
381
434
header_includes='
382
435
#pragma once
436
+
437
+ #include <lib/support/Span.h>
383
438
'
384
439
385
440
namespaces_open='
0 commit comments