fuzz_test.go 422 B

123456789101112131415161718192021222324
  1. // SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
  2. // SPDX-License-Identifier: MIT
  3. package handshake
  4. import (
  5. "testing"
  6. )
  7. func FuzzDtlsHandshake(f *testing.F) {
  8. f.Fuzz(func(t *testing.T, data []byte) {
  9. h := &Handshake{}
  10. if err := h.Unmarshal(data); err != nil {
  11. return
  12. }
  13. buf, err := h.Marshal()
  14. if err != nil {
  15. t.Fatal(err)
  16. }
  17. if len(buf) == 0 {
  18. t.Fatal("Zero buff")
  19. }
  20. })
  21. }