mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 12:20:00 +01: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
|
|
@ -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…
Reference in New Issue
Block a user