mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:47:34 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue