mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibCrypto: Cleanup Crypto::PK::RSA
constructors to avoid pitfalls
- Removed the constructor taking a (n, d, e) tuple and moved it to `RSAPrivateKey` - Removed default constructor with key generation because it was always misused and the default key size is quite small - Added utility constructors to accept a key pair, public key, private key or both - Made constructor parameters const - Updated test to use generated random keys where possible
This commit is contained in:
parent
f49a55d089
commit
ec990d620f
Notes:
github-actions[bot]
2024-12-15 22:32:47 +00:00
Author: https://github.com/devgianlu
Commit: ec990d620f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2928
5 changed files with 31 additions and 30 deletions
|
@ -189,7 +189,7 @@ void TLSv12::build_rsa_pre_master_secret(PacketBuilder& builder)
|
|||
print_buffer(m_context.premaster_key);
|
||||
}
|
||||
|
||||
Crypto::PK::RSA_PKCS1_EME rsa(certificate.public_key.rsa.modulus(), 0, certificate.public_key.rsa.public_exponent());
|
||||
Crypto::PK::RSA_PKCS1_EME rsa(certificate.public_key.rsa);
|
||||
|
||||
Vector<u8, 32> out;
|
||||
out.resize(rsa.output_size());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue