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 03 00 59 02 00 00 55 03 03 2d 12 aa 2a 67 |....Y...U..-..*g|
00000010 e1 6c 55 dc 1c 0b 3f 94 39 7a 2f e3 4e d4 85 cb |.lU...?.9z/.N...|
00000020 31 ff da 09 dd e0 92 75 6c e8 0b 20 e1 e7 fc 09 |1......ul.. ....|
00000030 bd 12 b8 5c b2 54 75 01 7a f5 65 95 d7 87 66 77 |...\.Tu.z.e...fw|
00000040 03 1f 25 23 cb 39 9f 47 2b 5c fd bd c0 30 00 00 |..%#.9.G+\...0..|
00000000 16 03 03 00 59 02 00 00 55 03 03 45 6f 12 3b 7d |....Y...U..Eo.;}|
00000010 30 71 fe ad ab 43 21 b1 68 78 42 2e cb b9 44 c9 |0q...C!.hxB...D.|
00000020 93 0a f3 4a dc f6 b1 a1 fe e3 22 20 1b 24 38 d4 |...J......" .$8.|
00000030 5c 84 2e c7 63 c1 a4 84 ca b6 2a 6c b3 90 04 9e |\...c.....*l....|
00000040 7e a6 60 d7 1d 76 26 2f 68 12 59 a3 c0 30 00 00 |~.`..v&/h.Y..0..|
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
00000060 03 02 be 0b 00 02 ba 00 02 b7 00 02 b4 30 82 02 |.............0..|
00000070 b0 30 82 02 19 a0 03 02 01 02 02 09 00 85 b0 bb |.0..............|
@ -58,20 +59,20 @@
000002f0 5f 33 c4 b6 d8 c9 75 90 96 8c 0f 52 98 b5 cd 98 |_3....u....R....|
00000300 1f 89 20 5f f2 a0 1c a3 1b 96 94 dd a9 fd 57 e9 |.. _..........W.|
00000310 70 e8 26 6d 71 99 9b 26 6e 38 50 29 6c 90 a7 bd |p.&mq..&n8P)l...|
00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 99 |.............A..|
00000330 91 58 07 9b 2b 79 26 ad cb 37 07 5e f3 e3 75 81 |.X..+y&..7.^..u.|
00000340 32 50 39 59 a4 7c c0 b8 c2 f4 16 de dc c3 9f ba |2P9Y.|..........|
00000350 04 42 a4 15 9c 8f 4e da 35 88 fc e5 b1 03 70 85 |.B....N.5.....p.|
00000360 64 a3 6e 59 15 8c 92 11 4c 10 d9 90 f4 a9 9b 04 |d.nY....L.......|
00000370 01 00 80 4e d1 02 4d d0 a7 7d 01 42 7a b6 75 ed |...N..M..}.Bz.u.|
00000380 ea 10 a3 66 a2 35 94 2d 2d 7a 32 55 63 23 df 8c |...f.5.--z2Uc#..|
00000390 9e ec d2 19 df bb e0 02 70 c0 50 4f 05 d8 ec 1c |........p.PO....|
000003a0 40 a1 a5 ae 2c 80 5b 6f b1 f9 f9 74 20 dc 4f d7 |@...,.[o...t .O.|
000003b0 23 b3 25 61 a7 5e 76 37 a7 17 f3 54 47 08 d9 2c |#.%a.^v7...TG..,|
000003c0 fb ea 4f 56 51 ee 5c cc 2f 4d 80 66 7b 21 78 1d |..OVQ.\./M.f{!x.|
000003d0 ef a0 71 96 cc 3d 09 8e 37 fd bc 9f 26 be 75 48 |..q..=..7...&.uH|
000003e0 b2 a1 39 0e b3 d3 73 f5 f1 68 4f aa 03 92 c0 1f |..9...s..hO.....|
000003f0 90 74 a9 16 03 03 00 2e 0d 00 00 26 03 01 02 40 |.t.........&...@|
00000320 d9 16 03 03 00 cd 0c 00 00 c9 03 00 17 41 04 a9 |.............A..|
00000330 2e 21 28 57 be bc 41 fd 5b a8 fa e2 d9 9d d5 47 |.!(W..A.[......G|
00000340 08 f2 68 6c 30 3f da 1c be 40 71 7f 1d 45 a6 24 |..hl0?...@q..E.$|
00000350 73 42 86 16 f8 16 3b 12 87 90 19 dd 03 3a 9a 45 |sB....;......:.E|
00000360 ac ad ce 9f fc 22 8d 1f e7 3e b2 ba 62 29 90 04 |....."...>..b)..|
00000370 01 00 80 a0 41 e8 bf 28 94 15 fa 7b 2c aa 42 08 |....A..(...{,.B.|
00000380 e8 e0 20 5e e0 9b 86 92 c7 f4 78 ce 9a 72 49 19 |.. ^......x..rI.|
00000390 45 cb ed 4f 23 11 3d a2 9a 9e f3 80 47 d3 16 96 |E..O#.=.....G...|
000003a0 ea 91 8d 62 91 5c b6 04 46 7f d5 06 d3 8f 4d f8 |...b.\..F.....M.|
000003b0 77 ae ee c4 42 b6 44 db cd cf 76 aa 5b 3c b0 93 |w...B.D...v.[<..|
000003c0 6d 2d 51 53 f8 f4 c5 3e ba 9c 8f 35 95 7c 87 33 |m-QS...>...5.|.3|
000003d0 95 0b 69 be 33 c0 a9 b7 f7 a8 de ae 1c 95 3a c1 |..i.3.........:.|
000003e0 11 55 4e f6 82 6d 25 d7 96 e5 fd ab cc 72 58 5b |.UN..m%......rX[|
000003f0 6e 12 4c 16 03 03 00 2e 0d 00 00 26 03 01 02 40 |n.L........&...@|
00000400 00 1e 06 01 06 02 06 03 05 01 05 02 05 03 04 01 |................|
00000410 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 03 |................|
00000420 00 00 0e 00 00 00 |......|
@ -113,26 +114,26 @@
00000220 a7 24 20 3e b2 56 1c ce 97 28 5e f8 2b 2d 4f 9e |.$ >.V...(^.+-O.|
00000230 f1 07 9f 6c 4b 5b 83 56 e2 32 42 e9 58 b6 d7 49 |...lK[.V.2B.X..I|
00000240 a6 b5 68 1a 41 03 56 6b dc 5a 89 16 03 03 00 88 |..h.A.Vk.Z......|
00000250 0f 00 00 84 05 01 00 80 2c 1c b4 c4 d6 73 62 3a |........,....sb:|
00000260 86 37 c5 cb 3d 28 5f 3b 7f e2 08 f8 38 ef dc c4 |.7..=(_;....8...|
00000270 a9 13 b6 82 28 0a 3a 67 48 01 c7 54 1d 4f b4 b4 |....(.:gH..T.O..|
00000280 4e a8 5b fc b6 9b 27 7c e3 a6 d7 88 62 2d 2c ca |N.[...'|....b-,.|
00000290 35 55 b3 99 ac 4e 28 45 55 29 3e 30 fc 46 6b 86 |5U...N(EU)>0.Fk.|
000002a0 20 0b b1 d0 7c c5 07 cd d8 49 5a 88 dd c2 bc 5d | ...|....IZ....]|
000002b0 5f ad 52 d8 be 56 e4 fd f8 ab ef 17 04 08 50 a5 |_.R..V........P.|
000002c0 2f 52 58 e5 31 51 e4 83 44 41 c0 8e 16 cf 39 4f |/RX.1Q..DA....9O|
000002d0 3d de c8 19 1e 5c c3 a7 14 03 03 00 01 01 16 03 |=....\..........|
000002e0 03 00 28 00 00 00 00 00 00 00 00 2c e0 65 72 59 |..(........,.erY|
000002f0 1e 0a ff 8b 58 74 14 c8 c5 fa db 08 06 4f a1 d4 |....Xt.......O..|
00000300 20 cc f4 3e 6a f5 5c 0f 8e 26 1d | ..>j.\..&.|
00000250 0f 00 00 84 05 01 00 80 38 ca f2 b9 60 19 01 9c |........8...`...|
00000260 ce 24 b2 10 54 62 0f a3 03 7a af 0d 64 aa e9 c9 |.$..Tb...z..d...|
00000270 d5 47 40 ec a6 44 b3 5a 97 73 2c e8 2b 17 e9 fb |.G@..D.Z.s,.+...|
00000280 2b 87 4b cc 80 ee 8a 88 35 c2 4f 2f e7 f0 1e c7 |+.K.....5.O/....|
00000290 c6 40 6b f8 c5 71 83 2b c0 8e 41 62 3f 3a 80 96 |.@k..q.+..Ab?:..|
000002a0 71 a5 25 50 d3 4e 01 86 ff 1f d3 a0 a8 23 ef 80 |q.%P.N.......#..|
000002b0 3a 79 77 d6 88 5f 70 a2 98 7a 0a 71 1e 9b 81 5d |:yw.._p..z.q...]|
000002c0 14 61 ac 2f 96 22 49 18 57 47 42 cf 2d 6f c3 8b |.a./."I.WGB.-o..|
000002d0 95 24 24 87 75 4e 52 28 14 03 03 00 01 01 16 03 |.$$.uNR(........|
000002e0 03 00 28 00 00 00 00 00 00 00 00 4b 1b ec 28 3a |..(........K..(:|
000002f0 02 86 9e 52 29 d1 73 ce 60 eb 80 92 0a 1a bc 07 |...R).s.`.......|
00000300 14 15 98 1e f7 98 d1 28 eb b7 43 |.......(..C|
>>> Flow 4 (server to client)
00000000 14 03 03 00 01 01 16 03 03 00 28 59 f7 e1 f5 7c |..........(Y...||
00000010 ef 54 7c ee 08 29 50 82 d2 43 32 f5 c1 bc af 0c |.T|..)P..C2.....|
00000020 5f 4f 6e 9a fd 65 8c 4d ef c4 0e ec 6a ea 46 73 |_On..e.M....j.Fs|
00000030 e2 9f 4a |..J|
00000000 14 03 03 00 01 01 16 03 03 00 28 c3 0d 76 f6 6c |..........(..v.l|
00000010 2f 07 ca 24 51 2d 2b f3 92 72 82 49 79 70 a8 e9 |/..$Q-+..r.Iyp..|
00000020 38 99 cf 1b ff 6c 7a 83 7c b0 3b f6 a5 f6 21 db |8....lz.|.;...!.|
00000030 56 1e 7c |V.||
>>> Flow 5 (client to server)
00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 4d b2 6d |.............M.m|
00000010 73 75 d3 68 3d a5 7c 98 32 3f b2 4a 47 3f b2 95 |su.h=.|.2?.JG?..|
00000020 8f cd 99 15 03 03 00 1a 00 00 00 00 00 00 00 02 |................|
00000030 91 31 70 57 68 0a e1 e1 1b ca f0 62 ab 22 da 3d |.1pWh......b.".=|
00000040 e1 64 |.d|
00000000 17 03 03 00 1e 00 00 00 00 00 00 00 01 00 9f 31 |...............1|
00000010 ad 88 20 ee 78 04 8c 11 dc dd cb 50 f6 8b d7 fb |.. .x......P....|
00000020 2e 22 c2 15 03 03 00 1a 00 00 00 00 00 00 00 02 |."..............|
00000030 e5 ab e8 1a 4e 58 d7 b1 eb 61 10 a8 5a be f5 2e |....NX...a..Z...|
00000040 f5 ae |..|