]>
git.ipfire.org Git - thirdparty/openssl.git/blob - fuzz/helper.py
3 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
5 # Licensed under the OpenSSL license (the "License"). You may not use
6 # this file except in compliance with the License. You can obtain a copy
7 # in the file LICENSE in the source distribution or at
8 # https://www.openssl.org/source/license.html
10 """Fuzzing helper, creates and uses corpus/crash directories.
12 fuzzer.py <fuzzer> <extra fuzzer arguments>
21 THIS_DIR
= os
.path
.abspath(os
.path
.dirname(__file__
))
22 CORPORA_DIR
= os
.path
.abspath(os
.path
.join(THIS_DIR
, "corpora"))
24 FUZZER_DIR
= os
.path
.abspath(os
.path
.join(CORPORA_DIR
, FUZZER
))
25 if not os
.path
.isdir(FUZZER_DIR
):
31 dd
= os
.path
.abspath(os
.path
.join(CORPORA_DIR
, d
))
32 if not os
.path
.isdir(dd
):
37 dd
= os
.path
.abspath(os
.path
.join(CORPORA_DIR
, d
))
43 _create(FUZZER
+ "-crash")
44 _add(FUZZER
+ "-seed")
46 cmd
= ([os
.path
.abspath(os
.path
.join(THIS_DIR
, FUZZER
))] + sys
.argv
[2:]
47 + ["-artifact_prefix=" + corpora
[1] + "/"] + corpora
)
51 if __name__
== "__main__":