mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibCrypto+LibTLS+LibWeb: Store EC key size + refactor serialization
In order for public/private key serialization to work correctly we must store the size of the key because P-521 cannot be stored as full words inside `UnsignedBigInteger` and therefore is exported as the wrong length (68 instead of 66). This makes it also possible to refactor some methods and cleanup constants scattered around. Gets almost all import/export tests, expect the JWK ones that calculate the public key on export. The `SECPxxxr1` implementation currently fails to do calculations for P-521.
This commit is contained in:
parent
70db7772b8
commit
9240d38273
Notes:
github-actions[bot]
2024-12-14 00:53:11 +00:00
Author: https://github.com/devgianlu
Commit: 9240d38273
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2902
Reviewed-by: https://github.com/alimpfard
9 changed files with 146 additions and 110 deletions
|
@ -458,8 +458,7 @@ ssize_t TLSv12::verify_ecdsa_server_key_exchange(ReadonlyBytes server_key_info_b
|
|||
dbgln("verify_ecdsa_server_key_exchange failed: Attempting to verify signature without certificates");
|
||||
return (i8)Error::NotSafe;
|
||||
}
|
||||
auto server_public_key = m_context.certificates.first().public_key.ec;
|
||||
auto server_point = Crypto::Curves::SECPxxxr1Point { server_public_key.x(), server_public_key.y() };
|
||||
auto server_point = m_context.certificates.first().public_key.ec.to_secpxxxr1_point();
|
||||
|
||||
auto message_result = ByteBuffer::create_uninitialized(64 + server_key_info_buffer.size());
|
||||
if (message_result.is_error()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue