Revision 2f84d2a1f1653674f6885a42efd2f648f8372491 authored by Marc on 04 January 2020, 15:27:17 UTC, committed by Dmitry Belyavskiy on 19 May 2020, 08:38:00 UTC
Add certificate validity period (v) and public key & signature algorithms (a) to the "Certificate Chain" output.

Eg:
Certificate chain
 0 s:C = US, ST = California, L = Mountain View, O = Google LLC, CN = www.google.com
   i:C = US, O = Google Trust Services, CN = GTS CA 1O1
   a:PKEY: id-ecPublicKey, 256 (bit); sigalg: RSA-SHA256
   v:NotBefore: Dec  3 14:49:26 2019 GMT; NotAfter: Feb 25 14:49:26 2020 GMT
 1 s:C = US, O = Google Trust Services, CN = GTS CA 1O1
   i:OU = GlobalSign Root CA - R2, O = GlobalSign, CN = GlobalSign
   a:PKEY: rsaEncryption, 2048 (bit); sigalg: RSA-SHA256
   v:NotBefore: Jun 15 00:00:42 2017 GMT; NotAfter: Dec 15 00:00:42 2021 GMT

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/10757)
1 parent e9e7b5d
Raw File
helper.py
#!/usr/bin/python
#
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License").  You may not use
# this file except in compliance with the License.  You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html

"""Fuzzing helper, creates and uses corpus/crash directories.

fuzzer.py <fuzzer> <extra fuzzer arguments>
"""

import os
import subprocess
import sys

FUZZER = sys.argv[1]

THIS_DIR = os.path.abspath(os.path.dirname(__file__))
CORPORA_DIR = os.path.abspath(os.path.join(THIS_DIR, "corpora"))

FUZZER_DIR = os.path.abspath(os.path.join(CORPORA_DIR, FUZZER))
if not os.path.isdir(FUZZER_DIR):
    os.mkdir(FUZZER_DIR)

corpora = []

def _create(d):
    dd = os.path.abspath(os.path.join(CORPORA_DIR, d))
    if not os.path.isdir(dd):
        os.mkdir(dd)
    corpora.append(dd)

def _add(d):
    dd = os.path.abspath(os.path.join(CORPORA_DIR, d))
    if os.path.isdir(dd):
        corpora.append(dd)

def main():
    _create(FUZZER)
    _create(FUZZER + "-crash")
    _add(FUZZER + "-seed")

    cmd = ([os.path.abspath(os.path.join(THIS_DIR, FUZZER))]  + sys.argv[2:]
           + ["-artifact_prefix=" + corpora[1] + "/"] + corpora)
    print(" ".join(cmd))
    subprocess.call(cmd)

if __name__ == "__main__":
    main()
back to top