-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add fuzzer for
ClientHelloParser
Signed-off-by: Adam Korczynski <[email protected]> PR-URL: #51088 Reviewed-By: James M Snell <[email protected]>
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* A fuzzer focused on node::crypto::ClientHelloParser. | ||
*/ | ||
|
||
#include <stdlib.h> | ||
#include "crypto/crypto_clienthello-inl.h" | ||
|
||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | ||
node::crypto::ClientHelloParser parser; | ||
bool end_cb_called = false; | ||
parser.Start([](void* arg, auto hello) { }, | ||
[](void* arg) { }, | ||
&end_cb_called); | ||
parser.Parse(data, size); | ||
return 0; | ||
} |