From a0295ea672ed0c74c0ee68d4ae6ec37dab2e5429 Mon Sep 17 00:00:00 2001 From: bob reynders Date: Fri, 1 Nov 2024 14:13:30 +0100 Subject: [PATCH] qcp-n-qscd: 412-2 content-commitment to true --- pkilint/etsi/__init__.py | 15 ++++++--- .../invalid_keyusage.crttest | 31 +++++++++++++++++++ 2 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 tests/integration_certificate/etsi/qcp_n_qscd_final_certificate/invalid_keyusage.crttest diff --git a/pkilint/etsi/__init__.py b/pkilint/etsi/__init__.py index 5fb67f0..06a0d04 100644 --- a/pkilint/etsi/__init__.py +++ b/pkilint/etsi/__init__.py @@ -364,11 +364,18 @@ def create_validators( ) ) elif certificate_type in etsi_constants.NATURAL_PERSON_CERTIFICATE_TYPES: - extension_validators.append( - en_319_412_2.NaturalPersonKeyUsageValidator( - is_content_commitment_type=None + if certificate_type in etsi_constants.QCP_N_CERTIFICATE_TYPES: + extension_validators.append( + en_319_412_2.NaturalPersonKeyUsageValidator( + is_content_commitment_type=True + ) + ) + else: + extension_validators.append( + en_319_412_2.NaturalPersonKeyUsageValidator( + is_content_commitment_type=None + ) ) - ) if certificate_type in etsi_constants.QEVCP_W_PSD2_EIDAS_CERTIFICATE_TYPES: qc_statement_validators.append(ts_119_495.PresenceofQCEUPDSStatementValidator()) diff --git a/tests/integration_certificate/etsi/qcp_n_qscd_final_certificate/invalid_keyusage.crttest b/tests/integration_certificate/etsi/qcp_n_qscd_final_certificate/invalid_keyusage.crttest new file mode 100644 index 0000000..5e34e59 --- /dev/null +++ b/tests/integration_certificate/etsi/qcp_n_qscd_final_certificate/invalid_keyusage.crttest @@ -0,0 +1,31 @@ +-----BEGIN CERTIFICATE----- +MIIEqzCCA5OgAwIBAgINAOLwigtcLS7v6mSEHDANBgkqhkiG9w0BAQsFADB2MTEw +LwYDVQQDDChDbGV2ZXJiYXNlIElEIFBLSW92ZXJoZWlkIEJ1cmdlciBDQSAtIEc0 +MRswGQYDVQQKDBJDbG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XJiYXNlLmNvbS9sb2Nh +dGlvbi5vZi5jcmwwDQYJKoZIhvcNAQELBQADggEBALV4uuIEMD/tRZVWSQFuiH11 +JFLfgpbjpzLyhsm4+RoOB/EnAdNwSbgIz3s/mthO58QwkVB073GihM2R67EOMB9g +xIz5TdSWKrDb/bD+YA3RpZCy/HgQ9qKN1fRyPTMYNw7mSYfvsyOz70AGVCOzHgqt +OoBI7oExBRyMAsfXbKhZmZPu4mhhhIND9Lqke58jECN56cZHpaPR+JdvjN+CC9C2 +G6YzYQfr44HARAg3wI0nNfuGeTfLhek2Pg2fl3nHUyeAEPCDl1DJftGvwUxH4JNy +FJENtzfO8TjYbj5jAl2HdsFMsaR5/24k97RwbUi7r6cx2Gs24nXB30qszuV5JCU= +-----END CERTIFICATE----- + +node_path,validator,severity,code,message +certificate.tbsCertificate.extensions.2.extnValue.subjectKeyIdentifier,SubjectKeyIdentifierValidator,INFO,pkix.subject_key_identifier_method_1_identified, +certificate.tbsCertificate.extensions.4.extnValue.keyUsage,NaturalPersonKeyUsageValidator,ERROR,etsi.en_319_412_2.nat-4.3.2-1.invalid_content_commitment_setting,