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
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

server_handshake_fuzz_internal_test.go 771B

123456789101112131415161718192021222324252627282930
  1. package obfuscated2
  2. import (
  3. "encoding/binary"
  4. "testing"
  5. "github.com/stretchr/testify/assert"
  6. )
  7. func FuzzServerGenerateHandshakeFrame(f *testing.F) {
  8. f.Fuzz(func(t *testing.T, arg int) {
  9. frame := generateServerHanshakeFrame()
  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, 0xeeeeeeee, firstBytes)
  17. assert.NotEqualValues(
  18. t,
  19. 0,
  20. frame.data[4]|frame.data[5]|frame.data[6]|frame.data[7])
  21. assert.Equal(t, handshakeConnectionType, frame.connectionType())
  22. })
  23. }