Skip to content

Commit

Permalink
Fix OCSP_RevokedInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
gpotter2 committed Feb 13, 2024
1 parent d612454 commit 0708e67
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scapy/layers/x509.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ class OCSP_RevokedInfo(ASN1_Packet):
ASN1F_optional(
ASN1F_PACKET("revocationReason", None,
X509_ExtReasonCode,
explicit_tag=0x80)))
explicit_tag=0xa0)))


class OCSP_UnknownInfo(ASN1_Packet):
Expand Down
7 changes: 7 additions & 0 deletions test/scapy/layers/x509.uts
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ assert responseData.producedAt == ASN1_GENERALIZED_TIME("20160914121000Z")
assert len(responseData.responses) == 1
responseData.responseExtensions is None

= OCSP class : OCSP ResponseData dissection with RecokedInfo
from scapy.layers.x509 import OCSP_ResponseData
pkt = OCSP_ResponseData(b"0\x81\xdf\xa2\x16\x04\x14\x11\x7f\x8eD\xbb\xe9\x7f\xca'\xfeG\x90\x89\\\x18\xea\x0e\xa5#W\x18\x0f20240121133708Z0\x81\x8e0\x81\x8b0M0\t\x06\x05+\x0e\x03\x02\x1a\x05\x00\x04\x14\x0b\xaf\xcc#$\xb8\xb0\xf8\xb02,\x9aPn9VSW\x14\x14\x04\x14\x11\x7f\x8eD\xbb\xe9\x7f\xca'\xfeG\x90\x89\\\x18\xea\x0e\xa5#W\x02\x14\x10&\x99j\t\xaa\xb9>\xde\x06\xb6#b\xa9\xe4GA\x07\x1b2\xa1\x16\x18\x0f20240120133708Z\xa0\x03\n\x01\x01\x18\x0f20240121133708Z\xa0\x11\x18\x0f20240122133708Z\xa1#0!0\x1f\x06\t+\x06\x01\x05\x05\x070\x01\x02\x04\x12\x04\x10\xfc\xb6\x92\xdf^\xf3\x03{\tH}\x12\x9f\xaa\x13^")
assert pkt.responderID.responderID.byKey == b"\x11\x7f\x8eD\xbb\xe9\x7f\xca'\xfeG\x90\x89\\\x18\xea\x0e\xa5#W"
assert pkt.responses[0].certID.issuerNameHash == b'\x0b\xaf\xcc#$\xb8\xb0\xf8\xb02,\x9aPn9VSW\x14\x14'
assert pkt.responses[0].certStatus.certStatus.revocationReason.cRLReason == 0x1

= OCSP class : OCSP SingleResponse checks
from scapy.layers.x509 import OCSP_GoodInfo
singleResponse = responseData.responses[0]
Expand Down

0 comments on commit 0708e67

Please sign in to comment.