mirror of
https://github.com/refraction-networking/utls.git
synced 2025-04-03 20:17:36 +03:00
crypto/tls: add support for Ed25519 certificates in TLS 1.2 and 1.3
Support for Ed25519 certificates was added in CL 175478, this wires them up into the TLS stack according to RFC 8422 (TLS 1.2) and RFC 8446 (TLS 1.3). RFC 8422 also specifies support for TLS 1.0 and 1.1, and I initially implemented that, but even OpenSSL doesn't take the complexity, so I just dropped it. It would have required keeping a buffer of the handshake transcript in order to do the direct Ed25519 signatures. We effectively need to support TLS 1.2 because it shares ClientHello signature algorithms with TLS 1.3. While at it, reordered the advertised signature algorithms in the rough order we would want to use them, also based on what curves have fast constant-time implementations. Client and client auth tests changed because of the change in advertised signature algorithms in ClientHello and CertificateRequest. Fixes #25355 Change-Id: I9fdd839afde4fd6b13fcbc5cc7017fd8c35085ee Reviewed-on: https://go-review.googlesource.com/c/go/+/177698 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Adam Langley <agl@golang.org>
This commit is contained in:
parent
6c11745f0b
commit
28958b0da6
84 changed files with 4977 additions and 3938 deletions
100
testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA
vendored
100
testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA
vendored
|
@ -1,5 +1,5 @@
|
|||
>>> Flow 1 (client to server)
|
||||
00000000 16 03 01 00 f8 01 00 00 f4 03 03 00 00 00 00 00 |................|
|
||||
00000000 16 03 01 00 fa 01 00 00 f6 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,20 +7,20 @@
|
|||
00000050 cc a9 c0 2f c0 2b c0 30 c0 2c c0 27 c0 13 c0 23 |.../.+.0.,.'...#|
|
||||
00000060 c0 09 c0 14 c0 0a 00 9c 00 9d 00 3c 00 2f 00 35 |...........<./.5|
|
||||
00000070 c0 12 00 0a 00 05 c0 11 c0 07 13 01 13 03 13 02 |................|
|
||||
00000080 01 00 00 79 00 05 00 05 01 00 00 00 00 00 0a 00 |...y............|
|
||||
00000080 01 00 00 7b 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 18 00 16 08 04 08 05 08 06 04 01 04 |................|
|
||||
000000b0 03 05 01 05 03 06 01 06 03 02 01 02 03 ff 01 00 |................|
|
||||
000000c0 01 00 00 12 00 00 00 2b 00 09 08 03 04 03 03 03 |.......+........|
|
||||
000000d0 02 03 01 00 33 00 26 00 24 00 1d 00 20 2f e5 7d |....3.&.$... /.}|
|
||||
000000e0 a3 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 |.G.bC.(.._.).0..|
|
||||
000000f0 84 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 |........_X.;t|
|
||||
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|
|
||||
>>> Flow 2 (server to client)
|
||||
00000000 16 03 03 00 59 02 00 00 55 03 03 8d 42 b5 ca 09 |....Y...U...B...|
|
||||
00000010 22 3a a8 c0 09 57 81 1c e9 40 20 14 a6 b5 6d c7 |":...W...@ ...m.|
|
||||
00000020 2a 62 69 7f 5f a8 e2 74 d5 c1 b0 20 9a bf c7 2c |*bi._..t... ...,|
|
||||
00000030 b9 1b d5 45 8a a1 49 fa 0f 3b d2 74 da 6f ef 6a |...E..I..;.t.o.j|
|
||||
00000040 87 75 9a be 04 8a 9e ef 7e ea d7 16 c0 09 00 00 |.u......~.......|
|
||||
00000000 16 03 03 00 59 02 00 00 55 03 03 08 a4 b1 ad 21 |....Y...U......!|
|
||||
00000010 3a 60 7a d3 3b 60 67 48 5d de da ff 3f a8 55 a9 |:`z.;`gH]...?.U.|
|
||||
00000020 c4 72 69 32 12 c1 d1 4e d4 78 e1 20 6e 9f ed 1e |.ri2...N.x. n...|
|
||||
00000030 50 9a 31 e2 ae e2 6a f4 01 cc 94 21 25 73 f3 a5 |P.1...j....!%s..|
|
||||
00000040 f6 28 b3 c6 6b c1 b3 2d fc 0c d3 66 c0 09 00 00 |.(..k..-...f....|
|
||||
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....|
|
||||
|
@ -55,18 +55,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 1c 45 |*............ .E|
|
||||
00000280 5f 18 e9 5f 2f 0d 3b 3f f2 a8 dc f8 15 1c 03 e4 |_.._/.;?........|
|
||||
00000290 c1 fa f8 f7 75 cb 74 17 cd 82 7d 26 8e 41 04 03 |....u.t...}&.A..|
|
||||
000002a0 00 8b 30 81 88 02 42 01 6c ae 9f 61 16 bb 03 50 |..0...B.l..a...P|
|
||||
000002b0 52 94 7f 89 59 92 a5 3e 74 54 97 7a f0 22 a5 7d |R...Y..>tT.z.".}|
|
||||
000002c0 de 80 c4 6a 0d a0 cb 50 e1 aa 27 a9 44 4f 24 db |...j...P..'.DO$.|
|
||||
000002d0 69 b2 d2 6c 6e 26 79 99 d8 31 9d 2d 47 26 f1 c6 |i..ln&y..1.-G&..|
|
||||
000002e0 42 25 f5 66 6b 03 7a 19 b1 02 42 00 f4 5c 98 a4 |B%.fk.z...B..\..|
|
||||
000002f0 d3 d7 af 36 42 cc 95 91 be 7e b1 3c 61 df a9 9c |...6B....~.<a...|
|
||||
00000300 22 4d 22 82 e1 fa bc ff 8d b0 fe 3d 0e 5e d0 ef |"M"........=.^..|
|
||||
00000310 d5 dc 62 88 9a f5 1b 66 1d d3 54 cc 4d 1d 2c ea |..b....f..T.M.,.|
|
||||
00000320 bd 65 34 9a 15 b5 ad f6 7e 17 a5 96 c2 16 03 03 |.e4.....~.......|
|
||||
00000270 2a 16 03 03 00 b7 0c 00 00 b3 03 00 1d 20 ec f3 |*............ ..|
|
||||
00000280 2b 3b be 93 68 53 f2 ab 6c 97 5a fa 9b 8c bf eb |+;..hS..l.Z.....|
|
||||
00000290 37 6f af d7 b8 02 f3 8c 0b f9 75 29 11 32 04 03 |7o........u).2..|
|
||||
000002a0 00 8b 30 81 88 02 42 01 9d 90 aa b3 19 d2 9d cf |..0...B.........|
|
||||
000002b0 92 c1 64 05 89 db d0 dd 80 f3 a4 7e 09 ec 36 22 |..d........~..6"|
|
||||
000002c0 95 79 c4 36 0e 21 80 7d 4b 72 a5 38 a4 b0 a7 5f |.y.6.!.}Kr.8..._|
|
||||
000002d0 fb ae f7 66 23 82 91 c2 f8 95 df 60 ce dc e8 1a |...f#......`....|
|
||||
000002e0 3f 2b 2c fa 5e 58 67 98 78 02 42 00 fa 88 7f ae |?+,.^Xg.x.B.....|
|
||||
000002f0 00 55 2c a1 c2 47 ed c8 11 74 64 e7 c6 30 63 fb |.U,..G...td..0c.|
|
||||
00000300 bb 42 2a 02 9b 80 60 88 e7 3f af 17 a3 7f 1e f6 |.B*...`..?......|
|
||||
00000310 31 9c 1f 8c 89 e5 a0 b1 01 2a 4e d8 d2 1e 9f 11 |1........*N.....|
|
||||
00000320 f5 e3 35 38 3e b0 da 30 f1 fb ed e5 d1 16 03 03 |..58>..0........|
|
||||
00000330 00 3a 0d 00 00 36 03 01 02 40 00 2e 04 03 05 03 |.:...6...@......|
|
||||
00000340 06 03 08 07 08 08 08 09 08 0a 08 0b 08 04 08 05 |................|
|
||||
00000350 08 06 04 01 05 01 06 01 03 03 02 03 03 01 02 01 |................|
|
||||
|
@ -109,31 +109,31 @@
|
|||
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 04 03 00 8b 30 81 88 02 42 01 83 b1 39 05 |......0...B...9.|
|
||||
00000250 25 f1 1b 2b 55 c0 7e 56 e1 0e 33 bc 03 c7 0a 17 |%..+U.~V..3.....|
|
||||
00000260 b7 c2 b7 da ab 9d 5d 22 da 60 74 7d 85 5e 53 ff |......]".`t}.^S.|
|
||||
00000270 57 4e c3 0a 47 fd e5 f6 dc 05 56 4c 7a 9f e4 5c |WN..G.....VLz..\|
|
||||
00000280 04 97 80 61 d5 9f db a5 74 9b ec fc bf 02 42 01 |...a....t.....B.|
|
||||
00000290 27 f8 0e 21 c2 c2 68 72 82 1b 4b cf d8 0c 1a 09 |'..!..hr..K.....|
|
||||
000002a0 b0 f5 0f b9 3b e9 63 dc 68 33 5e 41 e2 2c a4 04 |....;.c.h3^A.,..|
|
||||
000002b0 ec ee 84 6d f3 28 fc 6d c4 f1 04 8c 1d 38 6e e9 |...m.(.m.....8n.|
|
||||
000002c0 ae 0d 0a 82 0e 42 c4 42 e7 12 33 c5 38 4f 19 51 |.....B.B..3.8O.Q|
|
||||
000002d0 61 14 03 03 00 01 01 16 03 03 00 40 00 00 00 00 |a..........@....|
|
||||
000002e0 00 00 00 00 00 00 00 00 00 00 00 00 9e b0 80 10 |................|
|
||||
000002f0 4c da e3 cd 1e 56 e6 90 10 c5 ea d6 25 f9 34 31 |L....V......%.41|
|
||||
00000300 cd 42 60 5d ab 3b 13 05 48 cd f6 53 c3 b7 ea ea |.B`].;..H..S....|
|
||||
00000310 30 f0 58 2d 17 3c 77 fb a7 8f 9f a8 |0.X-.<w.....|
|
||||
00000240 00 8f 04 03 00 8b 30 81 88 02 42 01 e6 0a ff de |......0...B.....|
|
||||
00000250 af a6 d2 7a 5f 4e f8 eb c8 19 74 53 5c e8 bc 2d |...z_N....tS\..-|
|
||||
00000260 72 24 11 d2 11 ec ec cd a1 9c 3d 10 a2 de f8 8b |r$........=.....|
|
||||
00000270 22 98 d3 33 c2 13 3b 93 89 ae ca a6 a8 94 70 fe |"..3..;.......p.|
|
||||
00000280 76 2f 04 bc ac fb 66 79 3b 76 7f 6d 96 02 42 01 |v/....fy;v.m..B.|
|
||||
00000290 df f6 30 14 7c 7e a1 0b f6 b8 8b d7 75 b8 bd 0e |..0.|~......u...|
|
||||
000002a0 63 8a bd 8b ec 75 70 db d9 37 d7 53 f3 8b a2 ae |c....up..7.S....|
|
||||
000002b0 60 96 69 74 eb bb 3d a6 9a 7d 46 51 73 ff 78 cf |`.it..=..}FQs.x.|
|
||||
000002c0 7f 49 d9 27 5e 9f f9 d2 11 cc 0e e4 dc 04 fe d5 |.I.'^...........|
|
||||
000002d0 d2 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 7a db 34 e9 |............z.4.|
|
||||
000002f0 98 f8 c1 f0 38 c3 33 22 5c c3 45 b0 a3 10 3c 77 |....8.3"\.E...<w|
|
||||
00000300 7f d2 06 c5 f8 13 b6 f4 ee 7e 53 0b 07 0b c3 c9 |.........~S.....|
|
||||
00000310 89 9a a9 bb 3b af 79 09 59 ce 10 41 |....;.y.Y..A|
|
||||
>>> Flow 4 (server to client)
|
||||
00000000 14 03 03 00 01 01 16 03 03 00 40 68 2a 2b af 97 |..........@h*+..|
|
||||
00000010 68 8d 96 ed 55 bc aa d2 d3 81 97 54 a1 01 88 7f |h...U......T....|
|
||||
00000020 72 b7 3a 38 66 c2 53 9a 01 56 0d e0 02 b5 93 66 |r.:8f.S..V.....f|
|
||||
00000030 b3 93 74 e2 e0 c5 22 1c 0d 8f bb 7d e1 43 bf bd |..t..."....}.C..|
|
||||
00000040 bc 69 2e 58 96 7b 39 f0 55 6f 1b |.i.X.{9.Uo.|
|
||||
00000000 14 03 03 00 01 01 16 03 03 00 40 18 c0 f3 96 7b |..........@....{|
|
||||
00000010 45 91 6d 5b 1c 67 4f 37 74 b7 db 72 45 57 09 25 |E.m[.gO7t..rEW.%|
|
||||
00000020 4a 14 68 4d 78 6c c7 15 6a b1 57 e6 ff 53 c4 58 |J.hMxl..j.W..S.X|
|
||||
00000030 41 c5 6b 08 3c 5a 8c b9 04 d0 27 62 ee a6 e3 36 |A.k.<Z....'b...6|
|
||||
00000040 96 87 db 09 e3 88 d9 a2 0f 7d 9a |.........}.|
|
||||
>>> 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 a6 98 ea d6 b2 81 83 18 5d 73 13 |.............]s.|
|
||||
00000020 dc e9 e9 bc 4c 1e a8 ec a5 62 93 f6 b8 0c 0f f0 |....L....b......|
|
||||
00000030 91 6e 51 2c fe 15 03 03 00 30 00 00 00 00 00 00 |.nQ,.....0......|
|
||||
00000040 00 00 00 00 00 00 00 00 00 00 7f e8 f5 80 8e 27 |...............'|
|
||||
00000050 1b 31 aa d0 ec 91 51 d0 18 21 de e3 63 1f ee 80 |.1....Q..!..c...|
|
||||
00000060 bc db 2f 4f ce 26 46 ce 65 2e |../O.&F.e.|
|
||||
00000010 00 00 00 00 00 a6 c2 ef 07 bb 38 4a e4 8f 0c 12 |..........8J....|
|
||||
00000020 19 1a 96 62 22 57 57 a2 b5 b3 06 70 95 28 a7 f7 |...b"WW....p.(..|
|
||||
00000030 0d 42 69 37 7f 15 03 03 00 30 00 00 00 00 00 00 |.Bi7.....0......|
|
||||
00000040 00 00 00 00 00 00 00 00 00 00 04 ed 3e 68 40 eb |............>h@.|
|
||||
00000050 a0 7e 57 da 27 e7 f5 e8 6c e5 6d 58 c8 a5 18 47 |.~W.'...l.mX...G|
|
||||
00000060 92 5a 43 90 de 07 9e 9a 3b cc |.ZC.....;.|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue