mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
LibCrypto: Fix inverted boolean decoded error in ASN.1
ASN.1 encodes booleans as false is zero and true is non-zero. The decoder currently returned true when the boolean was zero. Since this decoder was barely used it did not cause any problems, however for support of other certificate extensions the correct version is required.
This commit is contained in:
parent
5a60bed88b
commit
b16b61f6bc
Notes:
sideshowbarker
2024-07-17 11:45:02 +09:00
Author: https://github.com/msvisser Commit: https://github.com/SerenityOS/serenity/commit/b16b61f6bc Pull-request: https://github.com/SerenityOS/serenity/pull/12739 Reviewed-by: https://github.com/alimpfard
@ -100,7 +100,7 @@ Result<bool, DecodeError> Decoder::decode_boolean(ReadonlyBytes data)
|
||||
if (data.size() != 1)
|
||||
return DecodeError::InvalidInputFormat;
|
||||
|
||||
return data[0] == 0;
|
||||
return data[0] != 0;
|
||||
}
|
||||
|
||||
Result<UnsignedBigInteger, DecodeError> Decoder::decode_arbitrary_sized_integer(ReadonlyBytes data)
|
||||
|
Loading…
Reference in New Issue
Block a user