crypto/tls: advertise support for SHA-512 signatures in 1.2

This is the equivalent change to 1c105980 but for SHA-512.

SHA-512 certificates are already supported by default since b53bb2ca,
but some servers will refuse connections if the algorithm is not
advertised in the overloaded signatureAndHash extension (see 09b238f1).

This required adding support for SHA-512 signatures on CertificateVerify
and ServerKeyExchange messages, because of said overloading.

Some testdata/Client-TLSv1{0,1} files changed because they send a 1.2
ClientHello even if the server picks a lower version.

Closes #22422

Change-Id: I16282d03a3040260d203711ec21e6b20a0e1e105
Reviewed-on: https://go-review.googlesource.com/74950
Run-TryBot: Filippo Valsorda <hi@filippo.io>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
Filippo Valsorda 2017-10-31 19:43:05 -04:00 committed by Adam Langley
parent 90f8fc90bd
commit ca44103d11
48 changed files with 1902 additions and 2108 deletions

View file

@ -1,20 +1,20 @@
>>> Flow 1 (client to server)
00000000 16 03 01 00 91 01 00 00 8d 03 03 00 00 00 00 00 |................|
00000000 16 03 01 00 95 01 00 00 91 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 2c cc a8 |.............,..|
00000030 cc a9 c0 2f c0 2b c0 30 c0 2c c0 27 c0 13 c0 23 |.../.+.0.,.'...#|
00000040 c0 09 c0 14 c0 0a 00 9c 00 9d 00 3c 00 2f 00 35 |...........<./.5|
00000050 c0 12 00 0a 00 05 c0 11 c0 07 01 00 00 38 00 05 |.............8..|
00000050 c0 12 00 0a 00 05 c0 11 c0 07 01 00 00 3c 00 05 |.............<..|
00000060 00 05 01 00 00 00 00 00 0a 00 0a 00 08 00 1d 00 |................|
00000070 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 0e 00 |................|
00000080 0c 04 01 04 03 05 01 05 03 02 01 02 03 ff 01 00 |................|
00000090 01 00 00 12 00 00 |......|
00000070 17 00 18 00 19 00 0b 00 02 01 00 00 0d 00 12 00 |................|
00000080 10 04 01 04 03 05 01 05 03 06 01 06 03 02 01 02 |................|
00000090 03 ff 01 00 01 00 00 12 00 00 |..........|
>>> Flow 2 (server to client)
00000000 16 03 03 00 59 02 00 00 55 03 03 cf 28 2c 3e 4f |....Y...U...(,>O|
00000010 da 6b ae 24 74 a9 91 c3 c5 55 4b ab ec 07 f8 cd |.k.$t....UK.....|
00000020 65 f8 fe 08 f6 9a 23 da 99 6c 5d 20 af 4a 1e 32 |e.....#..l] .J.2|
00000030 7b bd 3c 0b b1 14 66 a3 b7 2f a4 2a c3 43 c4 e0 |{.<...f../.*.C..|
00000040 c2 ad 78 b1 28 ab 51 06 1b 87 d2 75 c0 09 00 00 |..x.(.Q....u....|
00000000 16 03 03 00 59 02 00 00 55 03 03 3d c4 44 53 fd |....Y...U..=.DS.|
00000010 1d ce 32 ba 0a ba 77 43 7a ba d1 e1 5b 7d 78 d4 |..2...wCz...[}x.|
00000020 d3 29 5f e2 2b ab a1 e0 20 70 bd 20 4c 6b 28 a6 |.)_.+... p. Lk(.|
00000030 f0 d0 51 92 3d ed 65 5c bd 26 8f 81 93 14 b0 93 |..Q.=.e\.&......|
00000040 80 af ae f6 3c 59 1f 1c 65 45 f0 13 c0 09 00 00 |....<Y..eE......|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 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....|
@ -49,18 +49,18 @@
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 03 00 b7 0c 00 00 b3 03 00 1d 20 18 6f |*............ .o|
00000280 77 a5 2b 27 2c 52 fc 6c 8a 34 41 1c a8 c6 4f 90 |w.+',R.l.4A...O.|
00000290 a9 4b b7 e0 39 8b b1 f5 a6 15 4b 94 e8 2c 04 03 |.K..9.....K..,..|
000002a0 00 8b 30 81 88 02 42 00 dc 3a 14 a2 38 32 c1 40 |..0...B..:..82.@|
000002b0 98 83 17 94 e9 2a 0d 95 c3 59 d6 76 94 c2 3e a0 |.....*...Y.v..>.|
000002c0 f7 e0 5d 64 47 5a d1 d9 ed d2 1c 6b 13 3e e7 83 |..]dGZ.....k.>..|
000002d0 6e bb 53 33 03 7d 69 c6 8f 9d 98 d7 96 9c 73 e3 |n.S3.}i.......s.|
000002e0 12 bd 69 1f b1 d3 f4 25 d7 02 42 01 11 6d c8 53 |..i....%..B..m.S|
000002f0 9b bf f4 db ff 8a 00 82 93 f7 b5 bf c9 bb cd ec |................|
00000300 64 f8 d9 6d 36 0d f8 db ce 9d 65 a0 5e 5a e0 13 |d..m6.....e.^Z..|
00000310 ec 08 73 2c 3f 8c c6 5b 08 cc 0f 4a 7d 6b 5e 89 |..s,?..[...J}k^.|
00000320 bf 4a 4e db 51 5a 9f 51 3e 9d 9a c5 84 16 03 03 |.JN.QZ.Q>.......|
00000270 2a 16 03 03 00 b7 0c 00 00 b3 03 00 1d 20 b4 47 |*............ .G|
00000280 68 85 aa c9 1b 4f ac c6 c6 08 39 e2 91 a8 0f a7 |h....O....9.....|
00000290 26 d0 60 1a 68 62 7d 22 61 d2 66 1f 42 71 04 03 |&.`.hb}"a.f.Bq..|
000002a0 00 8b 30 81 88 02 42 00 86 22 15 eb 04 d8 98 69 |..0...B..".....i|
000002b0 71 75 c9 d7 17 61 d2 dc a7 2f 21 22 fd b9 da 6e |qu...a.../!"...n|
000002c0 b2 36 65 22 1a 20 c8 49 3e a6 2a e4 4e a1 93 8d |.6e". .I>.*.N...|
000002d0 47 59 42 4f 54 51 3f dd fc b9 b0 b4 fe d2 77 28 |GYBOTQ?.......w(|
000002e0 15 58 4f b5 f5 56 da b2 02 02 42 00 cb 0b 69 b7 |.XO..V....B...i.|
000002f0 1b 48 85 7e e3 bf be 27 64 c7 38 4d dc a1 49 73 |.H.~...'d.8M..Is|
00000300 ba f9 45 6b cc 95 d1 72 d8 45 9c 39 3d 3a 93 85 |..Ek...r.E.9=:..|
00000310 a7 22 20 c3 ce 48 e3 0d 31 9c f4 cf 2c dc d7 9d |." ..H..1...,...|
00000320 d3 b4 6a fe 98 31 d9 32 dc 37 1a c0 fa 16 03 03 |..j..1.2.7......|
00000330 00 2a 0d 00 00 26 03 01 02 40 00 1e 06 01 06 02 |.*...&...@......|
00000340 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 |................|
00000350 03 02 03 03 02 01 02 02 02 03 00 00 16 03 03 00 |................|
@ -101,32 +101,32 @@
00000200 e4 fa cc b1 8a ce e2 23 a0 87 f0 e1 67 51 eb 16 |.......#....gQ..|
00000210 03 03 00 25 10 00 00 21 20 2f e5 7d a3 47 cd 62 |...%...! /.}.G.b|
00000220 43 15 28 da ac 5f bb 29 07 30 ff f6 84 af c4 cf |C.(.._.).0......|
00000230 c2 ed 90 99 5f 58 cb 3b 74 16 03 03 00 93 0f 00 |...._X.;t.......|
00000240 00 8f 05 03 00 8b 30 81 88 02 42 01 32 6d 32 38 |......0...B.2m28|
00000250 d6 bd 1b b6 c5 80 f2 ea 60 b8 bf 3f b6 76 68 1b |........`..?.vh.|
00000260 66 fb 5d 69 0b 25 09 7f 2d 73 ad 7e cd 98 cb b5 |f.]i.%..-s.~....|
00000270 93 4e 4f 1c 4e 3f a1 39 cf a0 70 a6 3d 29 36 27 |.NO.N?.9..p.=)6'|
00000280 51 e0 55 95 11 df 00 88 6c 38 d6 de 36 02 42 01 |Q.U.....l8..6.B.|
00000290 67 50 81 90 a7 ae b5 e2 34 75 81 41 c2 71 8d 0c |gP......4u.A.q..|
000002a0 9a 20 e7 33 af 0e 61 48 85 51 a1 f7 90 17 d1 ad |. .3..aH.Q......|
000002b0 b3 e1 cf 3e 12 fc ce 39 16 a8 78 3b 69 0d 79 76 |...>...9..x;i.yv|
000002c0 03 17 75 c2 a0 63 5e dc 0a a7 c9 aa 15 2a 83 65 |..u..c^......*.e|
000002d0 df 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 |...........@....|
000002e0 00 00 00 00 00 00 00 00 00 00 00 00 27 da 48 f6 |............'.H.|
000002f0 d3 00 98 b9 a6 b7 41 0b eb e6 d1 d7 82 9a 0c 59 |......A........Y|
00000300 8a 42 1c 99 59 af da a7 5b 88 ab b6 7d 01 bc 0f |.B..Y...[...}...|
00000310 45 08 c4 05 0d 2a 4a 83 bf eb b1 b6 |E....*J.....|
00000230 c2 ed 90 99 5f 58 cb 3b 74 16 03 03 00 92 0f 00 |...._X.;t.......|
00000240 00 8e 06 03 00 8a 30 81 87 02 42 00 cb 61 7d bc |......0...B..a}.|
00000250 af 48 88 32 98 9b 34 a0 71 0e 3a 33 bd da 73 16 |.H.2..4.q.:3..s.|
00000260 05 f4 8e d8 30 11 c8 da dd 7a 84 80 57 a1 76 d8 |....0....z..W.v.|
00000270 af 3d 90 d7 e2 44 85 78 c4 12 ed 8d dc 4e 82 08 |.=...D.x.....N..|
00000280 51 20 59 d7 38 26 29 c9 2b 5b 77 fc d2 02 41 3b |Q Y.8&).+[w...A;|
00000290 70 99 7c 46 bf 8e 85 40 d7 75 c5 43 36 f8 e3 30 |p.|F...@.u.C6..0|
000002a0 28 ac 20 1e 79 43 b2 f3 6d b1 ae 6e cf 41 b5 ed |(. .yC..m..n.A..|
000002b0 76 2b d5 17 78 2c fa 91 75 ba 63 8f e9 1c c8 c0 |v+..x,..u.c.....|
000002c0 1e 02 63 70 53 41 e0 98 77 a5 ae 54 6a 74 c0 91 |..cpSA..w..Tjt..|
000002d0 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 00 |..........@.....|
000002e0 00 00 00 00 00 00 00 00 00 00 00 7d 12 bc ba f4 |...........}....|
000002f0 34 59 b7 c2 a9 5d 11 88 38 cc bc cc 1c 14 b7 5a |4Y...]..8......Z|
00000300 ae d8 0a 45 bc 61 b5 bc d6 8e c4 69 80 10 7a ea |...E.a.....i..z.|
00000310 07 f4 dc 1a c9 dc b8 90 66 6c bc |........fl.|
>>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 40 73 7c e6 43 b9 |..........@s|.C.|
00000010 47 85 1c 50 f1 cb a1 29 79 02 dd 13 85 2a d9 a2 |G..P...)y....*..|
00000020 07 50 e4 80 c4 7e 66 ee f2 1a 21 1d cd e4 ff 4a |.P...~f...!....J|
00000030 a4 61 9d b4 a1 26 88 72 20 2b 06 77 c3 8b 3b 21 |.a...&.r +.w..;!|
00000040 53 33 02 3d a2 06 77 3b a5 a6 0b |S3.=..w;...|
00000000 14 03 03 00 01 01 16 03 03 00 40 df ff fd 43 0b |..........@...C.|
00000010 d1 28 4b db ce 29 8b 01 56 e7 44 9d 69 92 e7 11 |.(K..)..V.D.i...|
00000020 7c 57 f2 a1 cf 35 d4 3a 8f 90 69 ce 80 4e 8b 6c ||W...5.:..i..N.l|
00000030 e9 eb 90 65 0e 89 49 20 41 ae 32 62 66 f4 aa 85 |...e..I A.2bf...|
00000040 cd ca f7 a2 37 8f ef 22 ab b6 7b |....7.."..{|
>>> Flow 5 (client to server)
00000000 17 03 03 00 30 00 00 00 00 00 00 00 00 00 00 00 |....0...........|
00000010 00 00 00 00 00 1a 45 68 03 9b f0 42 e4 21 5e d8 |......Eh...B.!^.|
00000020 98 d6 46 67 2b 93 80 92 1f 91 60 a3 05 04 1c a0 |..Fg+.....`.....|
00000030 1b a9 ce 45 03 15 03 03 00 30 00 00 00 00 00 00 |...E.....0......|
00000040 00 00 00 00 00 00 00 00 00 00 6b 23 42 c8 5c 29 |..........k#B.\)|
00000050 f5 1f 7c d5 80 c4 9f 6f 12 77 95 71 8f 82 f9 63 |..|....o.w.q...c|
00000060 07 2c 6d ed 6d c6 4f 90 50 a3 |.,m.m.O.P.|
00000010 00 00 00 00 00 76 a4 88 f6 fb 0a 0f 8d a6 1f e0 |.....v..........|
00000020 96 4d d0 93 30 c9 b6 27 1e 3c 87 d7 98 f9 d6 e9 |.M..0..'.<......|
00000030 96 f7 e0 af b6 15 03 03 00 30 00 00 00 00 00 00 |.........0......|
00000040 00 00 00 00 00 00 00 00 00 00 82 01 3b 93 6f 78 |............;.ox|
00000050 1b e8 b6 ed 45 11 85 26 0f 40 63 2a a6 c9 f8 7b |....E..&.@c*...{|
00000060 7f 01 42 6b c1 8b 4f c0 a6 b5 |..Bk..O...|