diff options
author | Michiel Visser <opensource@webmichiel.nl> | 2022-02-23 17:24:41 +0100 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-04-17 10:10:19 +0430 |
commit | b16b61f6bc0e22b13f8a233691ca810fe9926301 (patch) | |
tree | 5b548d619cd03bf8fbac1a1b8522bbd0d6d097c2 /Userland/Libraries/LibCrypto | |
parent | 5a60bed88b0759aac31683ec7d8ec7084b473d0b (diff) | |
download | serenity-b16b61f6bc0e22b13f8a233691ca810fe9926301.zip |
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.
Diffstat (limited to 'Userland/Libraries/LibCrypto')
-rw-r--r-- | Userland/Libraries/LibCrypto/ASN1/DER.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCrypto/ASN1/DER.cpp b/Userland/Libraries/LibCrypto/ASN1/DER.cpp index 9f3b51f160..846327c553 100644 --- a/Userland/Libraries/LibCrypto/ASN1/DER.cpp +++ b/Userland/Libraries/LibCrypto/ASN1/DER.cpp @@ -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) |