Skip to content

Commit

Permalink
fix: sector identifier public/private pattern match as lowercased
Browse files Browse the repository at this point in the history
  • Loading branch information
peppelinux committed May 25, 2022
1 parent 30ae494 commit 7294dd4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spid_compliant_certificates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
_min = 5

# micro version
_mic = 0
_mic = 1

# release level (alpha, beta, rc, final)
_rel = 'final'
Expand Down
4 changes: 2 additions & 2 deletions spid_compliant_certificates/validator/checks/subject_dn.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ def subject_dn(subj: x509.Name, sector: str) -> List[Tuple[bool, str, Any]]:
checks.append((res, msg, value))

if attr.oid == OID_ORGANIZATION_IDENTIFIER:
if sector == 'public':
if sector.lower() == 'public':
pattern = r'^PA:IT-\S{1,11}$'
elif sector == 'private':
elif sector.lower() == 'private':
pattern = r'^(CF:IT-[a-zA-Z0-9]{16}|VATIT-\d{11})$'
else:
msg = f'Invalid sector ({sector})'
Expand Down

0 comments on commit 7294dd4

Please sign in to comment.