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,86 +7,87 @@
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 71 00 90 30 07 |....z...v..q..0.|
00000010 24 01 ae 33 b2 e8 4f 1f 9a 2c 83 e5 7b 30 1e a2 |$..3..O..,..{0..|
00000020 8e 4a d0 df d1 ec 23 b5 ba aa 75 20 00 00 00 00 |.J....#...u ....|
00000000 16 03 03 00 7a 02 00 00 76 03 03 fc b2 8e 30 c0 |....z...v.....0.|
00000010 a2 bd d8 1c 4b 68 bc e0 a1 56 5f 5b 05 54 b7 7a |....Kh...V_[.T.z|
00000020 60 9a 49 68 f5 f4 f0 b1 49 27 79 20 00 00 00 00 |`.Ih....I'y ....|
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 02 00 00 |................|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 06 |..+.....3.$... .|
00000060 2a 26 bd 81 c2 90 9b 17 6e d0 b5 ab 72 e6 93 ce |*&......n...r...|
00000070 53 6d 8c 54 b5 a4 50 91 93 32 6e 88 e6 b2 69 14 |Sm.T..P..2n...i.|
00000080 03 03 00 01 01 17 03 03 00 17 7d 11 37 f0 18 b1 |..........}.7...|
00000090 53 55 38 bb 12 7c e8 b3 89 bc 35 fb 2a 36 d1 0f |SU8..|....5.*6..|
000000a0 3a 17 03 03 02 6d a0 fa dc 8e ac a6 90 5a 20 0e |:....m.......Z .|
000000b0 ee 22 89 7b 69 5b c9 1a a1 c6 43 b9 40 f6 85 78 |.".{i[....C.@..x|
000000c0 61 0b 14 c6 e6 3b a9 ac 4c 7a 96 9b 7b 87 d0 ce |a....;..Lz..{...|
000000d0 42 cc 75 9d fc 06 44 3e e8 12 3a 94 b7 de 86 c4 |B.u...D>..:.....|
000000e0 b5 66 e1 f5 48 21 f7 f1 58 7f 23 6c 3f 76 a0 cb |.f..H!..X.#l?v..|
000000f0 a7 f6 72 34 07 fa c1 55 3e 61 cf 72 c4 6c f1 ca |..r4...U>a.r.l..|
00000100 dd dc ec 66 3d 7b f6 cf 53 3b 28 bd 27 1b aa a6 |...f={..S;(.'...|
00000110 28 2a ab fa 48 a5 08 67 b5 49 c7 c7 5d f8 2c ec |(*..H..g.I..].,.|
00000120 83 af 58 33 42 6c c1 4c 94 17 7e 36 1c a9 48 34 |..X3Bl.L..~6..H4|
00000130 5f 26 78 f6 69 88 3a a5 1b d1 76 ad 88 63 25 33 |_&x.i.:...v..c%3|
00000140 0d e3 d0 34 6b 7f fc 96 2b 8d 22 6f 3f 21 8a 14 |...4k...+."o?!..|
00000150 01 e0 5c 54 6c c3 b8 12 f9 17 f5 4c ce e0 bd 10 |..\Tl......L....|
00000160 e7 e1 29 24 73 94 c2 5e b0 ad d3 91 9e 87 ea 23 |..)$s..^.......#|
00000170 4d fd 8f 12 ca 87 ff 2e 93 9f 16 a8 18 e1 66 8f |M.............f.|
00000180 50 76 15 cd 70 5c a2 1d 91 51 e5 54 13 5f 73 d3 |Pv..p\...Q.T._s.|
00000190 b2 6e b1 27 80 0b 3d 64 d5 fa f3 a4 fb 77 33 cb |.n.'..=d.....w3.|
000001a0 ac 93 54 36 2d 71 c3 9e dd 37 02 a9 9d b0 9b ac |..T6-q...7......|
000001b0 f8 c5 dc 43 9b d8 db c7 d0 fb cf 69 fa 62 e4 9d |...C.......i.b..|
000001c0 b7 04 f8 49 d3 a7 8d bd cf 8a e3 4a 62 cb bb 29 |...I.......Jb..)|
000001d0 b5 db 21 80 76 eb 28 67 34 1e 40 0b 83 83 19 10 |..!.v.(g4.@.....|
000001e0 46 8f bd 78 d6 7c 05 c2 19 82 1c e8 7d 84 f2 79 |F..x.|......}..y|
000001f0 c4 a6 e0 f7 7e df 70 7f 42 48 9f e4 99 03 7f 9e |....~.p.BH......|
00000200 e8 fd 75 c3 8a 55 55 8e 08 2e 62 28 a5 16 b7 11 |..u..UU...b(....|
00000210 d8 9a 11 48 46 ad d3 ba 4f 91 c8 fd 72 d9 df 98 |...HF...O...r...|
00000220 1a 59 51 55 af ab 73 b9 f3 bf fe 7d 55 7d 44 54 |.YQU..s....}U}DT|
00000230 cd bb f3 eb 6e ff 5a 09 e9 b9 c1 66 97 8e a5 7c |....n.Z....f...||
00000240 89 4a 51 1d 8b e4 40 fb 97 ce ef 9d 7c 02 e4 db |.JQ...@.....|...|
00000250 f1 ca 01 d9 05 b4 de 10 23 33 92 ff 26 3b 09 8f |........#3..&;..|
00000260 11 7c 37 ad fb 58 ed 7a 10 08 fd df 98 dd d6 c5 |.|7..X.z........|
00000270 b8 fd 59 37 21 1d 6e 27 8a 56 24 45 e7 64 61 0b |..Y7!.n'.V$E.da.|
00000280 20 2d bc 79 89 fa 6d 7a 06 77 61 0c 60 25 e2 79 | -.y..mz.wa.`%.y|
00000290 6a 54 9e 5b 4b 33 68 17 da 63 ba a7 f9 ad 2c 84 |jT.[K3h..c....,.|
000002a0 52 e9 27 85 71 74 d2 5f c9 f8 8e 67 f7 47 58 f5 |R.'.qt._...g.GX.|
000002b0 e4 72 a7 bd 1c 94 4b 4d 13 5a 62 69 d9 6f 3a 51 |.r....KM.Zbi.o:Q|
000002c0 f0 18 90 e5 b6 21 23 97 70 74 93 ba 9b bc dc e4 |.....!#.pt......|
000002d0 3d 9c 52 3f 93 f0 48 05 e8 50 d0 b4 98 92 7a 18 |=.R?..H..P....z.|
000002e0 3f 39 ba f8 f7 ee 19 b0 ce ac d0 ab 9e 83 ee 0e |?9..............|
000002f0 5d 2a 72 74 a8 8b 4d de 6b a9 91 ad b4 a4 26 99 |]*rt..M.k.....&.|
00000300 4e aa 6d 48 77 83 78 78 be 96 f1 17 d6 96 74 4a |N.mHw.xx......tJ|
00000310 80 d1 5b 17 03 03 00 99 d9 40 96 5c fb 5d 65 69 |..[......@.\.]ei|
00000320 db 54 a8 f6 8c b7 d3 25 8d 2d c5 f1 40 5b f2 26 |.T.....%.-..@[.&|
00000330 f3 86 9e 61 6a a5 b9 66 b1 27 b1 20 6b 2c 64 84 |...aj..f.'. k,d.|
00000340 3f 48 24 5d d9 90 4b d1 ed 1b 0e 05 84 7f ad 0e |?H$]..K.........|
00000350 e6 75 f6 f9 33 90 73 7c 88 10 d7 e9 74 41 4b c3 |.u..3.s|....tAK.|
00000360 19 8e e1 a8 a6 7c 3c 9a bc 69 a7 e7 bb d6 af 98 |.....|<..i......|
00000370 f1 49 53 14 95 80 d6 95 81 5a 5e 88 2c 29 70 df |.IS......Z^.,)p.|
00000380 b2 df fe f3 17 03 e7 de af 12 57 c5 7a ef 70 eb |..........W.z.p.|
00000390 8a c6 c3 05 de 5b 15 af 5f 54 8c 7b 23 b7 e1 f1 |.....[.._T.{#...|
000003a0 30 b1 ed 34 4c 59 f5 68 c2 50 e8 c3 83 78 1d 1f |0..4LY.h.P...x..|
000003b0 eb 17 03 03 00 45 1a d4 61 ba 4a a5 1e 02 80 04 |.....E..a.J.....|
000003c0 2a 19 11 af 8c e9 bd ab 22 6b 75 41 a8 40 de 57 |*......."kuA.@.W|
000003d0 54 8c dc 09 cc 57 76 82 27 5e 59 0c 30 f7 9d c4 |T....Wv.'^Y.0...|
000003e0 fe 1c 09 f2 f4 5f e0 79 ac 02 06 80 f3 60 c4 92 |....._.y.....`..|
000003f0 cd 6a df b6 46 7c de 90 8d bb 94 |.j..F|.....|
00000050 2e 00 2b 00 02 03 04 00 33 00 24 00 1d 00 20 d3 |..+.....3.$... .|
00000060 d7 9e 72 ae 5f f9 92 24 6b 76 e5 a1 00 71 78 cf |..r._..$kv...qx.|
00000070 e9 55 29 5b fe a8 71 14 e9 02 b0 65 12 e8 04 14 |.U)[..q....e....|
00000080 03 03 00 01 01 17 03 03 00 17 24 a0 73 a6 7b ab |..........$.s.{.|
00000090 9c d8 69 e7 15 68 4b 26 0a 15 0c ff c4 40 7d b8 |..i..hK&.....@}.|
000000a0 ad 17 03 03 02 6d 05 b2 f9 6e 05 48 18 92 2b 87 |.....m...n.H..+.|
000000b0 29 1c 5b 8c a8 ae 0e 4b fc 3b 1e b9 2c c2 0c 33 |).[....K.;..,..3|
000000c0 f8 5d 16 37 39 b3 b2 4e 12 a4 02 4c fb 3b 16 4e |.].79..N...L.;.N|
000000d0 63 92 72 56 49 d6 5b 63 34 20 67 c8 07 a2 b6 0d |c.rVI.[c4 g.....|
000000e0 f1 06 b4 bd 88 54 4d 33 66 1a d4 fc 42 9c 4e 00 |.....TM3f...B.N.|
000000f0 40 34 5d cf c4 5d f1 ba 14 de 34 50 f5 2f 3d b7 |@4]..]....4P./=.|
00000100 1c 17 33 6e 9a 2b 39 1b f1 a6 0d fb b7 0c c3 b3 |..3n.+9.........|
00000110 02 f8 0c 30 e8 31 d7 ee bf a1 a0 64 28 67 64 50 |...0.1.....d(gdP|
00000120 24 ce 37 fd 15 2e c7 13 1b 8b f0 22 19 e4 ec c8 |$.7........"....|
00000130 8c b0 76 b8 d0 2d 87 99 86 8b ec ca e9 9d 8f 23 |..v..-.........#|
00000140 bf 3d bf b8 ed 85 34 85 31 15 dd 7a 36 f7 3e 0e |.=....4.1..z6.>.|
00000150 df e7 4c e8 ae 5a 98 05 f8 34 76 33 c3 4c 81 fb |..L..Z...4v3.L..|
00000160 d8 29 14 b3 47 32 eb 5f 73 5a 95 4a c7 3d 89 2a |.)..G2._sZ.J.=.*|
00000170 21 22 bd 97 b2 9d 4b dd 2c eb a5 e3 37 d6 a9 84 |!"....K.,...7...|
00000180 0c b6 02 2f 1f 5c 18 1b be 92 be 58 a7 e1 a0 49 |.../.\.....X...I|
00000190 95 dc d7 07 70 b1 5b 15 86 3f 55 fc ad 32 39 5d |....p.[..?U..29]|
000001a0 95 63 fd d4 85 55 b2 e9 c2 68 d0 09 f9 53 f9 4f |.c...U...h...S.O|
000001b0 0e 89 1c a0 85 74 7f 10 97 e7 86 8a 18 28 83 e6 |.....t.......(..|
000001c0 66 3c 2a f5 8f 14 1d 90 58 ef ad 1f d3 7f 42 0a |f<*.....X.....B.|
000001d0 08 d5 b4 96 b0 9d 3f 72 49 5a 06 13 7c 4b bc 79 |......?rIZ..|K.y|
000001e0 8c db 1f 1f 5e 3d c2 fe ad 57 e6 d9 14 bb d0 72 |....^=...W.....r|
000001f0 d7 90 14 35 ec 34 31 f6 fd b1 fd 3d 46 6e 4f a7 |...5.41....=FnO.|
00000200 1e 7d 14 40 17 0c ef c0 c8 70 fe dc 6a f1 78 6a |.}.@.....p..j.xj|
00000210 c6 df 70 2e ac 07 d9 6d f7 90 0e 4a 92 08 cf 88 |..p....m...J....|
00000220 26 c0 11 4a 7d e4 34 ba 86 43 cb 94 f8 d7 61 5a |&..J}.4..C....aZ|
00000230 05 f5 f9 49 b4 04 f1 c8 43 b6 12 52 ae cf 7c b9 |...I....C..R..|.|
00000240 39 d1 90 91 6e 80 43 cf 4c 23 3d 7c c0 c8 88 46 |9...n.C.L#=|...F|
00000250 e2 91 86 e4 41 cb ed f2 3a 92 01 9f 04 7c d2 81 |....A...:....|..|
00000260 42 18 6c 04 91 25 8a 29 0e d9 23 aa 58 e5 e8 ee |B.l..%.)..#.X...|
00000270 39 79 a5 a7 3a 4d e3 cc 15 79 3f 7b f9 e4 21 76 |9y..:M...y?{..!v|
00000280 5c 9a d8 de d3 9a f3 9e 69 44 c0 2a 56 04 b4 d2 |\.......iD.*V...|
00000290 c3 c1 4c d6 ad b8 d8 ad c8 c2 0d fa ea e1 bc 11 |..L.............|
000002a0 67 15 80 ef c6 01 48 7f de f1 c2 36 a7 dd a9 38 |g.....H....6...8|
000002b0 31 8b 14 ed 5c 2a 66 55 3b 25 e3 85 cb d9 a9 82 |1...\*fU;%......|
000002c0 7a 95 99 b3 c8 aa ac 66 30 b0 c5 3d d1 2a ab b9 |z......f0..=.*..|
000002d0 56 b3 5e 9d e0 d7 81 ac 6f 2e ae 62 a2 ef ca ef |V.^.....o..b....|
000002e0 7b cf 0f af f6 0b 29 97 2d 27 33 58 ad b6 1b d2 |{.....).-'3X....|
000002f0 0a c7 11 ec 89 b0 0d 2e ff 27 64 c2 bf 8e 85 a4 |.........'d.....|
00000300 ea 14 52 71 55 1a ec ef 0d ff 14 00 ce 3d 9d 3d |..RqU........=.=|
00000310 a9 d3 17 17 03 03 00 99 5e ba 1f f3 93 71 7a 88 |........^....qz.|
00000320 bc 14 71 7e 85 15 c9 da fe ee c1 b1 3d f6 ff 67 |..q~........=..g|
00000330 fd 28 96 f3 44 44 6f 8f 32 b4 22 be 69 29 e6 dd |.(..DDo.2.".i)..|
00000340 60 07 1d 98 0b 0c 0f ec df fa 46 c0 67 66 f2 18 |`.........F.gf..|
00000350 bf 5e 36 56 b2 b2 25 ef aa 76 51 ea f7 47 1d ee |.^6V..%..vQ..G..|
00000360 7b 25 e5 97 89 4a 04 07 f8 ff 05 73 25 71 e4 28 |{%...J.....s%q.(|
00000370 9e 91 45 ff 4c df 82 dc 85 16 02 ba 15 9b 37 91 |..E.L.........7.|
00000380 eb 65 12 66 38 59 8a 85 a2 2e af 2f d7 74 75 c1 |.e.f8Y...../.tu.|
00000390 7e f6 64 87 7e 4c 86 c8 25 bb 59 8d f8 9c e3 e5 |~.d.~L..%.Y.....|
000003a0 a4 53 a5 c6 00 bd 78 d8 07 0e f5 42 92 e3 42 11 |.S....x....B..B.|
000003b0 57 17 03 03 00 45 77 98 db b2 e4 66 e3 dc 3e 4f |W....Ew....f..>O|
000003c0 49 92 b3 ac 74 cd 1c 3b e2 81 3c 64 0b a5 c9 8c |I...t..;..<d....|
000003d0 7e 9a 22 9f df 7e e8 68 99 56 93 49 d5 81 3f c1 |~."..~.h.V.I..?.|
000003e0 de 00 07 bd 6e ba 25 00 63 f0 82 41 46 ba 04 b7 |....n.%.c..AF...|
000003f0 1f 37 aa 1c f6 49 8f e6 83 e8 23 |.7...I....#|
>>> Flow 3 (client to server)
00000000 14 03 03 00 01 01 17 03 03 00 45 8c 37 d5 7e 3e |..........E.7.~>|
00000010 c4 24 64 8b fa fc 8d 03 a7 92 34 35 c3 2c f2 54 |.$d.......45.,.T|
00000020 43 06 5d 8a c9 c0 e8 7d 22 d3 99 58 01 0e 44 aa |C.]....}"..X..D.|
00000030 3c 26 eb 68 45 14 cd bf 6c 61 bb 31 91 9d b4 57 |<&.hE...la.1...W|
00000040 42 79 14 8c 67 c6 65 52 15 07 c8 f3 c3 9f 23 ef |By..g.eR......#.|
00000050 17 03 03 00 17 21 51 dd 67 e4 be f8 7c 7b 84 0d |.....!Q.g...|{..|
00000060 78 3c 7f ac 50 f8 34 7b fb 38 09 d0 17 03 03 00 |x<..P.4{.8......|
00000070 13 35 1a 52 9d de 4a 74 1f 01 70 de 05 c5 c3 b9 |.5.R..Jt..p.....|
00000080 e6 de 9c 0f |....|
00000000 14 03 03 00 01 01 17 03 03 00 45 75 66 f7 1c cc |..........Euf...|
00000010 a5 d2 e0 60 37 ff ab 89 16 88 c1 27 ba 57 0c 0d |...`7......'.W..|
00000020 28 c9 c3 8a 53 57 05 1c 2a 47 52 b6 98 f9 26 4f |(...SW..*GR...&O|
00000030 34 7c 7a 71 00 87 47 c3 a5 b8 0c 8c 03 87 5e de |4|zq..G.......^.|
00000040 a1 40 33 9b e1 7f ad 36 71 10 9a e7 28 45 e1 e2 |.@3....6q...(E..|
00000050 17 03 03 00 17 a3 83 88 cd fa fc f4 60 12 e7 be |............`...|
00000060 8d 11 31 74 3f 25 3e 32 6f 7f 73 57 17 03 03 00 |..1t?%>2o.sW....|
00000070 13 7f ab 29 bc f6 7e ea f7 17 ee 7a ef 38 ff bc |...)..~....z.8..|
00000080 82 68 f5 07 |.h..|