From 2316928cec3e116f3f5c81b46a2d29aff2cfeecd Mon Sep 17 00:00:00 2001 From: Stanislav BoboĊˆ Date: Thu, 11 Feb 2021 09:53:07 +0100 Subject: added change and revision history --- sec_certs/certificate.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sec_certs/certificate.py b/sec_certs/certificate.py index f12270a6..cde4a449 100644 --- a/sec_certs/certificate.py +++ b/sec_certs/certificate.py @@ -542,7 +542,7 @@ class FIPSCertificate(Certificate, ComplexSerializableType): text_to_parse = text_with_newlines if constants.FIPS_USE_NEWLINES else text - items_found, fips_text = FIPSCertificate.parse_cert_file(FIPSCertificate.find_platforms(text_to_parse), + items_found, fips_text = FIPSCertificate.parse_cert_file(FIPSCertificate.remove_platforms(text_to_parse), cert.web_scan.algorithms) save_modified_cert_file(cert.state.fragment_path.with_suffix('.fips.txt'), fips_text, unicode_error) @@ -556,8 +556,8 @@ class FIPSCertificate(Certificate, ComplexSerializableType): return items_found, cert @staticmethod - def find_platforms(text_to_parse: str): - pat = re.compile(r"[Mm]odification [Hh]istory(?! \.*)+[\s\S]*? ") + def remove_platforms(text_to_parse: str): + pat = re.compile(r"(?:modification|revision|change) history\n[\s\S]*? ", re.IGNORECASE) for match in pat.finditer(text_to_parse): text_to_parse = text_to_parse.replace( match.group(), 'x' * len(match.group())) -- cgit v1.3.1