mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
chacha_encrypt_bytes(): ensure that the padding bytes are initialized
Reported by Pascal Cuoq
This commit is contained in:
@@ -131,6 +131,7 @@ chacha_encrypt_bytes(chacha_ctx *x, const u8 *m, u8 *c, unsigned long long bytes
|
||||
|
||||
for (;;) {
|
||||
if (bytes < 64) {
|
||||
memset(tmp, 0, 64);
|
||||
for (i = 0; i < bytes; ++i) {
|
||||
tmp[i] = m[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user