@@ -64,7 +64,9 @@ impl fmt::Debug for SignatureAlgorithm {
6464 write ! ( f, "PKCS_ED25519" )
6565 } else {
6666 #[ cfg( feature = "aws_lc_rs" ) ]
67- if self == & PKCS_ECDSA_P521_SHA512 {
67+ if self == & PKCS_ECDSA_P256K1_SHA256 {
68+ return write ! ( f, "PKCS_ECDSA_P256K1_SHA256" ) ;
69+ } else if self == & PKCS_ECDSA_P521_SHA512 {
6870 return write ! ( f, "PKCS_ECDSA_P521_SHA512" ) ;
6971 }
7072
@@ -97,6 +99,8 @@ impl SignatureAlgorithm {
9799 & PKCS_RSA_SHA512 ,
98100 //&PKCS_RSA_PSS_SHA256,
99101 & PKCS_ECDSA_P256_SHA256 ,
102+ #[ cfg( feature = "aws_lc_rs" ) ]
103+ & PKCS_ECDSA_P256K1_SHA256 ,
100104 & PKCS_ECDSA_P384_SHA384 ,
101105 #[ cfg( feature = "aws_lc_rs" ) ]
102106 & PKCS_ECDSA_P521_SHA512 ,
@@ -172,7 +176,19 @@ pub(crate) mod algo {
172176 } ,
173177 } ;
174178
175- /// ECDSA signing using the P-256 curves and SHA-256 hashing as per [RFC 5758](https://tools.ietf.org/html/rfc5758#section-3.2)
179+ /// ECDSA signing using the K-256 curves and SHA-256 hashing as per [SEC 2, Section 2.4.1](https://www.secg.org/sec2-v2.pdf)
180+ /// Currently this is only supported with the `aws_lc_rs` feature
181+ #[ cfg( feature = "aws_lc_rs" ) ]
182+ pub static PKCS_ECDSA_P256K1_SHA256 : SignatureAlgorithm = SignatureAlgorithm {
183+ oids_sign_alg : & [ EC_PUBLIC_KEY , EC_SECP_256_K1 ] ,
184+ #[ cfg( feature = "crypto" ) ]
185+ sign_alg : SignAlgo :: EcDsa ( & signature:: ECDSA_P256K1_SHA256_ASN1_SIGNING ) ,
186+ // ecdsa-with-SHA256 in RFC 5758
187+ oid_components : & [ 1 , 2 , 840 , 10045 , 4 , 3 , 2 ] ,
188+ params : SignatureAlgorithmParams :: None ,
189+ } ;
190+
191+ /// ECDSA signing using the P-256 curves with verifiably random parameters and SHA-256 hashing as per [RFC 5758](https://tools.ietf.org/html/rfc5758#section-3.2)
176192 pub static PKCS_ECDSA_P256_SHA256 : SignatureAlgorithm = SignatureAlgorithm {
177193 oids_sign_alg : & [ EC_PUBLIC_KEY , EC_SECP_256_R1 ] ,
178194 #[ cfg( feature = "crypto" ) ]
0 commit comments