mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 00:02:55 +00:00
fix: salsa20 encryption only initializes encryption with zone name of at max 31 characters length
This commit is contained in:
parent
d9f23a0b76
commit
85d9f1c255
@ -21,7 +21,9 @@ uint8_t* AbstractSalsa20Processor::GetHashBlock(const int streamNumber) const
|
||||
|
||||
void AbstractSalsa20Processor::InitStreams(const std::string& zoneName, const uint8_t* salsa20Key, const size_t keySize) const
|
||||
{
|
||||
const auto zoneNameLength = zoneName.length();
|
||||
// Original buffer must have been 32 bytes because the zoneName can at most be 31 characters be long before being cut off
|
||||
const auto zoneNameLength = std::min(zoneName.length(), 31u);
|
||||
|
||||
const size_t blockHashBufferSize = BLOCK_HASHES_COUNT * m_stream_count * SHA1_HASH_SIZE;
|
||||
|
||||
assert(blockHashBufferSize % 4 == 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user