Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

handshake_frame_fuzz_test.go 904B

123456789101112131415161718192021222324252627282930313233
  1. package obfuscation
  2. import (
  3. "encoding/binary"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func FuzzGenerateHandshakeFrame(f *testing.F) {
  8. f.Fuzz(func(t *testing.T, arg int16) {
  9. frame := generateHandshake(int(arg))
  10. assert.NotEqualValues(t, 0xef, frame.data[0])
  11. firstBytes := binary.LittleEndian.Uint32(frame.data[:4])
  12. assert.NotEqualValues(t, 0x44414548, firstBytes)
  13. assert.NotEqualValues(t, 0x54534f50, firstBytes)
  14. assert.NotEqualValues(t, 0x20544547, firstBytes)
  15. assert.NotEqualValues(t, 0x4954504f, firstBytes)
  16. assert.NotEqualValues(t, 0x02010316, firstBytes)
  17. assert.NotEqualValues(t, 0xeeeeeeee, firstBytes)
  18. assert.NotEqualValues(t, 0xdddddddd, firstBytes)
  19. assert.NotEqualValues(
  20. t,
  21. 0,
  22. frame.data[4]|frame.data[5]|frame.data[6]|frame.data[7])
  23. assert.Equal(t, hfConnectionType[:], frame.connectionType())
  24. assert.EqualValues(t, arg, frame.dc())
  25. })
  26. }