| ... | ... | @@ -87,10 +87,12 @@ pub const Attribute = enum { |
| 87 | 87 | |
| 88 | 88 | pub const NamedCurve = enum { |
| 89 | 89 | secp384r1, |
| 90 | secp521r1, |
| 90 | 91 | X9_62_prime256v1, |
| 91 | 92 | |
| 92 | 93 | pub const map = std.ComptimeStringMap(NamedCurve, .{ |
| 93 | 94 | .{ &[_]u8{ 0x2B, 0x81, 0x04, 0x00, 0x22 }, .secp384r1 }, |
| 95 | .{ &[_]u8{ 0x2B, 0x81, 0x04, 0x00, 0x23 }, .secp521r1 }, |
| 94 | 96 | .{ &[_]u8{ 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x03, 0x01, 0x07 }, .X9_62_prime256v1 }, |
| 95 | 97 | }); |
| 96 | 98 | }; |
| ... | ... | @@ -754,6 +756,9 @@ fn verify_ecdsa( |
| 754 | 756 | }; |
| 755 | 757 | |
| 756 | 758 | switch (sig_named_curve) { |
| 759 | .secp521r1 => { |
| 760 | return error.CertificateSignatureNamedCurveUnsupported; |
| 761 | }, |
| 757 | 762 | .secp384r1 => { |
| 758 | 763 | const P = crypto.ecc.P384; |
| 759 | 764 | const Ecdsa = crypto.sign.ecdsa.Ecdsa(P, Hash); |