@@ -56,6 +56,11 @@ impl fmt::Debug for SignatureAlgorithm {
56
56
} else if self == & PKCS_ED25519 {
57
57
write ! ( f, "PKCS_ED25519" )
58
58
} else {
59
+ #[ cfg( all( feature = "aws_lc_rs" , not( feature = "ring" ) ) ) ]
60
+ if self == & PKCS_ECDSA_P521_SHA512 {
61
+ return write ! ( f, "PKCS_ECDSA_P521_SHA512" ) ;
62
+ }
63
+
59
64
write ! ( f, "Unknown" )
60
65
}
61
66
}
@@ -86,6 +91,8 @@ impl SignatureAlgorithm {
86
91
//&PKCS_RSA_PSS_SHA256,
87
92
& PKCS_ECDSA_P256_SHA256 ,
88
93
& PKCS_ECDSA_P384_SHA384 ,
94
+ #[ cfg( all( feature = "aws_lc_rs" , not( feature = "ring" ) ) ) ]
95
+ & PKCS_ECDSA_P521_SHA512 ,
89
96
& PKCS_ED25519 ,
90
97
] ;
91
98
ALGORITHMS . iter ( )
@@ -178,8 +185,17 @@ pub(crate) mod algo {
178
185
oid_components : & [ 1 , 2 , 840 , 10045 , 4 , 3 , 3 ] ,
179
186
params : SignatureAlgorithmParams :: None ,
180
187
} ;
181
-
182
- // TODO PKCS_ECDSA_P521_SHA512 https://github.com/briansmith/ring/issues/824
188
+ /// ECDSA signing using the P-521 curves and SHA-512 hashing as per [RFC 5758](https://tools.ietf.org/html/rfc5758#section-3.2)
189
+ /// Currently this is only supported with the `aws_lc_rs` feature
190
+ #[ cfg( all( feature = "aws_lc_rs" , not( feature = "ring" ) ) ) ]
191
+ pub static PKCS_ECDSA_P521_SHA512 : SignatureAlgorithm = SignatureAlgorithm {
192
+ oids_sign_alg : & [ & EC_PUBLIC_KEY , & EC_SECP_521_R1 ] ,
193
+ #[ cfg( feature = "crypto" ) ]
194
+ sign_alg : SignAlgo :: EcDsa ( & signature:: ECDSA_P521_SHA512_ASN1_SIGNING ) ,
195
+ // ecdsa-with-SHA512 in RFC 5758
196
+ oid_components : & [ 1 , 2 , 840 , 10045 , 4 , 3 , 4 ] ,
197
+ params : SignatureAlgorithmParams :: None ,
198
+ } ;
183
199
184
200
/// ED25519 curve signing as per [RFC 8410](https://tools.ietf.org/html/rfc8410)
185
201
pub static PKCS_ED25519 : SignatureAlgorithm = SignatureAlgorithm {
0 commit comments