File tree Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Expand file tree Collapse file tree 2 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 1039
1039
}],
1040
1040
],
1041
1041
}, # fuzz_env
1042
+ { # fuzz_ClientHelloParser.cc
1043
+ 'target_name' : 'fuzz_ClientHelloParser' ,
1044
+ 'type' : 'executable' ,
1045
+ 'dependencies' : [
1046
+ '<(node_lib_target_name)' ,
1047
+ 'deps/histogram/histogram.gyp:histogram' ,
1048
+ 'deps/uvwasi/uvwasi.gyp:uvwasi' ,
1049
+ ],
1050
+ 'includes' : [
1051
+ 'node.gypi'
1052
+ ],
1053
+ 'include_dirs' : [
1054
+ 'src' ,
1055
+ 'tools/msvs/genfiles' ,
1056
+ 'deps/v8/include' ,
1057
+ 'deps/cares/include' ,
1058
+ 'deps/uv/include' ,
1059
+ 'deps/uvwasi/include' ,
1060
+ 'test/cctest' ,
1061
+ ],
1062
+ 'defines' : [
1063
+ 'NODE_ARCH="<(target_arch)"' ,
1064
+ 'NODE_PLATFORM="<(OS)"' ,
1065
+ 'NODE_WANT_INTERNALS=1' ,
1066
+ ],
1067
+ 'sources' : [
1068
+ 'src/node_snapshot_stub.cc' ,
1069
+ 'test/fuzzers/fuzz_ClientHelloParser.cc' ,
1070
+ ],
1071
+ 'conditions' : [
1072
+ ['OS=="linux"' , {
1073
+ 'ldflags' : [ '-fsanitize=fuzzer' ]
1074
+ }],
1075
+ # Ensure that ossfuzz flag has been set and that we are on Linux
1076
+ [ 'OS!="linux" or ossfuzz!="true"' , {
1077
+ 'type' : 'none' ,
1078
+ }],
1079
+ # Avoid excessive LTO
1080
+ ['enable_lto=="true"' , {
1081
+ 'ldflags' : [ '-fno-lto' ],
1082
+ }],
1083
+ ],
1084
+ }, # fuzz_ClientHelloParser.cc
1042
1085
{
1043
1086
'target_name' : 'cctest' ,
1044
1087
'type' : 'executable' ,
Original file line number Diff line number Diff line change
1
+ /*
2
+ * A fuzzer focused on node::crypto::ClientHelloParser.
3
+ */
4
+
5
+ #include < stdlib.h>
6
+ #include " crypto/crypto_clienthello-inl.h"
7
+
8
+ extern " C" int LLVMFuzzerTestOneInput (const uint8_t * data, size_t size) {
9
+ node::crypto::ClientHelloParser parser;
10
+ bool end_cb_called = false ;
11
+ parser.Start ([](void * arg, auto hello) { },
12
+ [](void * arg) { },
13
+ &end_cb_called);
14
+ parser.Parse (data, size);
15
+ return 0 ;
16
+ }
You can’t perform that action at this time.
0 commit comments