Skip to content

Commit

Permalink
_utils: Fix OtherName check
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Cameron <asc@tetsuo.sh>
  • Loading branch information
tetsuo-cpp committed Nov 4, 2022
1 parent 5247098 commit 36fc166
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sigstore/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from cryptography.hazmat.primitives.asymmetric import ec, rsa
from cryptography.x509 import (
Certificate,
ObjectIdentifier,
OtherName,
RFC822Name,
SubjectAlternativeName,
Expand Down Expand Up @@ -77,5 +78,8 @@ def cert_contains_identity(cert: Certificate, expected_cert_identity: str) -> bo
expected_cert_identity in san_ext.value.get_values_for_type(RFC822Name)
or expected_cert_identity
in san_ext.value.get_values_for_type(UniformResourceIdentifier)
or expected_cert_identity in san_ext.value.get_values_for_type(OtherName)
or OtherName(
ObjectIdentifier("1.3.6.1.4.1.57264.1.7"), expected_cert_identity.encode()
)
in san_ext.value.get_values_for_type(OtherName)
)

0 comments on commit 36fc166

Please sign in to comment.