Просмотр исходного кода

Update fuzz tests

tags/v2.1.11^2^2
9seconds 2 месяцев назад
Родитель
Сommit
bb320e9d89
2 измененных файлов: 11 добавлений и 12 удалений
  1. 4
    12
      .mise.toml
  2. 7
    0
      mtglib/internal/obfuscation/handshake_frame_fuzz_test.go

+ 4
- 12
.mise.toml Просмотреть файл

47
 
47
 
48
 [tasks."test:fuzz:client-handshake"]
48
 [tasks."test:fuzz:client-handshake"]
49
 description = "Run fuzzy test for ClientHandshake"
49
 description = "Run fuzzy test for ClientHandshake"
50
-run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzClientHandshake ./mtglib/internal/obfuscated2"
50
+run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzClientServerHandshake ./mtglib/internal/obfuscation"
51
 
51
 
52
-[tasks."test:fuzz:server-generate-handshake-frame"]
53
-description = "Run fuzzy test for ServerGenerateHandshakeFrame"
54
-run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerGenerateHandshakeFrame ./mtglib/internal/obfuscated2"
55
-
56
-[tasks."test:fuzz:server-receive"]
57
-description = "Run fuzzy test for ServerReceive"
58
-run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerReceive ./mtglib/internal/obfuscated2"
59
-
60
-[tasks."test:fuzz:server-send"]
61
-description = "Run fuzzy test for ServerSend"
62
-run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzServerSend ./mtglib/internal/obfuscated2"
52
+[tasks."test:fuzz:server-handshake-frame"]
53
+description = "Run fuzzy test for GenerateHandshakeFrame"
54
+run = "go test -v {{ vars.fuzzflags }} -fuzz=FuzzGenerateHandshakeFrame ./mtglib/internal/obfuscation"
63
 
55
 
64
 [tasks.static]
56
 [tasks.static]
65
 description = "Build static binary"
57
 description = "Build static binary"

+ 7
- 0
mtglib/internal/obfuscation/handshake_frame_fuzz_test.go Просмотреть файл

28
 			frame.data[4]|frame.data[5]|frame.data[6]|frame.data[7])
28
 			frame.data[4]|frame.data[5]|frame.data[6]|frame.data[7])
29
 
29
 
30
 		assert.Equal(t, hfConnectionType[:], frame.connectionType())
30
 		assert.Equal(t, hfConnectionType[:], frame.connectionType())
31
+
32
+		if arg < 0 {
33
+			arg = -arg
34
+		} else if arg == 0 {
35
+			arg = defaultDC
36
+		}
37
+
31
 		assert.EqualValues(t, arg, frame.dc())
38
 		assert.EqualValues(t, arg, frame.dc())
32
 	})
39
 	})
33
 }
40
 }

Загрузка…
Отмена
Сохранить