mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-11 20:16:02 +00:00
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:
parent
fd2014f5c2
commit
f2e530ec14
Notes:
github-actions[bot]
2025-01-27 11:26:14 +00:00
Author: https://github.com/devgianlu
Commit: f2e530ec14
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3374
Reviewed-by: https://github.com/alimpfard ✅
4 changed files with 39 additions and 10 deletions
|
@ -482,7 +482,7 @@ ssize_t TLSv12::verify_ecdsa_server_key_exchange(ReadonlyBytes server_key_info_b
|
|||
return (i8)Error::NotUnderstood;
|
||||
}
|
||||
|
||||
auto maybe_signature = Crypto::Curves::SECPxxxr1Signature::from_asn(signature_bytes, {});
|
||||
auto maybe_signature = Crypto::Curves::SECPxxxr1Signature::from_asn(*public_key.algorithm.ec_parameters, signature_bytes, {});
|
||||
if (maybe_signature.is_error()) {
|
||||
dbgln("verify_ecdsa_server_key_exchange failed: Signature is not ASN.1 DER encoded");
|
||||
return (i8)Error::NotUnderstood;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue