mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-04 04:27:36 +03:00
crypto/tls: implement TLS 1.3 middlebox compatibility mode
Looks like the introduction of CCS records in the client second flight gave time to s_server to send NewSessionTicket messages in between the client application data and close_notify. There seems to be no way of turning NewSessionTicket messages off, neither by not sending a psk_key_exchange_modes extension, nor by command line flag. Interleaving the client write like that tickled an issue akin to #18701: on Windows, the client reaches Close() before the last record is drained from the send buffer, the kernel notices and resets the connection, cutting short the last flow. There is no good way of synchronizing this, so we sleep for a RTT before calling close, like in CL 75210. Sigh. Updates #9671 Change-Id: I44dc1cca17b373695b5a18c2741f218af2990bd1 Reviewed-on: https://go-review.googlesource.com/c/147419 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
parent
e04a8ac694
commit
5b79a7c982
25 changed files with 1935 additions and 1594 deletions
150
testdata/Server-TLSv13-CHACHA20-SHA256
vendored
150
testdata/Server-TLSv13-CHACHA20-SHA256
vendored
|
@ -1,9 +1,9 @@
|
|||
>>> Flow 1 (client to server)
|
||||
00000000 16 03 01 00 dc 01 00 00 d8 03 03 1d 2a 53 ec f5 |............*S..|
|
||||
00000010 20 a6 22 2e 35 9d c4 a8 9b f0 0f 89 70 ef af 2b | .".5.......p..+|
|
||||
00000020 3c 8c 6b 8a 44 74 71 8f e2 b6 f5 20 34 ab 1d 74 |<.k.Dtq.... 4..t|
|
||||
00000030 cc cf 78 1f 9a 92 0b 7b 77 6a 67 16 fa 45 d2 d8 |..x....{wjg..E..|
|
||||
00000040 1f c2 15 c3 91 f7 b6 1f 01 62 3e d1 00 04 13 03 |.........b>.....|
|
||||
00000000 16 03 01 00 dc 01 00 00 d8 03 03 3a 67 df d1 61 |...........:g..a|
|
||||
00000010 7e 99 9a 82 12 bc af 5e 66 ca 60 c4 a2 7f a6 a6 |~......^f.`.....|
|
||||
00000020 71 b5 ff b7 e5 96 12 21 f0 92 85 20 e6 52 d4 99 |q......!... .R..|
|
||||
00000030 4b 4a b0 43 53 5e d4 cd 8e d9 a9 f5 42 aa c4 64 |KJ.CS^......B..d|
|
||||
00000040 58 65 ec 46 ae d9 d7 0d 62 de 21 2e 00 04 13 03 |Xe.F....b.!.....|
|
||||
00000050 00 ff 01 00 00 8b 00 00 00 0e 00 0c 00 00 09 31 |...............1|
|
||||
00000060 32 37 2e 30 2e 30 2e 31 00 0b 00 04 03 00 01 02 |27.0.0.1........|
|
||||
00000070 00 0a 00 0c 00 0a 00 1d 00 17 00 1e 00 19 00 18 |................|
|
||||
|
@ -11,80 +11,80 @@
|
|||
00000090 05 03 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 |................|
|
||||
000000a0 08 05 08 06 04 01 05 01 06 01 00 2b 00 03 02 03 |...........+....|
|
||||
000000b0 04 00 2d 00 02 01 01 00 33 00 26 00 24 00 1d 00 |..-.....3.&.$...|
|
||||
000000c0 20 71 d3 74 f3 4c 75 f7 29 4d 65 5b 13 b4 ea 4a | q.t.Lu.)Me[...J|
|
||||
000000d0 ad 25 d2 5c 36 e8 42 f5 1d 4e b3 3e 7c a0 87 48 |.%.\6.B..N.>|..H|
|
||||
000000e0 29 |)|
|
||||
000000c0 20 d0 26 0b b3 f0 56 30 0d 3b 71 2b db 78 60 62 | .&...V0.;q+.x`b|
|
||||
000000d0 e9 d1 6b e0 12 95 27 be 40 ad 40 56 e1 f3 f6 c8 |..k...'.@.@V....|
|
||||
000000e0 4f |O|
|
||||
>>> Flow 2 (server to client)
|
||||
00000000 16 03 03 00 7a 02 00 00 76 03 03 00 00 00 00 00 |....z...v.......|
|
||||
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 20 34 ab 1d 74 |........... 4..t|
|
||||
00000030 cc cf 78 1f 9a 92 0b 7b 77 6a 67 16 fa 45 d2 d8 |..x....{wjg..E..|
|
||||
00000040 1f c2 15 c3 91 f7 b6 1f 01 62 3e d1 13 03 00 00 |.........b>.....|
|
||||
00000020 00 00 00 00 00 00 00 00 00 00 00 20 e6 52 d4 99 |........... .R..|
|
||||
00000030 4b 4a b0 43 53 5e d4 cd 8e d9 a9 f5 42 aa c4 64 |KJ.CS^......B..d|
|
||||
00000040 58 65 ec 46 ae d9 d7 0d 62 de 21 2e 13 03 00 00 |Xe.F....b.!.....|
|
||||
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 2f |..+.....3.$... /|
|
||||
00000060 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
|
||||
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 17 |.........._X.;t.|
|
||||
00000080 03 03 00 17 ed 03 2b 35 ba 39 86 ae ee 50 9e 71 |......+5.9...P.q|
|
||||
00000090 f6 0a 49 2d 6e cc f5 0a 25 00 fc 17 03 03 02 6d |..I-n...%......m|
|
||||
000000a0 dd 4a 14 ec 14 0e 41 8c 98 3b 02 df cb 33 f1 33 |.J....A..;...3.3|
|
||||
000000b0 49 04 d2 bb 10 a1 b6 bb 92 17 09 19 4d 1e 18 03 |I...........M...|
|
||||
000000c0 0c 97 c3 f9 e1 35 fd 5e 09 58 07 e3 15 8c ca 6b |.....5.^.X.....k|
|
||||
000000d0 19 7a e1 ac 17 84 f8 f3 1d f4 1c f7 53 d6 fc 54 |.z..........S..T|
|
||||
000000e0 5a c5 a7 4b 67 58 b9 63 85 a8 12 e4 3e 7a 87 7e |Z..KgX.c....>z.~|
|
||||
000000f0 d6 b0 7f b9 70 b8 6f 57 23 7c 03 69 61 0a 3e bb |....p.oW#|.ia.>.|
|
||||
00000100 65 b7 e5 48 4c c5 a3 ae 34 46 cf a4 b1 5b a5 26 |e..HL...4F...[.&|
|
||||
00000110 5b 50 01 0b b7 36 30 06 46 b1 3e ae f7 72 2b 44 |[P...60.F.>..r+D|
|
||||
00000120 7b e7 4d d0 18 c0 07 53 d4 73 80 02 cf 10 1b c9 |{.M....S.s......|
|
||||
00000130 10 a8 29 81 c4 89 78 cf ad 3a 90 92 e3 f2 ac 9c |..)...x..:......|
|
||||
00000140 88 64 f6 1f 96 bf f7 a8 f4 a1 ec 26 52 a7 ab 3b |.d.........&R..;|
|
||||
00000150 0c 33 0f 46 6b cf c0 07 80 ca 46 61 28 46 9e 5a |.3.Fk.....Fa(F.Z|
|
||||
00000160 22 98 d7 cf 1f b8 c5 b4 d1 14 3f 71 0b e8 a3 3f |".........?q...?|
|
||||
00000170 8a 69 a4 1c a7 5a e4 e0 a0 d8 ee e4 5c ef 6b 55 |.i...Z......\.kU|
|
||||
00000180 55 e5 4e 6f 75 79 d0 53 b8 21 22 1d bf 86 65 15 |U.Nouy.S.!"...e.|
|
||||
00000190 7a 24 7f 7c 4b 82 84 6d aa 08 9e 45 1a 5f 2b 34 |z$.|K..m...E._+4|
|
||||
000001a0 66 f2 92 cc f0 7a 7a e5 d1 2a c2 2e cb 78 c5 aa |f....zz..*...x..|
|
||||
000001b0 18 87 d3 45 6d 39 39 25 3c f3 aa db 6c 10 8c b4 |...Em99%<...l...|
|
||||
000001c0 f7 f8 ea 49 5f 8a 5b 20 4d f2 e6 53 11 0f a5 3e |...I_.[ M..S...>|
|
||||
000001d0 ab 0e 0f 6b fb 5f 43 cb 9f ed 0a f1 5e 21 0f 7c |...k._C.....^!.||
|
||||
000001e0 86 4f e0 62 cb 2e be 49 2a c0 3b 53 92 8c 58 c2 |.O.b...I*.;S..X.|
|
||||
000001f0 53 82 bc 1b 84 e1 5f 85 2d 9e 5f 85 9f 4c 31 7d |S....._.-._..L1}|
|
||||
00000200 20 ad a4 07 4f 08 06 7b e8 47 52 cf a0 4e e5 0f | ...O..{.GR..N..|
|
||||
00000210 ff d2 5b f6 f2 a0 5d 08 92 98 f0 d9 a0 e9 4f cd |..[...].......O.|
|
||||
00000220 c9 bb de d9 a0 b5 e1 ec a9 60 7b a9 37 2f 5c 77 |.........`{.7/\w|
|
||||
00000230 60 62 de dd f8 e1 63 4e 0b 7f 92 ff 81 96 02 ab |`b....cN........|
|
||||
00000240 86 e4 f8 4e 52 60 91 cf 75 fc 1d c5 b0 74 c2 06 |...NR`..u....t..|
|
||||
00000250 15 4e be 1b f8 1c 14 ba 8c 2f 0b ab a2 cc 0e 9a |.N......./......|
|
||||
00000260 ce fc 05 e9 21 e8 08 55 61 61 8e 98 c8 73 63 2c |....!..Uaa...sc,|
|
||||
00000270 97 71 2e 74 a1 b1 42 dc fe 6e 26 0f 5b 9d 13 96 |.q.t..B..n&.[...|
|
||||
00000280 47 03 5f 46 4b ae 81 d0 a0 d1 a7 a3 10 de e6 c6 |G._FK...........|
|
||||
00000290 6c bc 01 65 04 6f e5 6c 35 72 4c 65 74 a9 2c b0 |l..e.o.l5rLet.,.|
|
||||
000002a0 10 75 7b d5 c1 1a f0 f8 19 f5 7a 7e 28 f2 53 9d |.u{.......z~(.S.|
|
||||
000002b0 a0 c4 c9 e3 e4 80 71 bc 5d cc 5f 3d 7b 2d 5f f0 |......q.]._={-_.|
|
||||
000002c0 51 94 8c d8 8e 0f f6 b8 29 44 90 c3 99 9a dc de |Q.......)D......|
|
||||
000002d0 b6 81 ac 65 70 2b ad 1d df 47 43 a5 a0 b6 51 6f |...ep+...GC...Qo|
|
||||
000002e0 0e 29 de 9c cf b0 89 93 94 08 d8 f3 a5 05 b9 d3 |.)..............|
|
||||
000002f0 a0 bd 92 81 82 91 89 2d 4e df 13 98 09 67 31 c1 |.......-N....g1.|
|
||||
00000300 4d 28 d0 60 28 dc ae 40 c8 0f 33 d8 ac 17 03 03 |M(.`(..@..3.....|
|
||||
00000310 00 99 22 21 e8 35 f9 9c 29 9d 3a aa 00 ca 0c a7 |.."!.5..).:.....|
|
||||
00000320 d1 62 94 94 44 81 8f e0 56 13 29 5f c4 a9 2b ac |.b..D...V.)_..+.|
|
||||
00000330 8a 67 fe 5f 32 4c 40 00 36 db ff 03 41 67 55 9f |.g._2L@.6...AgU.|
|
||||
00000340 b5 a8 cc 52 89 0d 08 23 af c5 0f 02 70 3a 62 9f |...R...#....p:b.|
|
||||
00000350 91 82 cc 1d 6f 57 d3 2b f6 3f 75 f3 65 6b c2 ca |....oW.+.?u.ek..|
|
||||
00000360 e9 5f 0d 1c 5a 31 8f 8f f8 09 8f a8 4a 27 64 f7 |._..Z1......J'd.|
|
||||
00000370 18 2d fb 29 09 cd 07 fb 7c 32 47 4e 8d e2 e0 47 |.-.)....|2GN...G|
|
||||
00000380 60 76 f8 9e 2c 81 71 09 ac 7d 3a 10 30 27 07 06 |`v..,.q..}:.0'..|
|
||||
00000390 c9 7c 9d 57 5c c2 83 be bf 67 28 70 15 4a fa b6 |.|.W\....g(p.J..|
|
||||
000003a0 56 8b 15 a8 a6 c8 65 ab 8c a4 03 17 03 03 00 35 |V.....e........5|
|
||||
000003b0 c6 0c 8f e5 57 46 d9 de 3a 13 7e 80 a9 06 76 e7 |....WF..:.~...v.|
|
||||
000003c0 a7 6d 5d 0e d1 21 dc 20 8f 2c df 86 cf cd e6 6e |.m]..!. .,.....n|
|
||||
000003d0 71 14 69 a5 63 a1 38 80 d4 28 20 76 31 37 c6 be |q.i.c.8..( v17..|
|
||||
000003e0 d9 65 b9 0b 74 |.e..t|
|
||||
00000070 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 14 |.........._X.;t.|
|
||||
00000080 03 03 00 01 01 17 03 03 00 17 ea 45 ce e9 f5 10 |...........E....|
|
||||
00000090 95 59 6d ed 7a 9c fb 59 92 aa 50 11 a8 59 93 03 |.Ym.z..Y..P..Y..|
|
||||
000000a0 a1 17 03 03 02 6d 3c ce b8 65 ce 05 e3 17 9d ed |.....m<..e......|
|
||||
000000b0 f7 79 65 08 6b 3d 04 bb 8d 60 0a 38 25 e7 4c a8 |.ye.k=...`.8%.L.|
|
||||
000000c0 6b e1 ad 95 85 30 59 06 c0 0a 26 0e d6 1a 81 76 |k....0Y...&....v|
|
||||
000000d0 40 55 6a 43 26 71 95 3b d5 73 1b 24 52 79 23 f9 |@UjC&q.;.s.$Ry#.|
|
||||
000000e0 db 97 c7 8d a7 c3 03 b8 35 56 1a 4a cc 3d 76 88 |........5V.J.=v.|
|
||||
000000f0 4f 23 75 67 c2 84 6d db fa cc 6c 77 94 f3 eb 95 |O#ug..m...lw....|
|
||||
00000100 eb 27 f4 e2 03 41 b5 d7 e9 e1 7e 29 b4 82 01 e6 |.'...A....~)....|
|
||||
00000110 3f 76 e4 1f ef cb 39 27 a5 3b 34 f1 d5 f2 26 c7 |?v....9'.;4...&.|
|
||||
00000120 10 37 41 c1 08 81 00 9e 37 6d e4 0f a9 57 a7 1d |.7A.....7m...W..|
|
||||
00000130 ea a8 19 23 32 a7 1a 04 8f c1 00 18 da 06 fd bc |...#2...........|
|
||||
00000140 90 5d fb e7 03 f5 68 28 77 ed 47 5d 38 ec 66 6b |.]....h(w.G]8.fk|
|
||||
00000150 0d c6 04 94 b9 af c0 a6 75 63 a4 8e bc 2e fd 52 |........uc.....R|
|
||||
00000160 9b c3 f5 4f b0 23 4d ed 7b 56 23 f5 fc d6 0e 3d |...O.#M.{V#....=|
|
||||
00000170 80 e2 31 24 79 33 6c 14 54 ef 09 b7 2d 3a 27 69 |..1$y3l.T...-:'i|
|
||||
00000180 a7 18 9d cb 70 f6 bc 1a 87 61 f2 9b 37 62 d5 6e |....p....a..7b.n|
|
||||
00000190 d1 32 b8 93 9b 83 48 48 27 f4 cb fa cd c4 66 92 |.2....HH'.....f.|
|
||||
000001a0 5d 4e 20 4b 26 b5 27 26 19 60 83 80 3c 4d a7 0a |]N K&.'&.`..<M..|
|
||||
000001b0 8a 1d 82 29 ae bc b8 94 4c c7 ee 16 38 30 20 1f |...)....L...80 .|
|
||||
000001c0 19 60 15 99 88 45 ca 37 8d 49 28 ac 81 0d 95 98 |.`...E.7.I(.....|
|
||||
000001d0 fd 71 b4 a8 00 59 a1 6c 56 c1 aa 75 dc 37 1b 29 |.q...Y.lV..u.7.)|
|
||||
000001e0 e1 4a 1d 90 51 4f 93 33 c8 00 7b 56 ef b7 bc 3f |.J..QO.3..{V...?|
|
||||
000001f0 3f fe c5 b6 20 6d 15 cf e5 87 22 ce 0f fd 6a a4 |?... m...."...j.|
|
||||
00000200 f9 80 06 ce a7 3f b8 3f d9 25 bd b7 0f 5d d4 80 |.....?.?.%...]..|
|
||||
00000210 f1 b0 33 01 97 f5 f8 d8 93 94 e9 0b fb 86 1f ea |..3.............|
|
||||
00000220 18 6a cc 5e b8 7e 59 3f 27 4d dd af 2c 0b b1 8c |.j.^.~Y?'M..,...|
|
||||
00000230 4f a6 5f 0b 3f 85 ec 3c fe 48 46 59 6f 92 77 af |O._.?..<.HFYo.w.|
|
||||
00000240 54 da c7 b7 f2 35 e8 09 79 ef 9b 72 70 36 c5 6b |T....5..y..rp6.k|
|
||||
00000250 a5 bd 7d ca 9e 4e 90 f1 e4 fb 87 af 1a 03 4d bd |..}..N........M.|
|
||||
00000260 50 6b 10 88 a6 e1 fe 5c bd 1a 20 2d 44 d6 69 d3 |Pk.....\.. -D.i.|
|
||||
00000270 67 b0 79 dd 88 fd 07 9c ce 05 8d 36 a5 40 15 85 |g.y........6.@..|
|
||||
00000280 7c 88 51 ad 41 d3 26 a0 04 49 f8 4b 0e ad d0 e8 ||.Q.A.&..I.K....|
|
||||
00000290 46 73 e7 4d 01 52 17 15 a1 70 62 70 0f 6a 71 98 |Fs.M.R...pbp.jq.|
|
||||
000002a0 85 27 b4 4d 47 e7 01 6a 4e 21 0d b0 f7 26 9f 28 |.'.MG..jN!...&.(|
|
||||
000002b0 61 fc 4c e0 28 3d 06 a9 37 c9 ab 98 13 dd f0 06 |a.L.(=..7.......|
|
||||
000002c0 f1 6d 8b 0d 28 95 2f 1d d6 7b 80 fe 1b e3 6d e9 |.m..(./..{....m.|
|
||||
000002d0 7c 62 ef e4 e1 08 78 5d 8d b5 2c eb e0 bf 8e de ||b....x]..,.....|
|
||||
000002e0 f5 77 35 d2 51 ec 84 1b c0 7f 74 c8 a7 0b 70 f4 |.w5.Q.....t...p.|
|
||||
000002f0 22 2d 3e fd 38 52 60 d3 0b d8 56 9b 38 3f 09 ca |"->.8R`...V.8?..|
|
||||
00000300 cf 26 02 22 9e 48 30 4f eb 24 e3 94 df 09 bc 8f |.&.".H0O.$......|
|
||||
00000310 51 27 5f 17 03 03 00 99 aa 1e 71 5d 27 7c 0a cc |Q'_.......q]'|..|
|
||||
00000320 a6 16 22 c9 77 45 a7 c4 a4 e5 2d 2d ac c8 1b 2b |..".wE....--...+|
|
||||
00000330 2e 48 03 a5 94 c4 0c 4d 52 e4 2e eb eb 46 36 1e |.H.....MR....F6.|
|
||||
00000340 57 d8 bd 8a 9b 23 9c 27 fb ac 6f 37 2b 8f 70 69 |W....#.'..o7+.pi|
|
||||
00000350 ed f4 83 56 54 fb 03 d6 58 b5 5e 0d b7 82 58 09 |...VT...X.^...X.|
|
||||
00000360 32 ce a0 e4 d7 4d 41 ea 42 39 c3 0b 5e 25 29 50 |2....MA.B9..^%)P|
|
||||
00000370 d0 5b b4 94 15 22 85 d6 52 19 38 a9 56 c4 81 2e |.[..."..R.8.V...|
|
||||
00000380 ef 8d 3b b9 a0 9e c2 2f 24 53 4f 44 0e c1 a2 e3 |..;..../$SOD....|
|
||||
00000390 59 d8 d4 44 a9 39 19 e2 b0 d0 ab c7 7a e0 68 e1 |Y..D.9......z.h.|
|
||||
000003a0 a1 04 f0 7c 0a 12 e8 85 0a a6 6f ec 68 98 a6 98 |...|......o.h...|
|
||||
000003b0 b9 17 03 03 00 35 08 a4 e6 55 41 66 f8 c3 d4 3c |.....5...UAf...<|
|
||||
000003c0 17 6f 54 f3 d5 91 09 53 db b1 49 15 d5 0a 2d ec |.oT....S..I...-.|
|
||||
000003d0 fc 88 68 76 a3 8d 8d d6 b1 4b af b5 be c8 69 0c |..hv.....K....i.|
|
||||
000003e0 08 41 a3 9d 23 c1 87 5d 33 b9 a6 |.A..#..]3..|
|
||||
>>> Flow 3 (client to server)
|
||||
00000000 14 03 03 00 01 01 17 03 03 00 35 65 9c 9f 5e ef |..........5e..^.|
|
||||
00000010 8f 90 79 3f a5 ff cb 00 55 e9 2d 94 62 d4 04 72 |..y?....U.-.b..r|
|
||||
00000020 0e 93 d1 5b cf 53 80 0b 72 d1 b4 e9 09 0b 9a 0f |...[.S..r.......|
|
||||
00000030 10 81 27 bf c5 d2 6c 5a 99 f5 04 b5 3e a7 ab 77 |..'...lZ....>..w|
|
||||
00000000 14 03 03 00 01 01 17 03 03 00 35 6a 0f 9f 87 b5 |..........5j....|
|
||||
00000010 48 60 db 20 7b e9 4f ba fd bf e5 b8 fc 14 3e 2f |H`. {.O.......>/|
|
||||
00000020 3e e8 58 ed d4 c5 e5 da cc 7d c4 32 d4 db c2 6a |>.X......}.2...j|
|
||||
00000030 39 65 85 63 9c 92 7b 7c b3 6f 45 d8 c4 c3 5e 6c |9e.c..{|.oE...^l|
|
||||
>>> Flow 4 (server to client)
|
||||
00000000 17 03 03 00 1e 24 3a 1a 51 aa f2 9e 47 34 90 c7 |.....$:.Q...G4..|
|
||||
00000010 d9 cc 02 40 89 15 7b 47 b6 45 4a 8b fb 8b b5 1a |...@..{G.EJ.....|
|
||||
00000020 43 4c 1e 17 03 03 00 13 01 41 14 2e 85 26 f4 d0 |CL.......A...&..|
|
||||
00000030 da a5 91 14 52 66 0c 7d 26 82 d0 |....Rf.}&..|
|
||||
00000000 17 03 03 00 1e f5 83 ab 23 7e fa 4b 92 40 4b d3 |........#~.K.@K.|
|
||||
00000010 dd 19 de a3 32 df 90 94 86 da da b6 58 97 5a 46 |....2.......X.ZF|
|
||||
00000020 5f f5 b4 17 03 03 00 13 ef a9 5a 2c 54 8d 83 21 |_.........Z,T..!|
|
||||
00000030 79 79 0e 9e a6 f2 4f f6 f8 36 63 |yy....O..6c|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue