crypto/tls: add support for Certificate Transparency

This change adds support for serving and receiving Signed Certificate
Timestamps as described in RFC 6962.

The server is now capable of serving SCTs listed in the Certificate
structure. The client now asks for SCTs and, if any are received,
they are exposed in the ConnectionState structure.

Fixes #10201

Change-Id: Ib3adae98cb4f173bc85cec04d2bdd3aa0fec70bb
Reviewed-on: https://go-review.googlesource.com/8988
Reviewed-by: Adam Langley <agl@golang.org>
Run-TryBot: Adam Langley <agl@golang.org>
Reviewed-by: Jonathan Rudenberg <jonathan@titanous.com>
This commit is contained in:
Jonathan Rudenberg 2015-04-16 14:59:22 -04:00 committed by Adam Langley
parent 06b29738e8
commit cf04082452
31 changed files with 1106 additions and 779 deletions

View file

@ -1,18 +1,19 @@
>>> Flow 1 (client to server)
00000000 16 03 01 00 79 01 00 00 75 03 03 00 00 00 00 00 |....y...u.......|
00000000 16 03 01 00 7d 01 00 00 79 03 03 00 00 00 00 00 |....}...y.......|
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 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........|
00000040 c0 0a 00 05 00 2f 00 35 c0 12 00 0a 01 00 00 32 |...../.5.......2|
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 |..............|
00000070 08 04 01 04 03 02 01 02 03 ff 01 00 01 00 00 12 |................|
00000080 00 00 |..|
>>> Flow 2 (server to client)
00000000 16 03 01 00 51 02 00 00 4d 03 01 ba 22 84 d4 ec |....Q...M..."...|
00000010 cb 49 cc 28 17 ea 00 19 6f 89 6f 4a c7 36 32 f2 |.I.(....o.oJ.62.|
00000020 db da de 60 a7 93 b9 4e 64 9e ee 20 48 76 9f d5 |...`...Nd.. Hv..|
00000030 c9 8a 74 95 ef 4b 7c 92 fd da 04 88 76 d3 6f 5a |..t..K|.....v.oZ|
00000040 b5 7f fa f3 3a d0 c3 b2 b1 19 09 a6 00 05 00 00 |....:...........|
00000000 16 03 01 00 51 02 00 00 4d 03 01 36 ad 48 bc e4 |....Q...M..6.H..|
00000010 9e 09 3e 1f 02 c6 4d 8a 44 c4 8c 17 9f 85 7e 99 |..>...M.D.....~.|
00000020 72 d4 aa d1 2a 0b 74 bf 37 59 b2 20 86 a4 23 d8 |r...*.t.7Y. ..#.|
00000030 e1 66 16 72 87 ad b5 c8 58 05 a8 c2 6c 4e eb 3c |.f.r....X...lN.<|
00000040 1c fb 5e 61 34 6e 0b d5 c7 ce 4d 83 00 05 00 00 |..^a4n....M.....|
00000050 05 ff 01 00 01 00 16 03 01 02 be 0b 00 02 ba 00 |................|
00000060 02 b7 00 02 b4 30 82 02 b0 30 82 02 19 a0 03 02 |.....0...0......|
00000070 01 02 02 09 00 85 b0 bb a4 8a 7f b8 ca 30 0d 06 |.............0..|
@ -101,24 +102,24 @@
00000260 e6 bd 77 82 6f 23 b6 e0 bd a2 92 b7 3a ac e8 56 |..w.o#......:..V|
00000270 f1 af 54 5e 46 87 e9 3b 33 e7 b8 28 b7 d6 c8 90 |..T^F..;3..(....|
00000280 35 d4 1c 43 d1 30 6f 55 4e 0a 70 16 03 01 00 86 |5..C.0oUN.p.....|
00000290 0f 00 00 82 00 80 20 f0 61 14 6c 45 b1 29 c0 56 |...... .a.lE.).V|
000002a0 9d 26 45 01 50 d5 56 04 6d cd 66 79 81 e0 cf 5c |.&E.P.V.m.fy...\|
000002b0 ee bc 39 f0 a1 a1 3a 43 9d 1f 8f a2 52 6e 5c 77 |..9...:C....Rn\w|
000002c0 90 2e b3 56 37 ec 78 bd 79 53 a2 a4 8e 7d 49 13 |...V7.x.yS...}I.|
000002d0 3a cb 88 0c d4 d8 9d d9 33 ef 47 dd d8 08 64 4a |:.......3.G...dJ|
000002e0 69 33 84 c4 c4 78 59 6b 84 50 70 2c d9 f8 8a 39 |i3...xYk.Pp,...9|
000002f0 37 78 3c b4 c3 70 73 8d ff aa be 8e 93 54 05 7d |7x<..ps......T.}|
00000300 a2 cd 8b ef 8c 8c 64 7a b3 2a af 3e 20 67 a1 7b |......dz.*.> g.{|
00000310 a3 07 3b f1 d3 88 14 03 01 00 01 01 16 03 01 00 |..;.............|
00000320 24 93 a0 0a 95 c2 ee 2c 4b 92 f2 09 e0 a6 80 c8 |$......,K.......|
00000330 95 fb b1 ef a0 41 bb 27 e6 ad c9 d2 11 29 8a e4 |.....A.'.....)..|
00000340 1e 9a d6 92 2b |....+|
00000290 0f 00 00 82 00 80 31 5d f2 d2 f9 c7 65 8a 70 7f |......1]....e.p.|
000002a0 ce fb b6 8e 0d ea 1b 9b 1c e2 81 e4 95 c1 09 71 |...............q|
000002b0 48 4b 0d 13 a0 98 2d 8e 13 5a 36 c7 62 a3 7c af |HK....-..Z6.b.|.|
000002c0 bb 2f d2 b1 df fd a6 8a 35 ab 3c c5 fb 11 72 14 |./......5.<...r.|
000002d0 7b ec 02 d8 34 ef fc b9 c2 03 70 1d 88 27 fb 54 |{...4.....p..'.T|
000002e0 a6 68 dc 3d f4 78 b9 a5 87 06 a7 a5 63 51 11 6f |.h.=.x......cQ.o|
000002f0 9b 31 aa 45 e0 cb bf ad 16 b9 4d e1 e8 41 18 12 |.1.E......M..A..|
00000300 12 e4 b5 2c 27 03 23 bb 70 cd f0 23 c5 3d 50 b9 |...,'.#.p..#.=P.|
00000310 06 2d 7d 9f 58 25 14 03 01 00 01 01 16 03 01 00 |.-}.X%..........|
00000320 24 b5 b9 40 ad b8 89 b9 22 61 12 4c 54 98 7b d5 |$..@...."a.LT.{.|
00000330 72 20 ca fb 73 a3 e0 cb 52 09 03 9f e4 93 09 28 |r ..s...R......(|
00000340 02 db 8a e7 12 |.....|
>>> Flow 4 (server to client)
00000000 14 03 01 00 01 01 16 03 01 00 24 a4 54 34 b8 11 |..........$.T4..|
00000010 2b ad bc 55 7d 8b 71 e3 c5 7a a1 9b 0b 7f c3 48 |+..U}.q..z.....H|
00000020 69 32 5a 8d 0a f4 43 a0 c6 b7 e8 7d a4 f4 62 |i2Z...C....}..b|
00000000 14 03 01 00 01 01 16 03 01 00 24 d1 cb e3 a0 b5 |..........$.....|
00000010 38 9e 39 4c b5 5f cd eb d8 4e 29 9e 7e cf fd dd |8.9L._...N).~...|
00000020 a8 f1 9e 03 64 61 e7 20 d2 6d fc 14 8d e1 d9 |....da. .m.....|
>>> Flow 5 (client to server)
00000000 17 03 01 00 1a 26 c4 9a 35 54 80 41 f6 28 6b 0e |.....&..5T.A.(k.|
00000010 d9 e2 3d 37 ad fa db 91 3b fc 1b 5b 82 da 72 15 |..=7....;..[..r.|
00000020 03 01 00 16 99 b3 54 b5 20 f4 3e bf e2 00 0e 4e |......T. .>....N|
00000030 2a 1e 37 55 56 c2 3b 30 62 20 |*.7UV.;0b |
00000000 17 03 01 00 1a f9 73 04 45 ca 7c 71 75 fe c2 8b |......s.E.|qu...|
00000010 41 09 ff 4b 79 2b ec b0 d3 ad f4 d9 8b 0c 70 15 |A..Ky+........p.|
00000020 03 01 00 16 4a 70 2a a1 2f 3c 1f 6f 23 15 35 a8 |....Jp*./<.o#.5.|
00000030 12 08 07 c1 0f f2 13 55 b4 d8 |.......U..|