-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a fuzz test to cover the DTLS handshake. Co-Authored-By: Daniele Sluijters <[email protected]>
- Loading branch information
Showing
2 changed files
with
23 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,8 +39,10 @@ Michiel De Backker <[email protected]> | |
Rachel Chen <[email protected]> | ||
Robert Eperjesi <[email protected]> | ||
Ryan Gordon <[email protected]> | ||
Sam Lancia <[email protected]> | ||
Sean DuBois <[email protected]> | ||
Sean DuBois <[email protected]> | ||
Shelikhoo <[email protected]> | ||
Stefan Tatschner <[email protected]> | ||
Steffen Vogel <[email protected]> | ||
Vadim <[email protected]> | ||
|
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,21 @@ | ||
package handshake | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func FuzzDtlsHandshake(f *testing.F) { | ||
f.Fuzz(func(t *testing.T, data []byte) { | ||
h := &Handshake{} | ||
if err := h.Unmarshal(data); err != nil { | ||
return | ||
} | ||
buf, err := h.Marshal() | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
if len(buf) == 0 { | ||
t.Fatal("Zero buff") | ||
} | ||
}) | ||
} |