From 7da1c979b88123347fcaaad123fadce162a856ea Mon Sep 17 00:00:00 2001 From: Bart S Date: Fri, 24 Jan 2020 11:58:52 +0100 Subject: [PATCH] Escape fields (Part of a fix for issue #12) Encapsulate the fields in " characters, on the domain field escape any " characters that might appear. --- axeman/core.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/axeman/core.py b/axeman/core.py index d67a4c2..727ae74 100644 --- a/axeman/core.py +++ b/axeman/core.py @@ -211,13 +211,13 @@ def process_worker(result_info): # header = "url, cert_index, chain_hash, cert_der, all_domains, not_before, not_after" lines.append( ",".join([ - result_info['log_info']['url'], - str(entry['cert_index']), - chain_hash, - cert_data['leaf_cert']['as_der'], - ' '.join(cert_data['leaf_cert']['all_domains']), - str(cert_data['leaf_cert']['not_before']), - str(cert_data['leaf_cert']['not_after']) + "\"" + result_info['log_info']['url'] + "\"", + "\"" + str(entry['cert_index']) + "\"", + "\"" + chain_hash + "\"", + "\"" + cert_data['leaf_cert']['as_der'] + "\"", + "\"" + ' '.join(cert_data['leaf_cert']['all_domains']).replace("\"", "\"\"") + "\"", + "\"" + str(cert_data['leaf_cert']['not_before']) + "\"", + "\"" + str(cert_data['leaf_cert']['not_after']) + "\"" ]) + "\n" )