mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-04 04:27:36 +03:00
The root cause of races is that global variables supportedSignatureAlgorithms and cipherSuites are used both to form handshake and to check whether or not peer responded with supported algorithm. In this patch I create separate variables for this purpose. Updated tests for kicks. Finally, go fmt.
99 lines
7.4 KiB
Text
99 lines
7.4 KiB
Text
>>> Flow 1 (client to server)
|
|
00000000 16 03 01 00 ac 01 00 00 a8 03 03 00 00 00 00 00 |................|
|
|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
|
|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2b |...............+|
|
|
00000030 c0 2f cc a9 cc a8 c0 2c c0 30 c0 0a c0 09 c0 13 |./.....,.0......|
|
|
00000040 c0 14 00 33 00 39 00 2f 00 35 00 0a 01 00 00 61 |...3.9./.5.....a|
|
|
00000050 00 00 00 05 00 03 00 00 00 00 17 00 00 ff 01 00 |................|
|
|
00000060 01 00 00 0a 00 0a 00 08 00 1d 00 17 00 18 00 19 |................|
|
|
00000070 00 0b 00 02 01 00 00 23 00 00 00 10 00 0e 00 0c |.......#........|
|
|
00000080 02 68 32 08 68 74 74 70 2f 31 2e 31 00 05 00 05 |.h2.http/1.1....|
|
|
00000090 01 00 00 00 00 00 0d 00 18 00 16 04 03 05 03 06 |................|
|
|
000000a0 03 08 04 08 05 08 06 04 01 05 01 06 01 02 03 02 |................|
|
|
000000b0 01 |.|
|
|
>>> Flow 2 (server to client)
|
|
00000000 16 03 03 00 41 02 00 00 3d 03 03 fa 78 e6 c1 ef |....A...=...x...|
|
|
00000010 af bc 7f 18 4d c6 23 31 d8 0f 46 4d 2a a3 ac ef |....M.#1..FM*...|
|
|
00000020 4a e0 29 f2 6a 79 ca 16 4d 20 92 00 c0 0a 00 00 |J.).jy..M ......|
|
|
00000030 15 ff 01 00 01 00 00 0b 00 04 03 00 01 02 00 23 |...............#|
|
|
00000040 00 00 00 17 00 00 16 03 03 02 0e 0b 00 02 0a 00 |................|
|
|
00000050 02 07 00 02 04 30 82 02 00 30 82 01 62 02 09 00 |.....0...0..b...|
|
|
00000060 b8 bf 2d 47 a0 d2 eb f4 30 09 06 07 2a 86 48 ce |..-G....0...*.H.|
|
|
00000070 3d 04 01 30 45 31 0b 30 09 06 03 55 04 06 13 02 |=..0E1.0...U....|
|
|
00000080 41 55 31 13 30 11 06 03 55 04 08 13 0a 53 6f 6d |AU1.0...U....Som|
|
|
00000090 65 2d 53 74 61 74 65 31 21 30 1f 06 03 55 04 0a |e-State1!0...U..|
|
|
000000a0 13 18 49 6e 74 65 72 6e 65 74 20 57 69 64 67 69 |..Internet Widgi|
|
|
000000b0 74 73 20 50 74 79 20 4c 74 64 30 1e 17 0d 31 32 |ts Pty Ltd0...12|
|
|
000000c0 31 31 32 32 31 35 30 36 33 32 5a 17 0d 32 32 31 |1122150632Z..221|
|
|
000000d0 31 32 30 31 35 30 36 33 32 5a 30 45 31 0b 30 09 |120150632Z0E1.0.|
|
|
000000e0 06 03 55 04 06 13 02 41 55 31 13 30 11 06 03 55 |..U....AU1.0...U|
|
|
000000f0 04 08 13 0a 53 6f 6d 65 2d 53 74 61 74 65 31 21 |....Some-State1!|
|
|
00000100 30 1f 06 03 55 04 0a 13 18 49 6e 74 65 72 6e 65 |0...U....Interne|
|
|
00000110 74 20 57 69 64 67 69 74 73 20 50 74 79 20 4c 74 |t Widgits Pty Lt|
|
|
00000120 64 30 81 9b 30 10 06 07 2a 86 48 ce 3d 02 01 06 |d0..0...*.H.=...|
|
|
00000130 05 2b 81 04 00 23 03 81 86 00 04 00 c4 a1 ed be |.+...#..........|
|
|
00000140 98 f9 0b 48 73 36 7e c3 16 56 11 22 f2 3d 53 c3 |...Hs6~..V.".=S.|
|
|
00000150 3b 4d 21 3d cd 6b 75 e6 f6 b0 dc 9a df 26 c1 bc |;M!=.ku......&..|
|
|
00000160 b2 87 f0 72 32 7c b3 64 2f 1c 90 bc ea 68 23 10 |...r2|.d/....h#.|
|
|
00000170 7e fe e3 25 c0 48 3a 69 e0 28 6d d3 37 00 ef 04 |~..%.H:i.(m.7...|
|
|
00000180 62 dd 0d a0 9c 70 62 83 d8 81 d3 64 31 aa 9e 97 |b....pb....d1...|
|
|
00000190 31 bd 96 b0 68 c0 9b 23 de 76 64 3f 1a 5c 7f e9 |1...h..#.vd?.\..|
|
|
000001a0 12 0e 58 58 b6 5f 70 dd 9b d8 ea d5 d7 f5 d5 cc |..XX._p.........|
|
|
000001b0 b9 b6 9f 30 66 5b 66 9a 20 e2 27 e5 bf fe 3b 30 |...0f[f. .'...;0|
|
|
000001c0 09 06 07 2a 86 48 ce 3d 04 01 03 81 8c 00 30 81 |...*.H.=......0.|
|
|
000001d0 88 02 42 01 88 a2 4f eb e2 45 c5 48 7d 1b ac f5 |..B...O..E.H}...|
|
|
000001e0 ed 98 9d ae 47 70 c0 5e 1b b6 2f bd f1 b6 4d b7 |....Gp.^../...M.|
|
|
000001f0 61 40 d3 11 a2 ce ee 0b 7e 92 7e ff 76 9d c3 3b |a@......~.~.v..;|
|
|
00000200 7e a5 3f ce fa 10 e2 59 ec 47 2d 7c ac da 4e 97 |~.?....Y.G-|..N.|
|
|
00000210 0e 15 a0 6f d0 02 42 01 4d fc be 67 13 9c 2d 05 |...o..B.M..g..-.|
|
|
00000220 0e bd 3f a3 8c 25 c1 33 13 83 0d 94 06 bb d4 37 |..?..%.3.......7|
|
|
00000230 7a f6 ec 7a c9 86 2e dd d7 11 69 7f 85 7c 56 de |z..z......i..|V.|
|
|
00000240 fb 31 78 2b e4 c7 78 0d ae cb be 9e 4e 36 24 31 |.1x+..x.....N6$1|
|
|
00000250 7b 6a 0f 39 95 12 07 8f 2a 16 03 03 00 b7 0c 00 |{j.9....*.......|
|
|
00000260 00 b3 03 00 1d 20 a1 d4 ca 0d 05 9c 95 01 5d 1e |..... ........].|
|
|
00000270 2e e2 d6 c6 8f 21 9e 96 8d c2 59 68 c3 33 18 4b |.....!....Yh.3.K|
|
|
00000280 18 4c a0 e4 9a 36 04 03 00 8b 30 81 88 02 42 01 |.L...6....0...B.|
|
|
00000290 39 53 f8 6f 38 8f e8 18 f7 9a 89 47 d6 85 e1 14 |9S.o8......G....|
|
|
000002a0 d5 f5 28 d4 8a ca 9f cb 1c 9e 5c 93 eb d7 8c 37 |..(.......\....7|
|
|
000002b0 f0 44 7a 73 49 7f 1d a3 24 d1 af 00 c8 66 81 7b |.DzsI...$....f.{|
|
|
000002c0 1f 0d d4 f5 a9 7b d6 f0 83 ed ef f9 f2 ef e0 b3 |.....{..........|
|
|
000002d0 6c 02 42 01 00 6c 5b 23 c1 ea 74 55 5c 4b 0e 6a |l.B..l[#..tU\K.j|
|
|
000002e0 0e f3 96 ed 79 e3 df 31 27 96 d3 6e aa 3a 1d 30 |....y..1'..n.:.0|
|
|
000002f0 9d 66 40 2d 2b c1 fa 2f 91 af 6f 5f 34 14 d8 aa |.f@-+../..o_4...|
|
|
00000300 fe 28 59 6a e7 3e 51 fc d4 9b c8 0f 2d 84 03 03 |.(Yj.>Q.....-...|
|
|
00000310 77 e4 7f 24 23 16 03 03 00 04 0e 00 00 00 |w..$#.........|
|
|
>>> Flow 3 (client to server)
|
|
00000000 16 03 03 00 25 10 00 00 21 20 2f e5 7d a3 47 cd |....%...! /.}.G.|
|
|
00000010 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 af c4 |bC.(.._.).0.....|
|
|
00000020 cf c2 ed 90 99 5f 58 cb 3b 74 14 03 03 00 01 01 |....._X.;t......|
|
|
00000030 16 03 03 00 40 00 00 00 00 00 00 00 00 00 00 00 |....@...........|
|
|
00000040 00 00 00 00 00 5c 08 36 89 23 65 47 a2 76 e3 2d |.....\.6.#eG.v.-|
|
|
00000050 72 cb 77 17 35 90 73 f1 fb d4 08 5d 81 85 26 6b |r.w.5.s....]..&k|
|
|
00000060 6d 06 83 d9 a5 0b 39 7a bc 28 8e a8 54 c1 5b 89 |m.....9z.(..T.[.|
|
|
00000070 d2 19 78 b0 c3 |..x..|
|
|
>>> Flow 4 (server to client)
|
|
00000000 16 03 03 00 ba 04 00 00 b6 00 00 1c 20 00 b0 bd |............ ...|
|
|
00000010 43 b8 0c 54 97 eb 40 e1 4b 89 ab 74 83 4b b2 42 |C..T..@.K..t.K.B|
|
|
00000020 48 7c 09 8a 37 23 37 8a aa fe 45 eb 45 b8 04 1e |H|..7#7...E.E...|
|
|
00000030 92 fd 15 74 82 25 ce 36 e8 5c e1 a3 a7 da 47 f8 |...t.%.6.\....G.|
|
|
00000040 df a1 2c f2 c4 95 22 f5 0b 81 28 28 61 ce be ea |..,..."...((a...|
|
|
00000050 1c 7c 32 91 1b 26 e1 9d d1 7a f6 35 9d 00 02 2a |.|2..&...z.5...*|
|
|
00000060 61 59 c9 6d 71 82 3a a7 b1 4d 33 16 cb 61 fc 1b |aY.mq.:..M3..a..|
|
|
00000070 08 db 90 70 c5 75 bf 38 50 42 89 39 07 79 71 aa |...p.u.8PB.9.yq.|
|
|
00000080 49 74 f2 7b 6b b3 fb 81 7d 4b b8 36 fc 14 58 b4 |It.{k...}K.6..X.|
|
|
00000090 62 ed 85 3a f9 15 f5 c3 05 f4 03 11 66 b0 6a fa |b..:........f.j.|
|
|
000000a0 8e ba 71 c0 eb 25 79 de 99 70 a6 d9 ea f5 5e 0f |..q..%y..p....^.|
|
|
000000b0 31 0a 2b 03 a6 9e b7 8a 83 b0 a1 9e ec 6e d6 14 |1.+..........n..|
|
|
000000c0 03 03 00 01 01 16 03 03 00 40 7b 7d 90 a1 42 ec |.........@{}..B.|
|
|
000000d0 88 d8 df b5 95 25 df aa 48 39 67 b6 c1 6e b5 f8 |.....%..H9g..n..|
|
|
000000e0 28 d2 31 27 bf 45 07 7c de f2 fd 01 6b ed 73 25 |(.1'.E.|....k.s%|
|
|
000000f0 d3 ea 78 d7 b6 5b 83 62 eb 1b 7f ee 27 0f 36 5b |..x..[.b....'.6[|
|
|
00000100 54 60 45 27 3c 05 ee b5 ed 04 |T`E'<.....|
|
|
>>> Flow 5 (client to server)
|
|
00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
|
|
00000010 00 00 00 00 00 0d 9d 27 22 a5 ba 16 c7 8f 70 7c |.......'".....p||
|
|
00000020 6c c5 d5 4f 25 ed e9 b7 ed 64 69 d6 06 23 63 5a |l..O%....di..#cZ|
|
|
00000030 12 30 39 a3 f3 15 03 03 00 30 00 00 00 00 00 00 |.09......0......|
|
|
00000040 00 00 00 00 00 00 00 00 00 00 62 7f 4f 1e 5d 37 |..........b.O.]7|
|
|
00000050 fe 13 6f cb bd a9 b2 ec a2 64 28 bd 67 e7 1b 95 |..o......d(.g...|
|
|
00000060 6b 8a 47 40 6e 1b fd dd 31 28 |k.G@n...1(|
|