aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJ08nY2025-04-01 16:39:13 +0200
committerJ08nY2025-04-01 16:39:13 +0200
commit7aacee686f4a2714d9e230bfdf20c79c21c6f461 (patch)
tree94a7bef609d7ea4d7c7e0190103a58cca2975b28
parent3bbbbeb1d5dcd88bd99da79b6b0395b6fc3b3a01 (diff)
downloadsec-certs-7aacee686f4a2714d9e230bfdf20c79c21c6f461.tar.gz
sec-certs-7aacee686f4a2714d9e230bfdf20c79c21c6f461.tar.zst
sec-certs-7aacee686f4a2714d9e230bfdf20c79c21c6f461.zip
Improve BSI cert_id regex.
-rw-r--r--src/sec_certs/rules.yaml2
-rw-r--r--tests/cc/test_cc_misc.py1
2 files changed, 2 insertions, 1 deletions
diff --git a/src/sec_certs/rules.yaml b/src/sec_certs/rules.yaml
index f17eb242..bf7af391 100644
--- a/src/sec_certs/rules.yaml
+++ b/src/sec_certs/rules.yaml
@@ -5,7 +5,7 @@
#####
cc_cert_id:
DE:
- - "BSI-DSZ-CC-(?:(?P<s>S)-)?(?P<counter>[0-9]{3,5})-?(?:(?P<version>[vV][0-9])-)?(?P<year>[0-9]{4})?(?:-(?P<doc>(?:RA|MA)(?:-[0-9]+)?))?"
+ - "BSI[-_]DSZ[-_]CC[-_](?:(?P<s>S)[-_])?(?P<counter>[0-9]{3,5})[-_]?(?:(?P<version>[vV][0-9])[-_])?(?P<year>[0-9]{4})?(?:[-_](?P<doc>(?:RA|MA)(?:[-_][0-9]+)?))?"
# Examples:
# BSI-DSZ-CC-1004
# BSI-DSZ-CC-0973-2016
diff --git a/tests/cc/test_cc_misc.py b/tests/cc/test_cc_misc.py
index 2f9dcea7..76c0cdc6 100644
--- a/tests/cc/test_cc_misc.py
+++ b/tests/cc/test_cc_misc.py
@@ -30,6 +30,7 @@ def test_canonicalize_fr(n):
def test_canonicalize_de(n):
assert canonicalize_n(n, "BSI-DSZ-CC-0420-2007", "DE") == "BSI-DSZ-CC-0420-2007"
assert canonicalize_n(n, "BSI-DSZ-CC-1004", "DE") == "BSI-DSZ-CC-1004"
+ assert canonicalize_n(n, "BSI_DSZ_CC_0348_2006", "DE") == "BSI-DSZ-CC-0348-2006"
assert canonicalize_n(n, "BSI-DSZ-CC-0831-V4-2021", "DE") == "BSI-DSZ-CC-0831-V4-2021"
assert canonicalize_n(n, "BSI-DSZ-CC-0837-V2-2014-MA-01", "DE") == "BSI-DSZ-CC-0837-V2-2014-MA-01"