// SPDX-FileCopyrightText: 2026 The Pion community <https://pion.ly>
// SPDX-License-Identifier: MIT

package extension

import "testing"

func FuzzUnmarshal(f *testing.F) {
	// Minimal malformed input
	f.Add([]byte{0x00})
	// Random garbage bytes
	f.Add([]byte{1, 6, 8, 3, 88, 12, 2, 47})
	// Type 10: supported_elliptic_curves
	f.Add([]byte{0x0, 0xa, 0x0, 0x4, 0x0, 0x2, 0x0, 0x1d})
	// Type 11: supported_point_formats
	f.Add([]byte{0x00, 0x0b, 0x00, 0x02, 0x01, 0x00})
	// Type 13: signature_algorithms
	f.Add([]byte{0x00, 0x0d, 0x00, 0x08, 0x00, 0x06, 0x04, 0x03, 0x05, 0x03, 0x06, 0x03})
	// Type 14: use_srtp
	f.Add([]byte{0x00, 0x0e, 0x00, 0x05, 0x00, 0x02, 0x00, 0x01, 0x00})
	// Type 50: signature_algorithms_cert
	f.Add([]byte{0x00, 0x32, 0x00, 0x08, 0x00, 0x06, 0x04, 0x03, 0x05, 0x03, 0x06, 0x03})

	f.Fuzz(func(_ *testing.T, data []byte) {
		_, _ = Unmarshal(data)
	})
}
