diff options
Diffstat (limited to 'Userland/Libraries/LibCrypto')
-rw-r--r-- | Userland/Libraries/LibCrypto/ASN1/DER.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Userland/Libraries/LibCrypto/ASN1/DER.h b/Userland/Libraries/LibCrypto/ASN1/DER.h index 1fbc960788..4ed44699ce 100644 --- a/Userland/Libraries/LibCrypto/ASN1/DER.h +++ b/Userland/Libraries/LibCrypto/ASN1/DER.h @@ -154,9 +154,13 @@ private: if (value_or_error.is_error()) return value_or_error.error(); - auto&& value = value_or_error.value(); - if constexpr (requires { ValueType { value }; }) - return ValueType { value }; + if constexpr (IsSame<ValueType, bool> && !IsSame<DecodedType, bool>) { + return DecodeError::NonConformingType; + } else { + auto&& value = value_or_error.value(); + if constexpr (requires { ValueType { value }; }) + return ValueType { value }; + } return DecodeError::NonConformingType; } |