-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QCP-N-QSCD 411 1(411 2), 412-2 and 412 5 #129
base: main
Are you sure you want to change the base?
QCP-N-QSCD 411 1(411 2), 412-2 and 412 5 #129
Conversation
# PR Question: Is this from 415_5.qcs-4.2? Needs different classifier? | ||
allowances[en_319_412_5.id_etsi_qcs_QcCClegislation] = Rfc2119Word.MUST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering what the source was for this rule. I couldn't really find it other than the reference in 412-5 QCS 4.2. If so, would it need a different source in the validation finding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See table 1A in EN 319 412 5, clause 4.2.1. The CCLegislation statement is needed for certs that are qualified but not in the EU.
0929950
to
0e59ab3
Compare
e06fa2d
to
6567785
Compare
6567785
to
caa9f65
Compare
Moved to ready-for-review since the ETSI rules are now considered feature-complete from my end (and I'm going to shift towards implementing the POR rules now), looking forward to the feedback! |
Thank you this great contribution, @breynders-cb! I'm currently traveling for work this week, but will review this PR fully when I return next week. As for the test case generation, we use der-ascii to generate test artifacts. It has a bit of learning curve to use, but quite powerful and flexible. The test case file format is the PEM text of the artifact followed by the CSV-formatted output of findings. This makes it relatively simple to write test case generation scripts. We originally did not flesh out the ETSI |
Great, thanks! I'll add der-ascii to my list of tools, for now I spruced up some of our test code and generated test certificates through bouncy castle so all new rules should have tests in the PEM+csv format. |
caa9f65
to
a0295ea
Compare
a0295ea
to
dd6e770
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution! Overall, I think this PR is in pretty good shape. I added some comments for relatively minor things.
In regard to the development of test cases, do you plan on adding more, or should I assist in creating them?
@@ -27,6 +27,7 @@ class CertificateType(enum.IntEnum): | |||
QNCP_W_GEN_LEGAL_PERSON_NON_EIDAS_PRE_CERTIFICATE = auto() | |||
QEVCP_W_PSD2_EIDAS_PRE_CERTIFICATE = auto() | |||
QEVCP_W_PSD2_EIDAS_NON_BROWSER_PRE_CERTIFICATE = auto() | |||
QCP_N_QSCD_PRE_CERTIFICATE = auto() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certificate Transparency for eSig/eSeal certs likely will not be a thing for a long time (if ever), so I think this type can be removed. That being said, we can keep it if we see value in having it.
@@ -256,6 +266,10 @@ def from_option_str(value): | |||
|
|||
NON_EU_QWAC_TYPES = QWAC_TYPES - EU_QWAC_TYPES | |||
|
|||
EU_SSCD = QCP_N_QSCD_CERTIFICATE_TYPES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: rename to EU_SSCD_TYPES
to match naming convention of other certificate type sets
@@ -256,6 +266,10 @@ def from_option_str(value): | |||
|
|||
NON_EU_QWAC_TYPES = QWAC_TYPES - EU_QWAC_TYPES | |||
|
|||
EU_SSCD = QCP_N_QSCD_CERTIFICATE_TYPES | |||
|
|||
EU = EU_QWAC_TYPES | EU_SSCD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: rename to EU_TYPES
to match naming convention of other certificate type sets
certificate.tbsCertificate.issuer.rdnSequence,LegalPersonIssuerAttributeAllowanceValidator,ERROR,etsi.en_319_412_2.gen-4.2.3.1-2.country_attribute_absent, | ||
certificate.tbsCertificate.issuer.rdnSequence,LegalPersonIssuerAttributeAllowanceValidator,ERROR,etsi.en_319_412_2.gen-4.2.3.1-2.common_name_attribute_absent, | ||
certificate.tbsCertificate.issuer.rdnSequence,LegalPersonIssuerAttributeAllowanceValidator,ERROR,etsi.en_319_412_2.gen-4.2.3.1-2.organization_name_attribute_absent, | ||
certificate.tbsCertificate.extensions.2.extnValue.subjectKeyIdentifier,SubjectKeyIdentifierValidator,INFO,pkix.subject_key_identifier_method_1_identified, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: add newline to end of file
|
||
node_path,validator,severity,code,message | ||
certificate.tbsCertificate.extensions,QcStatementPresenceValidator,ERROR,etsi.en_319_412_5.qcs-5.01, | ||
certificate.tbsCertificate.extensions.1.extnValue.subjectKeyIdentifier,SubjectKeyIdentifierValidator,INFO,pkix.subject_key_identifier_method_1_identified, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: add newline to end of file
# PR Question: Is this from 415_5.qcs-4.2? Needs different classifier? | ||
allowances[en_319_412_5.id_etsi_qcs_QcCClegislation] = Rfc2119Word.MUST |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See table 1A in EN 319 412 5, clause 4.2.1. The CCLegislation statement is needed for certs that are qualified but not in the EU.
@@ -463,6 +463,10 @@ class QualifiedCertificatePoliciesValidator(validation.Validator): | |||
etsi_constants.QNCP_W_GEN_NP_EIDAS_CERTIFICATE_TYPES, | |||
en_319_411_2.id_qncp_web_gen, | |||
), | |||
( | |||
etsi_constants.QCP_N_QSCD_CERTIFICATE_TYPES, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove or change the TODO comment on line 453 to note that QSCD certs are now supported?
@@ -312,6 +317,16 @@ def create_validators( | |||
en_319_412_2.NaturalPersonSubjectAttributeAllowanceValidator() | |||
) | |||
|
|||
if certificate_type in etsi_constants.EU: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this if
statement can be removed, as the issuer requirements are applicable for non-EU certs as well.
|
||
|
||
class LegalPersonDuplicateAttributeAllowanceValidator(validation.Validator): | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These citation comments should probably be moved to the appropriate sub-class so they document the validation finding declaration.
@@ -307,6 +309,24 @@ def __init__(self): | |||
) | |||
|
|||
|
|||
class QcStatementPresenceValidator(extension.ExtensionPresenceValidator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this class is needed, as the NaturalPersonExtensionIdentifierAllowanceValidator
flags when the QCStatements extension is missing.
For test cases I worked mostly with integration tests by generating certificates so I'd like to leave it at that for this PR. I'll go through your comments and address them ASAP, thanks for the review! |
As previously mentioned in #124, a first PR which extends pkilint with QCP-N-QSCD for 411-1 (with restrictions of 411-2), 412-2 and 412-5.
I did my best in maintaining the existing structure of everything, please let me know where you'd want changes and we'll use this PR to get everything aligned as much as possible.
I've generated certificates as integration tests to validate most (or all) rules that I've added as part of the qcp-n-qscd profile.
Additionally:
finding_metadata.csv
seems to be empty, I tried to document all the sources (and changes) but is it on the roadmap to fill in that csv?And some further questions inlined ⬇️