mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-01 21:53:54 +00:00
LibCrypto: Skip the check against 2^32 on 32-bit
We can't have a length that large there. This was causing a build error about shifting a 32-bit value by 32 bits.
This commit is contained in:
parent
d458471e09
commit
e720eadd9e
|
@ -24,8 +24,10 @@ public:
|
|||
size_t h_len = hash.digest_size();
|
||||
|
||||
// 1. If length > 2^32(hLen), output "mask too long" and stop.
|
||||
if (length > (h_len << 32))
|
||||
return Error::from_string_view("mask too long"sv);
|
||||
if constexpr (sizeof(size_t) > 32) {
|
||||
if (length > (h_len << 32))
|
||||
return Error::from_string_view("mask too long"sv);
|
||||
}
|
||||
|
||||
// 2. Let T be the empty octet string.
|
||||
auto t = TRY(ByteBuffer::create_uninitialized(0));
|
||||
|
|
Loading…
Reference in a new issue