Skip to content
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

refactor: remove unnecessary whitespace #26

Merged
merged 1 commit into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions certCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ def processQueryFile():
for _ in range(int(args.retryAmount)):
# Connect to the hostname from the queryFile argument and get the certificate associated with it.
myCertificate = o_myCertificate.getCertificate(myHostname)

if myCertificate["certificateMetaData"] is None:
# If unable to connect to host for whatever reason, pause for a second then try again.
time.sleep(int(args.timeBetweenRetries))
Expand Down Expand Up @@ -367,7 +367,7 @@ def processHostname():

# Create a DisplayCertifcate Object
print_cert_object = DisplayCertificate.DisplayCertificate()

if args.displayCertificateJSON:
# Display the certificate JSON structure
print_cert_object.printCertInfoJSON(jsonCertificateInfo)
Expand Down
2 changes: 1 addition & 1 deletion certificate/CertificateStatistics.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class CertificateStatistics:
"""This class is responsible for helping with calculations of meta data."""
CLASS_VERSION = "0.01"

certificate_time_format = CertificateTimeFormat.CertificateTimeFormat().cert_time_format

@staticmethod
Expand Down
2 changes: 1 addition & 1 deletion certificate/DisplayCertificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
class DisplayCertificate:
"""This class is responsible for displaying the certificate Meta Data."""
CLASS_VERSION = "0.01"

# Define a certificate_stats object for use when calculating statistics about the certificate.
certificate_stats = CertificateStatistics.CertificateStatistics()

Expand Down
10 changes: 5 additions & 5 deletions certificate/certificateModule.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def getCertificate(self, __hostinfo: dict) -> dict:
else:
# Create the default context.
__ctx = ssl.create_default_context()

"""
Check to see if save_certificate is true.
If it is, save the certificate to the file.
Expand All @@ -90,7 +90,7 @@ def getCertificate(self, __hostinfo: dict) -> dict:
if self.contextVariables.get("security_level") == 1:
# Lower the default security level
__ctx.set_ciphers('DEFAULT@SECLEVEL=1')

# Check to see if local_untrusted_certificates should be allowed
if self.contextVariables.get("local_untrusted_allow") == 1:
__ctx.check_hostname = False
Expand Down Expand Up @@ -137,10 +137,10 @@ def getCertificate(self, __hostinfo: dict) -> dict:
file_writer = FileOperations.FileOperations(output_file)
file_writer.write_binary(__binary_certificate)
print("...Done")

_certdecoder = CertificateDecoder.CertificateDecoder()
__certificate = _certdecoder.decode(__binary_certificate)

__cipher = s.cipher()
__hostnameData["certificateMetaData"] = __certificate
__hostnameData["connectionCipher"] = __cipher
Expand Down Expand Up @@ -399,7 +399,7 @@ def __init__(self, **kwargs):
self.initialized = True
self.moduleVersion = "0.26"
self.certificate = {}

self.save_certificate = kwargs['save_certificate']
self.output_directory = kwargs['output_directory']

Expand Down
2 changes: 1 addition & 1 deletion data/calculateStats.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def calculateStatistics(self, __certResults: dict) -> dict:
# Calculate highest certificate template time.
if highestCertificateTemplateTime < item.get("certificateTemplateTime"):
highestCertificateTemplateTime = item.get("certificateTemplateTime")

caIssuerCommonName = item.get("certificateInfo").get("certificateIssuer").get("commonName")

# Calculate common Certificate Authority Issuers
Expand Down