crypto/tls: implement Extended Master Secret

All OpenSSL tests now test operation with EMS. To test a handshake
*without* EMS we need to pass -Options=-ExtendedMasterSecret which is
only available in OpenSSL 3.1, which breaks a number of other tests.

Updates #43922

Change-Id: Ib9ac79a1d03fab6bfba5fe9cd66689cff661cda7
Reviewed-on: https://go-review.googlesource.com/c/go/+/497376
Run-TryBot: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Damien Neil <dneil@google.com>
This commit is contained in:
Filippo Valsorda 2023-05-24 01:55:45 +02:00 committed by Gopher Robot
parent 1143de0f03
commit d154b73cf1
120 changed files with 9366 additions and 9243 deletions

View file

@ -1,5 +1,5 @@
>>> Flow 1 (client to server)
00000000 16 03 01 00 fa 01 00 00 f6 03 03 00 00 00 00 00 |................|
00000000 16 03 01 00 fe 01 00 00 fa 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 20 00 00 00 00 |........... ....|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
@ -7,84 +7,85 @@
00000050 cc a8 c0 2b c0 2f c0 2c c0 30 c0 09 c0 13 c0 0a |...+./.,.0......|
00000060 c0 14 00 9c 00 9d 00 2f 00 35 c0 12 00 0a c0 23 |......./.5.....#|
00000070 c0 27 00 3c c0 07 c0 11 00 05 13 03 13 01 13 02 |.'.<............|
00000080 01 00 00 7b 00 05 00 05 01 00 00 00 00 00 0a 00 |...{............|
00000080 01 00 00 7f 00 05 00 05 01 00 00 00 00 00 0a 00 |................|
00000090 0a 00 08 00 1d 00 17 00 18 00 19 00 0b 00 02 01 |................|
000000a0 00 00 0d 00 1a 00 18 08 04 04 03 08 07 08 05 08 |................|
000000b0 06 04 01 05 01 06 01 05 03 06 03 02 01 02 03 ff |................|
000000c0 01 00 01 00 00 12 00 00 00 2b 00 09 08 03 04 03 |.........+......|
000000d0 03 03 02 03 01 00 33 00 26 00 24 00 1d 00 20 2f |......3.&.$... /|
000000e0 e5 7d a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 |.}.G.bC.(.._.).0|
000000f0 ff f6 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |.........._X.;t|
000000c0 01 00 01 00 00 17 00 00 00 12 00 00 00 2b 00 09 |.............+..|
000000d0 08 03 04 03 03 03 02 03 01 00 33 00 26 00 24 00 |..........3.&.$.|
000000e0 1d 00 20 2f e5 7d a3 47 cd 62 43 15 28 da ac 5f |.. /.}.G.bC.(.._|
000000f0 bb 29 07 30 ff f6 84 af c4 cf c2 ed 90 99 5f 58 |.).0.........._X|
00000100 cb 3b 74 |.;t|
>>> Flow 2 (server to client)
00000000 16 03 03 00 7a 02 00 00 76 03 03 39 b2 74 80 d8 |....z...v..9.t..|
00000010 49 72 79 63 9b 7b da d7 cf b4 29 20 f8 80 ed d9 |Iryc.{....) ....|
00000020 66 09 65 22 b6 27 16 c5 a7 6f 8b 20 00 00 00 00 |f.e".'...o. ....|
00000000 16 03 03 00 7a 02 00 00 76 03 03 ce bd 20 50 3d |....z...v.... P=|
00000010 7e 80 5d e3 c4 d1 f4 d7 9b 28 0d ad c7 2c c9 b0 |~.]......(...,..|
00000020 bb 25 e4 98 56 77 9a dd 7c 2e e7 20 00 00 00 00 |.%..Vw..|.. ....|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 00 00 00 00 00 00 00 00 00 00 00 00 13 03 00 00 |................|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 42 |..+.....3.$... B|
00000060 80 fb 4a d3 49 53 a5 9f f6 da ca 64 f8 5d 2c f5 |..J.IS.....d.],.|
00000070 45 4d f1 a5 ec c3 c6 fc d2 ff 56 b1 63 53 1a 14 |EM........V.cS..|
00000080 03 03 00 01 01 17 03 03 00 17 f8 d8 e1 1a e0 c8 |................|
00000090 75 f9 40 90 da 16 a0 41 4f 8c 23 e7 47 43 89 cf |u.@....AO.#.GC..|
000000a0 d4 17 03 03 02 6d d6 23 1d c6 c0 d4 5e a3 fe 2b |.....m.#....^..+|
000000b0 03 04 6c 88 d1 4a ac 9b dd 90 e5 18 c5 35 9c 4a |..l..J.......5.J|
000000c0 f3 c4 64 e2 c2 40 62 fb 68 b3 22 37 9f f4 eb ae |..d..@b.h."7....|
000000d0 45 d9 a8 be f4 1e 89 16 88 b5 10 e3 5c 2e 42 15 |E...........\.B.|
000000e0 34 24 f3 bd dd 73 6d 6b d1 db 3e 69 b0 0a 54 e6 |4$...smk..>i..T.|
000000f0 b7 2c b7 80 86 93 91 d5 26 02 77 bf 10 38 ee 40 |.,......&.w..8.@|
00000100 22 4d 3f 67 02 6b f8 1c 4a ad 2b c7 f6 19 d4 36 |"M?g.k..J.+....6|
00000110 9b ff c4 08 73 e1 48 0a a6 e8 80 3b 88 8a c2 e8 |....s.H....;....|
00000120 c6 4a ae da a1 4f 3b 9e fb 80 3b 78 ca 80 42 00 |.J...O;...;x..B.|
00000130 a4 5c 9d a0 6c 63 a7 66 e6 26 b7 14 d8 8b ba 1a |.\..lc.f.&......|
00000140 4b 13 81 3c e4 76 4e ac 6c 2f b4 71 e9 dc c4 c8 |K..<.vN.l/.q....|
00000150 ef f0 61 22 f4 6b 83 ae d8 d0 a7 c6 d9 ea 95 85 |..a".k..........|
00000160 77 90 0f 22 a0 50 cb ff 50 a5 98 ee de e4 89 f3 |w..".P..P.......|
00000170 20 f2 63 a2 45 3a 48 33 d5 b9 ff 5e f8 7d c5 2d | .c.E:H3...^.}.-|
00000180 b9 9c b2 65 bf d5 13 36 46 a5 96 9f f4 de 7c 1c |...e...6F.....|.|
00000190 78 3f 1a 0a 62 14 13 8e 55 7e cd 47 87 1b 7e a8 |x?..b...U~.G..~.|
000001a0 7f 03 ec 1c d3 72 eb e5 94 d9 9d 95 d6 f5 ad 2c |.....r.........,|
000001b0 e9 7d 0f 2c ea 7b 1e 8e d7 b4 f1 5d 12 be d7 cf |.}.,.{.....]....|
000001c0 b7 43 89 65 e9 04 0e f8 b4 b4 4d 9c 9c 42 3c 50 |.C.e......M..B<P|
000001d0 a7 91 d0 7f c0 de fb 99 08 ce 5c fd 67 3a cb 1a |..........\.g:..|
000001e0 d3 1a 4c a2 2e 7d 73 01 2b 5f bb a2 86 7d 0e e0 |..L..}s.+_...}..|
000001f0 a1 c9 06 c0 4a 0a f6 c6 c4 b5 53 51 3e 2f f4 60 |....J.....SQ>/.`|
00000200 1d 41 55 9d c4 88 f3 76 4f 92 b5 03 98 23 6b c4 |.AU....vO....#k.|
00000210 c3 62 bd 12 dd 3a bc 37 d0 18 64 c6 e1 2c cb 62 |.b...:.7..d..,.b|
00000220 f6 d3 24 35 47 e7 cf 15 d3 53 9d ac 3f 97 48 c1 |..$5G....S..?.H.|
00000230 b8 d3 a3 2c 9f cd 2b 72 bc bd a6 8a b1 54 48 7b |...,..+r.....TH{|
00000240 e0 b7 a2 2e 46 04 cc e5 29 1d 73 c7 67 f8 f0 d8 |....F...).s.g...|
00000250 e0 88 f0 7b 11 ff e1 1d 95 6c 85 c4 08 72 3e 94 |...{.....l...r>.|
00000260 92 4b 8a 58 62 04 10 83 7c 5e 65 20 a7 5d 6d 16 |.K.Xb...|^e .]m.|
00000270 30 64 fc aa 7f 8f 06 ed 4e 3c 86 c8 10 92 fb 0d |0d......N<......|
00000280 7b 81 10 07 cf 30 7f 6b 11 63 60 2a 61 92 cb 74 |{....0.k.c`*a..t|
00000290 82 a4 04 cf 23 43 21 55 45 2a 29 93 42 0f 0c f6 |....#C!UE*).B...|
000002a0 9b 14 b5 96 09 25 1b bc b0 7b 72 e2 6f b8 55 74 |.....%...{r.o.Ut|
000002b0 00 bb 1c 7c b1 9b 58 63 97 bb 6d c5 fb a4 da 24 |...|..Xc..m....$|
000002c0 1e b2 97 18 75 ab 8b a2 77 50 38 4d f8 a0 39 58 |....u...wP8M..9X|
000002d0 8c 2d 3e ba 27 03 e9 51 87 0a 95 e0 08 40 5d e6 |.->.'..Q.....@].|
000002e0 6a dd 10 1d 6d 8c 32 88 a8 32 ee dd 44 9c 9b b0 |j...m.2..2..D...|
000002f0 6f f5 4b 08 60 9d 83 1e ab 83 c0 92 10 c7 aa 90 |o.K.`...........|
00000300 d2 b2 61 5e 12 b5 e8 ea a7 68 59 17 a4 f4 15 f7 |..a^.....hY.....|
00000310 dc 10 81 17 03 03 00 99 8a 61 79 8f 33 51 7b a9 |.........ay.3Q{.|
00000320 ce 3f 82 2b bb da 40 2e 73 c8 d9 6e 7d 72 ba 94 |.?.+..@.s..n}r..|
00000330 7d ad fb b7 ba 9c 74 00 0b c9 1d b6 8d 54 b9 48 |}.....t......T.H|
00000340 eb 49 78 c3 1a 75 b8 16 22 5d 50 f5 4a 81 59 d3 |.Ix..u.."]P.J.Y.|
00000350 38 79 38 c1 35 11 55 69 6b d2 86 3c 0f 12 26 57 |8y8.5.Uik..<..&W|
00000360 f5 84 d7 dd 74 61 6f b8 08 66 e9 3c f7 43 29 a5 |....tao..f.<.C).|
00000370 94 9e ab af 68 04 c1 6a ae 9d 12 2d 57 e9 ff 30 |....h..j...-W..0|
00000380 7d 80 35 65 cc df c8 65 0b a1 f9 6d 6b a5 0b df |}.5e...e...mk...|
00000390 0c 1a 04 0a 00 8f ac 2b 29 60 92 4e 91 d3 42 25 |.......+)`.N..B%|
000003a0 b4 a5 0a 1a 5f 83 ec 9a f0 0a 2c 6d 65 00 24 d3 |...._.....,me.$.|
000003b0 e1 17 03 03 00 35 e4 72 aa 9e 6c a8 93 7b e4 49 |.....5.r..l..{.I|
000003c0 1e 23 7c 50 18 59 00 08 3b f1 c1 5f 20 ba 51 56 |.#|P.Y..;.._ .QV|
000003d0 fe bb 93 99 52 e6 5e 6d 26 cc 60 11 c2 a1 c8 18 |....R.^m&.`.....|
000003e0 2e 72 bd ee 36 ca 41 25 73 f2 30 |.r..6.A%s.0|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 75 |..+.....3.$... u|
00000060 35 5d ce ae 93 0b e6 2c c7 aa 67 6d 9d bd b2 8d |5].....,..gm....|
00000070 83 ac 17 7c 21 21 b2 c1 dc a1 4d 54 72 66 05 14 |...|!!....MTrf..|
00000080 03 03 00 01 01 17 03 03 00 17 88 68 f2 3c 98 b5 |...........h.<..|
00000090 ef 6e 2b ba aa d3 d4 0c 28 aa 3a 6f 51 a7 dc 89 |.n+.....(.:oQ...|
000000a0 fb 17 03 03 02 6d ae f6 44 17 0d 3b ee 41 5b a9 |.....m..D..;.A[.|
000000b0 d2 63 7c 98 25 e7 ca 46 29 05 9e 75 9f 71 58 99 |.c|.%..F)..u.qX.|
000000c0 57 a3 c3 88 08 54 88 ea 8f ea ca 87 88 c0 53 d7 |W....T........S.|
000000d0 de b6 3d 14 98 64 1a 6b 8f 90 e7 6a 10 e2 4b 42 |..=..d.k...j..KB|
000000e0 13 59 f0 bc a0 74 3b 5b a8 15 74 3a 30 9f 28 ed |.Y...t;[..t:0.(.|
000000f0 b2 a0 48 15 5a 3b 0c 61 26 4e 3f 5a 33 3d d9 88 |..H.Z;.a&N?Z3=..|
00000100 97 9f fe 2a d5 df f7 01 40 84 75 90 89 7d 34 23 |...*....@.u..}4#|
00000110 3e 70 85 82 94 b7 21 94 e6 0c d1 f1 88 06 ff 34 |>p....!........4|
00000120 64 2f e5 e6 80 10 2b 0c fe 18 f5 2c cc b0 27 37 |d/....+....,..'7|
00000130 2b 5a 4b 43 e8 b7 ad 97 a0 8c d1 49 bb f9 4a 65 |+ZKC.......I..Je|
00000140 99 bf cd 7f 77 ef 0f b6 d7 91 ce 4d 53 79 d0 5e |....w......MSy.^|
00000150 b7 51 5e 8d 0f 13 85 53 7d 81 27 b2 e1 5a e0 d0 |.Q^....S}.'..Z..|
00000160 d9 b0 3b c6 30 15 ac 3e 60 7f 01 90 da b1 c5 8c |..;.0..>`.......|
00000170 06 7c 8f 31 86 7e 53 5b 1a 4b 8f d0 ff 2c f9 9e |.|.1.~S[.K...,..|
00000180 c4 08 02 12 e4 97 af 3f 07 d0 25 0d 50 90 21 1f |.......?..%.P.!.|
00000190 fa 8d ea 02 16 a4 56 2e 2b e1 3f c2 e2 f5 53 d0 |......V.+.?...S.|
000001a0 6e a2 d4 b9 b6 ae 69 12 74 d4 2f 8f 55 1e 5f b8 |n.....i.t./.U._.|
000001b0 1f b6 29 ee 11 21 81 9f 37 6e 40 b1 27 22 15 7b |..)..!..7n@.'".{|
000001c0 ba bb bd ee 7a 7e 1f e4 7e 63 a1 60 53 a1 c7 0f |....z~..~c.`S...|
000001d0 f8 2e c3 07 cd 60 ec 83 0f 18 55 50 5c 11 ec 93 |.....`....UP\...|
000001e0 85 dd 38 5c 7e 4a 0a af 4b c9 22 8d 43 ce 76 62 |..8\~J..K.".C.vb|
000001f0 d7 73 3f ef 67 2d 6a 02 bd b5 8f c4 8b 64 b1 a3 |.s?.g-j......d..|
00000200 c4 40 c1 ea 7e 57 b9 25 45 61 96 97 69 69 9f 2b |.@..~W.%Ea..ii.+|
00000210 a7 56 b5 8b 80 25 3e 3c 73 14 b2 21 10 ee 47 cd |.V...%><s..!..G.|
00000220 5f 6f 6f fa 71 bf 88 47 39 21 05 b9 e3 0b f2 ad |_oo.q..G9!......|
00000230 68 52 8a fe 9d 90 60 49 bb ea 73 02 a6 2d 55 93 |hR....`I..s..-U.|
00000240 d5 cd e1 f6 2b 40 8c 9a 22 e8 65 3f fb 5e 8e 88 |....+@..".e?.^..|
00000250 d2 38 10 00 c6 25 26 77 78 a9 f9 fe 27 29 c7 5a |.8...%&wx...').Z|
00000260 e1 24 97 a7 6b ea 3f 57 4f 1c b9 cf 0a 75 3b c7 |.$..k.?WO....u;.|
00000270 81 df 4b 9c 37 80 15 01 22 a0 ac f7 a8 cc 72 f7 |..K.7...".....r.|
00000280 63 df 49 31 8d 70 1c a6 c5 3c c5 4e 22 cf b7 b3 |c.I1.p...<.N"...|
00000290 a5 27 ce 9f d5 34 1b d7 de 67 a9 af b2 d9 04 0c |.'...4...g......|
000002a0 f6 bd 33 b8 91 c8 66 02 90 a8 82 76 9e 4b 86 7f |..3...f....v.K..|
000002b0 d9 8a d1 ea fc 2a 9a 8e 2b 61 10 c9 5e 62 86 78 |.....*..+a..^b.x|
000002c0 df 7d 09 14 0b ec ac 76 dc 62 7f 00 a3 16 9b 30 |.}.....v.b.....0|
000002d0 f7 17 92 79 c1 03 af cd ef 4d 09 c3 a1 13 cd 83 |...y.....M......|
000002e0 05 47 9b 61 80 54 56 de b9 9c 78 43 e9 70 af db |.G.a.TV...xC.p..|
000002f0 bb f6 4f 17 6b c4 61 57 5f 57 91 3e e7 f4 dc 0c |..O.k.aW_W.>....|
00000300 e2 01 51 80 b3 de cb ac 67 41 cb e9 92 4b ba 18 |..Q.....gA...K..|
00000310 c5 58 f4 17 03 03 00 99 9c bf 47 cb 60 c1 51 50 |.X........G.`.QP|
00000320 73 87 10 02 5b e7 b4 f5 4f 60 65 de 44 ae 5c 15 |s...[...O`e.D.\.|
00000330 0e df 8b fa 47 0f 51 0a a1 05 70 a6 8f a0 2a 27 |....G.Q...p...*'|
00000340 84 e9 a1 38 43 3d 2a e5 10 45 22 01 0a b2 8e 6d |...8C=*..E"....m|
00000350 27 53 b9 ea b5 5d 6d a7 50 69 c2 4c 50 cf 3d d9 |'S...]m.Pi.LP.=.|
00000360 47 82 62 4b 0b 42 6a 3f e5 4f a8 04 9b 7d f2 26 |G.bK.Bj?.O...}.&|
00000370 15 ce 88 74 40 59 87 2b 11 a5 ac 9a e5 3f 03 db |...t@Y.+.....?..|
00000380 33 cb 27 be d9 2a 69 1d 1e 68 6b 0e 54 0a f4 1c |3.'..*i..hk.T...|
00000390 63 b3 bb 55 63 e7 b6 b7 0e 2c ad 9e b5 1d 51 b4 |c..Uc....,....Q.|
000003a0 41 77 4b 80 17 47 c9 8f 9e 02 cd 87 2e 20 72 e4 |AwK..G....... r.|
000003b0 44 17 03 03 00 35 0e 4f 8b e7 ae ca 38 35 85 d8 |D....5.O....85..|
000003c0 fb 23 c3 39 d4 80 25 15 d3 39 4e 19 34 93 21 13 |.#.9..%..9N.4.!.|
000003d0 a2 84 2c 0f 3e 5e c3 62 95 41 c7 4d a7 81 2d 60 |..,.>^.b.A.M..-`|
000003e0 99 56 db d5 0e 2e 42 b3 16 72 22 |.V....B..r"|
>>> Flow 3 (client to server)
00000000 14 03 03 00 01 01 17 03 03 00 35 b6 c3 b9 b1 52 |..........5....R|
00000010 88 d2 78 2b ec 1c 63 e8 d5 08 0e 4e d6 51 b9 02 |..x+..c....N.Q..|
00000020 ba cc a8 ca b6 da 45 a9 7c 1a 18 39 47 84 db 34 |......E.|..9G..4|
00000030 d6 05 6f e5 16 19 57 6f 65 0b 7a e7 37 b5 d3 28 |..o...Woe.z.7..(|
00000040 17 03 03 00 17 dc b8 e2 1c aa b8 f5 cb b6 fd ba |................|
00000050 29 34 73 bb c6 e0 3a fc 3e fb d3 01 17 03 03 00 |)4s...:.>.......|
00000060 13 eb 66 ab 47 38 1b 01 96 6c 59 46 c2 ad bf 2d |..f.G8...lYF...-|
00000070 36 22 97 19 |6"..|
00000000 14 03 03 00 01 01 17 03 03 00 35 db e3 68 0f 7c |..........5..h.||
00000010 36 8e c4 5b 10 11 89 61 b7 f1 a9 f3 43 a5 28 e6 |6..[...a....C.(.|
00000020 86 8c f0 c3 3b 54 5b 86 3c b6 42 6e 3d 56 93 0a |....;T[.<.Bn=V..|
00000030 2c ca 2e 39 27 1c 12 e2 d7 e7 b5 57 a6 29 5c 4a |,..9'......W.)\J|
00000040 17 03 03 00 17 02 0d 23 ca 06 5e 1c 0f a8 a2 39 |.......#..^....9|
00000050 32 00 01 b5 ba e7 52 82 fa 2c e3 27 17 03 03 00 |2.....R..,.'....|
00000060 13 ea 39 b7 18 2d 01 1a c3 9c b5 51 cc d2 f3 40 |..9..-.....Q...@|
00000070 55 69 87 65 |Ui.e|