crypto/tls: add support for AES_256_GCM_SHA384 cipher suites specified in RFC5289

Generalizes PRF calculation for TLS 1.2 to support arbitrary hashes (SHA-384 instead of SHA-256).
Testdata were all updated to correspond with the new cipher suites in the handshake.

Change-Id: I3d9fc48c19d1043899e38255a53c80dc952ee08f
Reviewed-on: https://go-review.googlesource.com/3265
Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
Jacob H. Haven 2015-02-03 16:15:18 -08:00 committed by Adam Langley
parent 531f0d0055
commit 01861d435c
31 changed files with 1185 additions and 968 deletions

View file

@ -1,18 +1,18 @@
>>> Flow 1 (client to server)
00000000 16 03 01 00 75 01 00 00 71 03 03 00 00 00 00 00 |....u...q.......|
00000000 16 03 01 00 79 01 00 00 75 03 03 00 00 00 00 00 |....y...u.......|
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 1a c0 2f |.............../|
00000030 c0 2b c0 11 c0 07 c0 13 c0 09 c0 14 c0 0a 00 05 |.+..............|
00000040 00 2f 00 35 c0 12 00 0a 01 00 00 2e 00 05 00 05 |./.5............|
00000050 01 00 00 00 00 00 0a 00 08 00 06 00 17 00 18 00 |................|
00000060 19 00 0b 00 02 01 00 00 0d 00 0a 00 08 04 01 04 |................|
00000070 03 02 01 02 03 ff 01 00 01 00 |..........|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 1e c0 2f |.............../|
00000030 c0 2b c0 30 c0 2c c0 11 c0 07 c0 13 c0 09 c0 14 |.+.0.,..........|
00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 2e |...../.5........|
00000050 00 05 00 05 01 00 00 00 00 00 0a 00 08 00 06 00 |................|
00000060 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0a 00 |................|
00000070 08 04 01 04 03 02 01 02 03 ff 01 00 01 00 |..............|
>>> Flow 2 (server to client)
00000000 16 03 02 00 59 02 00 00 55 03 02 53 04 f1 02 1c |....Y...U..S....|
00000010 d1 1c 6a 5f 7a 5c 26 69 92 cd ee c3 57 ed 96 90 |..j_z\&i....W...|
00000020 e3 c5 f1 ee 8b ee 99 5f 46 2c e6 20 c8 50 6a a4 |......._F,. .Pj.|
00000030 4b 93 e6 da ba 6d d4 87 f6 75 a8 9d 44 db b5 43 |K....m...u..D..C|
00000040 df 12 57 de a4 f1 bc fb b8 7a 3f 6a c0 09 00 00 |..W......z?j....|
00000000 16 03 02 00 59 02 00 00 55 03 02 48 99 38 25 1c |....Y...U..H.8%.|
00000010 df 79 d9 78 68 90 92 ad 3f e7 a0 38 b2 d8 ab 50 |.y.xh...?..8...P|
00000020 2c fb b0 16 00 5a 5c 87 a6 dc 16 20 70 3f 2a fd |,....Z\.... p?*.|
00000030 ef 14 aa 68 d5 08 c4 1e 4c 04 7a 08 63 ec cb 0d |...h....L.z.c...|
00000040 1f 2b 08 17 f2 29 7c da a3 d0 6f 07 c0 09 00 00 |.+...)|...o.....|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 02 02 0e 0b 00 02 0a 00 02 07 00 02 04 30 82 02 |.............0..|
00000070 00 30 82 01 62 02 09 00 b8 bf 2d 47 a0 d2 eb f4 |.0..b.....-G....|
@ -47,21 +47,21 @@
00000240 13 83 0d 94 06 bb d4 37 7a f6 ec 7a c9 86 2e dd |.......7z..z....|
00000250 d7 11 69 7f 85 7c 56 de fb 31 78 2b e4 c7 78 0d |..i..|V..1x+..x.|
00000260 ae cb be 9e 4e 36 24 31 7b 6a 0f 39 95 12 07 8f |....N6$1{j.9....|
00000270 2a 16 03 02 00 d4 0c 00 00 d0 03 00 17 41 04 7b |*............A.{|
00000280 c4 00 37 35 51 de c3 f2 a4 95 2c 19 21 3e a6 94 |..75Q.....,.!>..|
00000290 7b fd 04 d7 b7 1c 56 e6 af 3c ee 36 cb 55 e6 f0 |{.....V..<.6.U..|
000002a0 e6 24 34 6b 8a 02 66 71 f9 e2 f5 a6 c9 d7 6c dc |.$4k..fq......l.|
000002b0 65 59 ff 1c c9 ec a9 8b 07 d6 52 2c 01 3c c3 00 |eY........R,.<..|
000002c0 89 30 81 86 02 41 74 89 1a 31 72 e6 8b c0 4a ce |.0...At..1r...J.|
000002d0 8f 5a 49 a7 52 2d 6d b9 8b 50 17 62 2a 99 d6 3b |.ZI.R-m..P.b*..;|
000002e0 02 85 41 4d 34 53 b5 09 bd e3 ac 16 c1 9b e9 83 |..AM4S..........|
000002f0 cc 83 e3 9c 23 34 67 71 72 d4 05 a2 34 f7 08 29 |....#4gqr...4..)|
00000300 62 43 2e cc bc 08 01 02 41 59 de 5a d0 dd d7 6b |bC......AY.Z...k|
00000310 db 9c 35 29 79 f8 96 91 56 74 1f 18 7b ee 25 83 |..5)y...Vt..{.%.|
00000320 f2 37 0e 77 ab 38 fb 5e 04 0b 09 d9 b4 1f 3f be |.7.w.8.^......?.|
00000330 2e e3 60 e3 96 f3 29 c1 6d 8f 56 1b fd 62 14 48 |..`...).m.V..b.H|
00000340 e3 d9 2a ea 2f be 93 d0 8b 31 16 03 02 00 04 0e |..*./....1......|
00000350 00 00 00 |...|
00000270 2a 16 03 02 00 d6 0c 00 00 d2 03 00 17 41 04 5f |*............A._|
00000280 ea cb dd 6a 2c 16 40 15 d1 e7 ea 41 19 08 5d 1c |...j,.@....A..].|
00000290 e8 f2 f2 75 84 96 f5 d4 c8 5b fd 4b ba 3b 79 8c |...u.....[.K.;y.|
000002a0 86 a3 2a ce 77 2d 97 ea 39 3d 52 8e a4 c7 da bd |..*.w-..9=R.....|
000002b0 52 68 46 b4 f2 ba 1f 73 30 29 2f 29 d4 82 66 00 |RhF....s0)/)..f.|
000002c0 8b 30 81 88 02 42 00 c3 d3 8d 5e f9 a8 03 27 d8 |.0...B....^...'.|
000002d0 be 19 80 53 8e 5a 58 4f 13 2a 04 25 8c 73 71 9a |...S.ZXO.*.%.sq.|
000002e0 15 7e 05 09 d4 a2 8d 3e 16 0e 2d a8 73 97 bc 1a |.~.....>..-.s...|
000002f0 b4 48 81 f0 c9 2a e7 c2 39 13 5d 25 3e b1 82 d1 |.H...*..9.]%>...|
00000300 cf 3e 46 f5 f6 f8 e3 e2 02 42 01 a2 ba f5 05 eb |.>F......B......|
00000310 84 26 34 06 f2 85 ae e0 54 95 cd f9 8a 2e 01 a5 |.&4.....T.......|
00000320 65 d0 ab da cd ec 33 7a 12 51 1c 75 3f 4f be 7f |e.....3z.Q.u?O..|
00000330 f7 a6 02 81 2e 6d 3b 58 d6 5f 2d 53 d0 43 61 2d |.....m;X._-S.Ca-|
00000340 0c d8 7d e5 08 48 48 da 51 47 8b a5 16 03 02 00 |..}..HH.QG......|
00000350 04 0e 00 00 00 |.....|
>>> Flow 3 (client to server)
00000000 16 03 02 00 46 10 00 00 42 41 04 1e 18 37 ef 0d |....F...BA...7..|
00000010 19 51 88 35 75 71 b5 e5 54 5b 12 2e 8f 09 67 fd |.Q.5uq..T[....g.|
@ -69,21 +69,21 @@
00000030 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000040 a6 b5 68 1a 41 03 56 6b dc 5a 89 14 03 02 00 01 |..h.A.Vk.Z......|
00000050 01 16 03 02 00 40 00 00 00 00 00 00 00 00 00 00 |.....@..........|
00000060 00 00 00 00 00 00 b6 98 a2 a9 48 34 12 6b 0a 94 |..........H4.k..|
00000070 89 fc 38 04 63 5a 6f 63 36 3e d9 35 12 64 8c 28 |..8.cZoc6>.5.d.(|
00000080 99 a6 cf 2e 57 e3 14 6d 0a 8a ab f0 a6 58 37 7c |....W..m.....X7||
00000090 96 04 d3 71 bc d4 |...q..|
00000060 00 00 00 00 00 00 20 a1 aa ad 8d db ed 19 63 64 |...... .......cd|
00000070 60 73 8a 59 0d 59 81 51 b8 44 7b c8 86 ac fe db |`s.Y.Y.Q.D{.....|
00000080 9f da 5e af fd 54 a3 6e c6 f0 d6 45 fe 93 70 f1 |..^..T.n...E..p.|
00000090 45 99 06 3e 6a 28 |E..>j(|
>>> Flow 4 (server to client)
00000000 14 03 02 00 01 01 16 03 02 00 40 c5 01 c9 0a b0 |..........@.....|
00000010 d8 ca 5e c1 19 dc 37 6c 2e a0 b3 11 a8 87 65 5a |..^...7l......eZ|
00000020 09 41 b9 fe 53 c4 c9 76 97 6d 7f ac c0 be d2 07 |.A..S..v.m......|
00000030 84 e5 5b 78 37 34 ee da 3b cb 3e 82 52 79 91 44 |..[x74..;.>.Ry.D|
00000040 b4 e4 1c ec 3a c0 c0 9d cd ff 13 |....:......|
00000000 14 03 02 00 01 01 16 03 02 00 40 b7 6f dc 1c 48 |..........@.o..H|
00000010 cc 3d ac 1d 6b b2 bc 9c dd 25 02 9d b0 77 8d ca |.=..k....%...w..|
00000020 5a 4c d6 d3 c0 e0 a6 8c 03 00 e5 85 3a 2f 5e df |ZL..........:/^.|
00000030 17 5b 9a 2e e3 54 20 60 fe 39 ef 51 23 bc 13 ea |.[...T `.9.Q#...|
00000040 86 6f 4f e5 8c 5f a0 3e ae e9 69 |.oO.._.>..i|
>>> Flow 5 (client to server)
00000000 17 03 02 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
00000010 00 00 00 00 00 46 60 13 39 2b 2f 72 95 ed 0e aa |.....F`.9+/r....|
00000020 69 6e b4 64 3e 83 43 d0 f9 7f 37 7c 1d b9 ce 11 |in.d>.C...7|....|
00000030 d9 41 66 60 6d 15 03 02 00 30 00 00 00 00 00 00 |.Af`m....0......|
00000040 00 00 00 00 00 00 00 00 00 00 b1 26 d0 5d 08 98 |...........&.]..|
00000050 eb 28 42 74 31 58 42 95 c5 ad 1a 92 0a f5 5f ed |.(Bt1XB......._.|
00000060 45 98 e0 90 e5 a3 b6 8b 8d 18 |E.........|
00000010 00 00 00 00 00 31 e9 1b b8 b7 ed a1 dd 34 87 9c |.....1.......4..|
00000020 3c 8a 0d 41 8c d3 3f 0e 54 62 d5 31 07 4a a5 8f |<..A..?.Tb.1.J..|
00000030 0e 07 3d da 91 15 03 02 00 30 00 00 00 00 00 00 |..=......0......|
00000040 00 00 00 00 00 00 00 00 00 00 d2 62 91 56 10 c8 |...........b.V..|
00000050 c9 f8 25 3f ef ab b1 a7 88 a6 85 2b 1b 02 47 36 |..%?.......+..G6|
00000060 3a 08 b0 63 da c1 cb ea 11 2c |:..c.....,|