Skip to content
This repository has been archived by the owner on Dec 6, 2023. It is now read-only.

Commit

Permalink
Renamed cert_ to crt_
Browse files Browse the repository at this point in the history
  • Loading branch information
yzninja committed Jan 23, 2016
1 parent 7c947e3 commit 3442c16
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions nogotofail/mitm/connection/handlers/data/ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,18 @@ def on_tls_response(self, record):
if (isinstance(message, tls.types.HandshakeMessage) and
message.type == HandshakeMessage.TYPE.CERTIFICATE):
certificate = message.obj
cert_chain_length = len(certificate.certificates)
cert_chain_index = 0
crt_chain_length = len(certificate.certificates)
crt_chain_index = 0
# Loop through certificate chain starting from the leaf
# cert to the last intermediate cert (before the root).
for cert_byte_string in certificate.certificates[
:cert_chain_length-1]:
if (cert_chain_index == 0):
for crt_byte_string in certificate.certificates[
:crt_chain_length-1]:
if (crt_chain_index == 0):
crt_type = self.LEAF_CERT
else:
crt_type = self.INTERMEDIATE_CERT
a_cert = OpenSSL.crypto.load_certificate(
OpenSSL.crypto.FILETYPE_ASN1, cert_byte_string)
OpenSSL.crypto.FILETYPE_ASN1, crt_byte_string)
# Check certificates in chain for SHA-1 sunset issue
crt_signature_algorithm = \
a_cert.get_signature_algorithm()
Expand All @@ -229,7 +229,7 @@ def on_tls_response(self, record):
CRT_DATE_FORMAT)
self._alert_on_sunset_sha1(crt_not_after, crt_CN,
crt_type)
cert_chain_index += 1
crt_chain_index += 1
except AttributeError:
pass
return record.to_bytes()
Expand Down

0 comments on commit 3442c16

Please sign in to comment.