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
96
testdata/Client-TLSv10-ClientCert-RSA-RSA
vendored
96
testdata/Client-TLSv10-ClientCert-RSA-RSA
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 01 00 59 02 00 00 55 03 01 6b 8a f7 68 78 |....Y...U..k..hx|
|
||||
00000010 f1 ea ad 9b 20 40 42 52 eb fa 55 fb 37 a7 21 22 |.... @BR..U.7.!"|
|
||||
00000020 71 0d f7 4d 46 bf 38 df 6e 00 e0 20 17 73 28 32 |q..MF.8.n.. .s(2|
|
||||
00000030 30 3f f4 01 df 70 98 ce 33 d0 c3 8c 0a fd 0a ba |0?...p..3.......|
|
||||
00000040 6b 56 d7 f9 16 a2 24 0d 07 b1 32 47 c0 13 00 00 |kV....$...2G....|
|
||||
00000000 16 03 01 00 59 02 00 00 55 03 01 97 fe 7f 92 37 |....Y...U......7|
|
||||
00000010 67 99 e0 d8 62 a9 31 80 bd 1f 31 8e 7d 0b 08 0a |g...b.1...1.}...|
|
||||
00000020 de a5 82 a2 f2 d0 c1 35 66 34 6e 20 39 46 b1 b0 |.......5f4n 9F..|
|
||||
00000030 6e 2d 0e fe 8c 48 ea ab 1c c4 49 ee f4 21 cf cb |n-...H....I..!..|
|
||||
00000040 2a 20 57 78 18 99 a1 b9 7f 88 4f 64 c0 13 00 00 |* Wx......Od....|
|
||||
00000050 0d ff 01 00 01 00 00 0b 00 04 03 00 01 02 16 03 |................|
|
||||
00000060 01 02 59 0b 00 02 55 00 02 52 00 02 4f 30 82 02 |..Y...U..R..O0..|
|
||||
00000070 4b 30 82 01 b4 a0 03 02 01 02 02 09 00 e8 f0 9d |K0..............|
|
||||
|
@ -60,17 +60,17 @@
|
|||
00000290 77 8d 0c 1c f1 0f a1 d8 40 83 61 c9 4c 72 2b 9d |w.......@.a.Lr+.|
|
||||
000002a0 ae db 46 06 06 4d f4 c1 b3 3e c0 d1 bd 42 d4 db |..F..M...>...B..|
|
||||
000002b0 fe 3d 13 60 84 5c 21 d3 3b e9 fa e7 16 03 01 00 |.=.`.\!.;.......|
|
||||
000002c0 aa 0c 00 00 a6 03 00 1d 20 b1 de e2 91 3f 1f be |........ ....?..|
|
||||
000002d0 0e 21 49 44 db d1 d3 a7 89 db 61 56 97 bf 4c 73 |.!ID......aV..Ls|
|
||||
000002e0 7b d3 da 81 a5 cc 0a e3 13 00 80 66 fd 15 8d 8a |{..........f....|
|
||||
000002f0 a2 f9 8d b9 d9 cb a5 6b 45 7c 11 05 24 6d de e5 |.......kE|..$m..|
|
||||
00000300 8f 3e 42 ba 3e bd 5a b8 f7 51 c0 b9 55 06 db d7 |.>B.>.Z..Q..U...|
|
||||
00000310 2d 78 d2 5d 47 2d 52 c9 7b 59 20 73 1a 1d 26 c4 |-x.]G-R.{Y s..&.|
|
||||
00000320 84 3d 5b 57 5f 1a fd 52 8c 40 87 be 58 58 73 d2 |.=[W_..R.@..XXs.|
|
||||
00000330 4b 84 9a 6c 96 c0 36 82 95 13 f9 12 74 c3 3b dd |K..l..6.....t.;.|
|
||||
00000340 27 11 c3 66 fa de 28 b4 c0 d9 6e 65 e0 8a 5e b6 |'..f..(...ne..^.|
|
||||
00000350 3a a8 52 db 62 89 2b 1d d0 be fb b7 6e 03 bd f7 |:.R.b.+.....n...|
|
||||
00000360 e3 a5 df c2 b3 5a 16 09 d8 1e df 16 03 01 00 0a |.....Z..........|
|
||||
000002c0 aa 0c 00 00 a6 03 00 1d 20 07 80 79 40 4b b1 0e |........ ..y@K..|
|
||||
000002d0 05 ce e4 ca 9d f5 d7 ad a6 98 f2 40 f9 b9 66 a8 |...........@..f.|
|
||||
000002e0 04 6e ae b5 da 99 67 09 69 00 80 01 4a f2 c1 c9 |.n....g.i...J...|
|
||||
000002f0 2f 46 4f b8 9e 8b 2c c4 a1 32 44 3c dc 2c 5e b9 |/FO...,..2D<.,^.|
|
||||
00000300 76 5f 41 20 23 1b 82 dd ec 37 b4 24 68 6d a7 39 |v_A #....7.$hm.9|
|
||||
00000310 4f f2 e5 97 09 75 64 2a 64 16 b8 99 04 8a 74 77 |O....ud*d.....tw|
|
||||
00000320 19 bb 12 5f 27 f6 41 09 f7 2e 1c 33 80 3b 01 57 |..._'.A....3.;.W|
|
||||
00000330 5c f9 20 6e 0c 48 76 59 e1 8b 1f bb 2a 33 1a 28 |\. n.HvY....*3.(|
|
||||
00000340 a0 5a 05 44 94 eb 35 62 5e ae 7f e4 01 76 b6 b4 |.Z.D..5b^....v..|
|
||||
00000350 64 91 bf 25 09 ff 88 8a af 73 00 d0 7e ea 0f ca |d..%.....s..~...|
|
||||
00000360 4a 2b d4 6f 02 26 98 28 5a ed 11 16 03 01 00 0a |J+.o.&.(Z.......|
|
||||
00000370 0d 00 00 06 03 01 02 40 00 00 16 03 01 00 04 0e |.......@........|
|
||||
00000380 00 00 00 |...|
|
||||
>>> Flow 3 (client to server)
|
||||
|
@ -109,29 +109,29 @@
|
|||
00000200 e5 35 16 03 01 00 25 10 00 00 21 20 2f e5 7d a3 |.5....%...! /.}.|
|
||||
00000210 47 cd 62 43 15 28 da ac 5f bb 29 07 30 ff f6 84 |G.bC.(.._.).0...|
|
||||
00000220 af c4 cf c2 ed 90 99 5f 58 cb 3b 74 16 03 01 00 |......._X.;t....|
|
||||
00000230 86 0f 00 00 82 00 80 9c f0 ab 90 83 2a 47 ba 5c |............*G.\|
|
||||
00000240 37 a4 19 b8 62 b1 01 74 35 4d 1a 62 5e 3f 0b 54 |7...b..t5M.b^?.T|
|
||||
00000250 5a 6f b7 b5 99 4b b4 84 68 90 46 2b 95 e6 10 77 |Zo...K..h.F+...w|
|
||||
00000260 bf 68 81 b1 96 11 5c e9 93 a4 d5 78 42 c0 c4 92 |.h....\....xB...|
|
||||
00000270 cf 4e ce 25 e7 da 7d d9 2c 4d ab 71 2d b5 a7 1c |.N.%..}.,M.q-...|
|
||||
00000280 5f b5 a3 32 f6 3e 38 79 17 36 45 94 8a e3 f8 1e |_..2.>8y.6E.....|
|
||||
00000290 9e 95 23 48 0f f6 aa 1b 00 d2 45 85 c7 95 b2 d1 |..#H......E.....|
|
||||
000002a0 c1 81 e8 31 34 45 bd 28 32 26 a8 d1 23 90 cb 40 |...14E.(2&..#..@|
|
||||
000002b0 1c ed db eb c3 ec b6 14 03 01 00 01 01 16 03 01 |................|
|
||||
000002c0 00 30 16 97 3e a2 2a 11 d5 3f 29 f6 5b b8 7a d5 |.0..>.*..?).[.z.|
|
||||
000002d0 83 24 51 f0 0c c3 79 18 9c 58 b6 f4 2f 70 9f c0 |.$Q...y..X../p..|
|
||||
000002e0 52 be a0 f0 eb d7 0e de 42 36 14 39 84 fc 84 ed |R.......B6.9....|
|
||||
000002f0 77 0c |w.|
|
||||
00000230 86 0f 00 00 82 00 80 81 aa 68 1f a9 a4 de f1 4d |.........h.....M|
|
||||
00000240 30 9a fe e6 a5 f6 f6 18 b6 3e d2 c7 f1 e6 77 e3 |0........>....w.|
|
||||
00000250 6a cd 61 01 81 3a 02 31 a5 aa d6 db b6 02 9d 4b |j.a..:.1.......K|
|
||||
00000260 f5 78 50 c3 95 fe 43 88 33 3a 95 32 bc e8 02 1a |.xP...C.3:.2....|
|
||||
00000270 e6 f4 d5 54 b9 fc e0 4a 4e f0 92 21 35 4b de c8 |...T...JN..!5K..|
|
||||
00000280 a4 b0 01 c3 ca 3a 87 ed cb 21 1c ce c2 14 7b 8d |.....:...!....{.|
|
||||
00000290 90 68 b9 21 49 13 dd cd e7 68 83 41 7c 84 6a 75 |.h.!I....h.A|.ju|
|
||||
000002a0 76 ee 19 8b fa d5 a6 57 3d a7 f1 f1 6f 11 ca 77 |v......W=...o..w|
|
||||
000002b0 95 0e b5 c7 3d 99 d4 14 03 01 00 01 01 16 03 01 |....=...........|
|
||||
000002c0 00 30 5e be 40 82 f8 db 05 20 23 45 a4 42 48 e8 |.0^.@.... #E.BH.|
|
||||
000002d0 06 69 eb 4c ef 79 53 52 4a 5a 3a ba cc d6 99 59 |.i.L.ySRJZ:....Y|
|
||||
000002e0 4d c2 b0 34 0f 14 68 03 93 8b a4 95 7e cf 26 f8 |M..4..h.....~.&.|
|
||||
000002f0 5c 8a |\.|
|
||||
>>> Flow 4 (server to client)
|
||||
00000000 14 03 01 00 01 01 16 03 01 00 30 8a 97 aa 38 29 |..........0...8)|
|
||||
00000010 a4 7a 25 ae d5 5f 66 17 cb 8e de d3 ac 0f b3 9d |.z%.._f.........|
|
||||
00000020 ba 61 54 31 cb c8 fc 1f 4c f5 76 b0 7e 7e 74 04 |.aT1....L.v.~~t.|
|
||||
00000030 8a 2e 45 a8 5f c7 43 d7 d5 f4 7d |..E._.C...}|
|
||||
00000000 14 03 01 00 01 01 16 03 01 00 30 ef 9b 5c da 0a |..........0..\..|
|
||||
00000010 2e c4 79 fa ea 8a 9c 78 4a 1f 08 77 56 73 6e fa |..y....xJ..wVsn.|
|
||||
00000020 3a 5b 3c cd cd e9 0c a8 bb 59 9e 22 ab 67 2c 03 |:[<......Y.".g,.|
|
||||
00000030 de ad 7c e4 cb 85 d7 8f c1 1c e3 |..|........|
|
||||
>>> Flow 5 (client to server)
|
||||
00000000 17 03 01 00 20 22 4d 00 3f 2a 41 f0 53 06 93 fe |.... "M.?*A.S...|
|
||||
00000010 aa 79 9b 69 bb d5 9b e5 e4 3b 48 ff e5 ce 7d db |.y.i.....;H...}.|
|
||||
00000020 d8 e8 e6 e1 04 17 03 01 00 20 e8 01 13 cb f1 1f |......... ......|
|
||||
00000030 17 68 33 6a ad 74 ae a7 c5 d9 00 ea 0b dc bb 9c |.h3j.t..........|
|
||||
00000040 5c 5f 49 01 1e 53 74 30 58 e6 15 03 01 00 20 bb |\_I..St0X..... .|
|
||||
00000050 30 7d c2 43 c3 0d b9 b5 3a 70 14 2c 4a 64 c9 fe |0}.C....:p.,Jd..|
|
||||
00000060 20 25 a7 0a 01 11 3c 62 ca d6 28 80 ed cd 73 | %....<b..(...s|
|
||||
00000000 17 03 01 00 20 48 1a 1a 1c 6c 7d 6c 2a e0 b2 e3 |.... H...l}l*...|
|
||||
00000010 b3 9f ec 39 a8 cd 9a f9 a2 3e 2d 46 3b cf 17 ed |...9.....>-F;...|
|
||||
00000020 70 99 ce d7 3c 17 03 01 00 20 69 27 e9 89 78 e6 |p...<.... i'..x.|
|
||||
00000030 64 c0 a9 40 4f 0d 97 53 b2 2e 15 f3 2b 54 3b 77 |d..@O..S....+T;w|
|
||||
00000040 f2 24 2c 94 dc b3 8b f0 c4 ce 15 03 01 00 20 1b |.$,........... .|
|
||||
00000050 50 55 83 d8 6b b4 04 b2 f0 2d 1c 9c 0d fa de 58 |PU..k....-.....X|
|
||||
00000060 cd 0a 1d 55 d6 36 f4 a4 fb cc 55 c5 b1 f3 d3 |...U.6....U....|
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue