Skip to content

Commit 410f70b

Browse files
committed
ASN1_parse fuzzing
1 parent 01dc627 commit 410f70b

File tree

696 files changed

+403
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

696 files changed

+403
-0
lines changed

fuzz/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ macro(fuzzer name)
1515
add_dependencies(all_fuzz_tests ${name})
1616
endmacro()
1717

18+
fuzzer(asn1parse)
1819
fuzzer(arm_cpuinfo)
1920
fuzzer(bn_div)
2021
fuzzer(bn_mod_exp)

fuzz/asn1parse.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
// SPDX-License-Identifier: Apache-2.0 OR ISC
3+
4+
#include <openssl/asn1.h>
5+
#include <openssl/err.h>
6+
#include <openssl/evp.h>
7+
#include <openssl/mem.h>
8+
9+
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
10+
bssl::UniquePtr<BIO> bio(BIO_new(BIO_s_mem()));
11+
if(len > LONG_MAX) {
12+
return 0;
13+
}
14+
ASN1_parse(bio.get(), buf, len, 0);
15+
return 0;
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
�
2 Bytes
Binary file not shown.
6 Bytes
Binary file not shown.
74 Bytes
Binary file not shown.
3 Bytes
Binary file not shown.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+

2+
3+
82 Bytes
Binary file not shown.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
��

0 commit comments

Comments
 (0)