mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibCrypto: Check ECPrivateKey
version when parsing
The version should always be one for version one. Fail if it isn't.
This commit is contained in:
parent
a019efb24b
commit
ce98d2bbf3
Notes:
github-actions[bot]
2025-04-28 10:07:22 +00:00
Author: https://github.com/devgianlu
Commit: ce98d2bbf3
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4482
Reviewed-by: https://github.com/gmta ✅
1 changed files with 4 additions and 0 deletions
|
@ -87,6 +87,10 @@ ErrorOr<EC::KeyPairType> EC::parse_ec_key(ReadonlyBytes der, bool is_private, Ve
|
|||
READ_OBJECT(Integer, Crypto::UnsignedBigInteger, version);
|
||||
POP_SCOPE();
|
||||
|
||||
if (version != 1) {
|
||||
ERROR_WITH_SCOPE("Invalid version");
|
||||
}
|
||||
|
||||
PUSH_SCOPE("privateKey");
|
||||
READ_OBJECT(OctetString, StringView, private_key_bytes);
|
||||
POP_SCOPE();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue