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.
98 lines
7.3 KiB
Text
98 lines
7.3 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 04 9e 27 b8 fe |....A...=....'..|
|
|
00000010 7d c0 7c 49 0e c0 8f 1a 92 12 bc a4 17 aa 4c 2c |}.|I..........L,|
|
|
00000020 32 72 51 da 7c a1 b6 60 9e 68 75 00 c0 2f 00 00 |2rQ.|..`.hu../..|
|
|
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 59 0b 00 02 55 00 |..........Y...U.|
|
|
00000050 02 52 00 02 4f 30 82 02 4b 30 82 01 b4 a0 03 02 |.R..O0..K0......|
|
|
00000060 01 02 02 09 00 e8 f0 9d 3f e2 5b ea a6 30 0d 06 |........?.[..0..|
|
|
00000070 09 2a 86 48 86 f7 0d 01 01 0b 05 00 30 1f 31 0b |.*.H........0.1.|
|
|
00000080 30 09 06 03 55 04 0a 13 02 47 6f 31 10 30 0e 06 |0...U....Go1.0..|
|
|
00000090 03 55 04 03 13 07 47 6f 20 52 6f 6f 74 30 1e 17 |.U....Go Root0..|
|
|
000000a0 0d 31 36 30 31 30 31 30 30 30 30 30 30 5a 17 0d |.160101000000Z..|
|
|
000000b0 32 35 30 31 30 31 30 30 30 30 30 30 5a 30 1a 31 |250101000000Z0.1|
|
|
000000c0 0b 30 09 06 03 55 04 0a 13 02 47 6f 31 0b 30 09 |.0...U....Go1.0.|
|
|
000000d0 06 03 55 04 03 13 02 47 6f 30 81 9f 30 0d 06 09 |..U....Go0..0...|
|
|
000000e0 2a 86 48 86 f7 0d 01 01 01 05 00 03 81 8d 00 30 |*.H............0|
|
|
000000f0 81 89 02 81 81 00 db 46 7d 93 2e 12 27 06 48 bc |.......F}...'.H.|
|
|
00000100 06 28 21 ab 7e c4 b6 a2 5d fe 1e 52 45 88 7a 36 |.(!.~...]..RE.z6|
|
|
00000110 47 a5 08 0d 92 42 5b c2 81 c0 be 97 79 98 40 fb |G....B[.....y.@.|
|
|
00000120 4f 6d 14 fd 2b 13 8b c2 a5 2e 67 d8 d4 09 9e d6 |Om..+.....g.....|
|
|
00000130 22 38 b7 4a 0b 74 73 2b c2 34 f1 d1 93 e5 96 d9 |"8.J.ts+.4......|
|
|
00000140 74 7b f3 58 9f 6c 61 3c c0 b0 41 d4 d9 2b 2b 24 |t{.X.la<..A..++$|
|
|
00000150 23 77 5b 1c 3b bd 75 5d ce 20 54 cf a1 63 87 1d |#w[.;.u]. T..c..|
|
|
00000160 1e 24 c4 f3 1d 1a 50 8b aa b6 14 43 ed 97 a7 75 |.$....P....C...u|
|
|
00000170 62 f4 14 c8 52 d7 02 03 01 00 01 a3 81 93 30 81 |b...R.........0.|
|
|
00000180 90 30 0e 06 03 55 1d 0f 01 01 ff 04 04 03 02 05 |.0...U..........|
|
|
00000190 a0 30 1d 06 03 55 1d 25 04 16 30 14 06 08 2b 06 |.0...U.%..0...+.|
|
|
000001a0 01 05 05 07 03 01 06 08 2b 06 01 05 05 07 03 02 |........+.......|
|
|
000001b0 30 0c 06 03 55 1d 13 01 01 ff 04 02 30 00 30 19 |0...U.......0.0.|
|
|
000001c0 06 03 55 1d 0e 04 12 04 10 9f 91 16 1f 43 43 3e |..U..........CC>|
|
|
000001d0 49 a6 de 6d b6 80 d7 9f 60 30 1b 06 03 55 1d 23 |I..m....`0...U.#|
|
|
000001e0 04 14 30 12 80 10 48 13 49 4d 13 7e 16 31 bb a3 |..0...H.IM.~.1..|
|
|
000001f0 01 d5 ac ab 6e 7b 30 19 06 03 55 1d 11 04 12 30 |....n{0...U....0|
|
|
00000200 10 82 0e 65 78 61 6d 70 6c 65 2e 67 6f 6c 61 6e |...example.golan|
|
|
00000210 67 30 0d 06 09 2a 86 48 86 f7 0d 01 01 0b 05 00 |g0...*.H........|
|
|
00000220 03 81 81 00 9d 30 cc 40 2b 5b 50 a0 61 cb ba e5 |.....0.@+[P.a...|
|
|
00000230 53 58 e1 ed 83 28 a9 58 1a a9 38 a4 95 a1 ac 31 |SX...(.X..8....1|
|
|
00000240 5a 1a 84 66 3d 43 d3 2d d9 0b f2 97 df d3 20 64 |Z..f=C.-...... d|
|
|
00000250 38 92 24 3a 00 bc cf 9c 7d b7 40 20 01 5f aa d3 |8.$:....}.@ ._..|
|
|
00000260 16 61 09 a2 76 fd 13 c3 cc e1 0c 5c ee b1 87 82 |.a..v......\....|
|
|
00000270 f1 6c 04 ed 73 bb b3 43 77 8d 0c 1c f1 0f a1 d8 |.l..s..Cw.......|
|
|
00000280 40 83 61 c9 4c 72 2b 9d ae db 46 06 06 4d f4 c1 |@.a.Lr+...F..M..|
|
|
00000290 b3 3e c0 d1 bd 42 d4 db fe 3d 13 60 84 5c 21 d3 |.>...B...=.`.\!.|
|
|
000002a0 3b e9 fa e7 16 03 03 00 ac 0c 00 00 a8 03 00 1d |;...............|
|
|
000002b0 20 ca 71 50 46 39 b2 eb cd 94 b3 40 c1 e6 5d fa | .qPF9.....@..].|
|
|
000002c0 ea 89 1a 88 3c fb 43 74 67 1a 19 8e a2 a7 ae eb |....<.Ctg.......|
|
|
000002d0 2d 04 01 00 80 08 78 39 3e 22 81 2d 44 a4 53 57 |-.....x9>".-D.SW|
|
|
000002e0 ce b6 70 ee 9e 55 f1 02 a3 fe f8 9c 5f ea 01 05 |..p..U......_...|
|
|
000002f0 d0 59 85 d0 d6 76 47 20 57 5e 78 86 53 c5 09 7b |.Y...vG W^x.S..{|
|
|
00000300 20 b0 75 e1 8d 2c 74 ef e5 62 c4 f7 4f c8 3b 5d | .u..,t..b..O.;]|
|
|
00000310 52 55 54 d1 cd 33 3c 25 a2 52 98 85 30 8a 0c 6b |RUT..3<%.R..0..k|
|
|
00000320 2e 08 f9 4a 19 d9 fc 44 30 85 bd 0c 62 7d 26 10 |...J...D0...b}&.|
|
|
00000330 60 8a 38 83 24 4a 33 80 76 33 58 0d 3d 6c 21 e3 |`.8.$J3.v3X.=l!.|
|
|
00000340 a1 d3 26 b3 cc 99 03 11 87 7f 5b c8 4a a1 5b 73 |..&.......[.J.[s|
|
|
00000350 9b e6 5b a0 cb 16 03 03 00 04 0e 00 00 00 |..[...........|
|
|
>>> 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 28 00 00 00 00 00 00 00 00 ab fa 8f |....(...........|
|
|
00000040 11 27 ce 66 71 b0 1e af db f8 7f 8d f5 6c 1d 88 |.'.fq........l..|
|
|
00000050 ac 9c 7b 20 c1 f1 37 7d ec ff 6d ab d5 |..{ ..7}..m..|
|
|
>>> Flow 4 (server to client)
|
|
00000000 16 03 03 00 ba 04 00 00 b6 00 00 1c 20 00 b0 59 |............ ..Y|
|
|
00000010 47 87 9f 9b 49 8e 14 c6 3c 81 bb 8d 80 d9 1e 65 |G...I...<......e|
|
|
00000020 f3 4c 81 85 01 fb 40 e7 7f ae f3 81 46 fb 83 26 |.L....@.....F..&|
|
|
00000030 fd 84 3c a8 36 f5 8f 74 04 7b ea 42 ca 87 88 1f |..<.6..t.{.B....|
|
|
00000040 2f e9 be ae af cb 54 e7 e5 0b 71 53 f4 d7 32 2b |/.....T...qS..2+|
|
|
00000050 d4 fd f8 08 c1 8d 93 db 60 a2 e0 7c ab 7b 18 f3 |........`..|.{..|
|
|
00000060 9c 0b 10 ab 3b 36 5d 14 e2 d2 6f ee 41 e6 79 c8 |....;6]...o.A.y.|
|
|
00000070 71 7d d5 fc 72 a2 07 e6 70 69 91 00 8f 63 2b e6 |q}..r...pi...c+.|
|
|
00000080 71 fe 63 59 72 81 bc 70 81 9f 08 36 09 64 c0 77 |q.cYr..p...6.d.w|
|
|
00000090 21 43 6f 6c cf 69 ac e7 3d 43 cd 56 48 43 99 a5 |!Col.i..=C.VHC..|
|
|
000000a0 bf 2f 78 7a ae 14 42 00 f4 1a 46 c7 a5 45 e3 41 |./xz..B...F..E.A|
|
|
000000b0 2b 9d 4c b9 b6 79 24 a4 7c 3a 4e 2b 75 e9 19 14 |+.L..y$.|:N+u...|
|
|
000000c0 03 03 00 01 01 16 03 03 00 28 dc 79 b9 74 ad e4 |.........(.y.t..|
|
|
000000d0 5a 37 b0 12 c2 5d 3e fb d5 19 e2 f9 4e bc 47 1b |Z7...]>.....N.G.|
|
|
000000e0 53 49 a4 f4 56 f3 84 c5 6b 30 a7 2d 62 16 69 48 |SI..V...k0.-b.iH|
|
|
000000f0 46 23 |F#|
|
|
>>> Flow 5 (client to server)
|
|
00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 c1 47 d1 |..............G.|
|
|
00000010 94 f9 d2 bc 79 7e fc 6f 14 cc 97 eb 7d c9 21 51 |....y~.o....}.!Q|
|
|
00000020 af ee 8b 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................|
|
|
00000030 35 91 a5 bb 92 cf 25 1c 22 95 e8 7a fe f4 82 f6 |5.....%."..z....|
|
|
00000040 a1 0c |..|
|