aboutsummaryrefslogtreecommitdiffstats
path: root/src/crypto/aes-siv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/aes-siv.c')
-rw-r--r--src/crypto/aes-siv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/crypto/aes-siv.c b/src/crypto/aes-siv.c
index 2bb79b5..b682f3a 100644
--- a/src/crypto/aes-siv.c
+++ b/src/crypto/aes-siv.c
@@ -95,11 +95,10 @@ static int aes_s2v(const u8 *key, size_t key_len,
xor(tmp, tmp2);
}
if (len[i] >= AES_BLOCK_SIZE) {
- buf = os_malloc(len[i]);
+ buf = os_memdup(addr[i], len[i]);
if (!buf)
return -ENOMEM;
- os_memcpy(buf, addr[i], len[i]);
xorend(buf, len[i], tmp, AES_BLOCK_SIZE);
data[0] = buf;
ret = omac1_aes_vector(key, key_len, 1, data, &len[i], mac);