LibCrypto: Make SECPxxxr1Signature carry the scalar size

Our `UnsignedBigInteger` implementation cannot handle numbers whose
size is not a multiple of 4. For this reason we need to carry the real
size around for P-521 support.
This commit is contained in:
devgianlu 2025-01-26 20:59:06 +01:00 committed by Ali Mohammad Pur
commit f2e530ec14
Notes: github-actions[bot] 2025-01-27 11:26:14 +00:00
4 changed files with 39 additions and 10 deletions

View file

@ -354,7 +354,7 @@ bool Context::verify_certificate_pair(Certificate const& subject, Certificate co
auto public_point = issuer.public_key.ec.to_secpxxxr1_point();
auto maybe_signature = Crypto::Curves::SECPxxxr1Signature::from_asn(subject.signature_value, {});
auto maybe_signature = Crypto::Curves::SECPxxxr1Signature::from_asn(*issuer.public_key.algorithm.ec_parameters, subject.signature_value, {});
if (maybe_signature.is_error()) {
dbgln("verify_certificate_pair: Signature is not ASN.1 DER encoded");
return false;