Module Name: src
Committed By: christos
Date: Sun Jun 16 13:03:48 UTC 2024
Modified Files:
src/sys/crypto/aes/arch/x86: aes_via.c
Log Message:
try to fix the overflow gcc pointed out.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/crypto/aes/arch/x86/aes_via.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/crypto/aes/arch/x86/aes_via.c
diff -u src/sys/crypto/aes/arch/x86/aes_via.c:1.6 src/sys/crypto/aes/arch/x86/aes_via.c:1.7
--- src/sys/crypto/aes/arch/x86/aes_via.c:1.6 Tue Jul 28 10:01:35 2020
+++ src/sys/crypto/aes/arch/x86/aes_via.c Sun Jun 16 09:03:48 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: aes_via.c,v 1.6 2020/07/28 14:01:35 riastradh Exp $ */
+/* $NetBSD: aes_via.c,v 1.7 2024/06/16 13:03:48 christos Exp $ */
/*-
* Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(1, "$NetBSD: aes_via.c,v 1.6 2020/07/28 14:01:35 riastradh Exp $");
+__KERNEL_RCSID(1, "$NetBSD: aes_via.c,v 1.7 2024/06/16 13:03:48 christos Exp $");
#ifdef _KERNEL
#include <sys/types.h>
@@ -428,7 +428,8 @@ aesvia_cbc_dec(const struct aesdec *dec,
break;
memcpy(cv, in + nbytes - 16, 16);
xor128(tmp, tmp, cv);
- memcpy(out + nbytes, tmp, 16);
+ // XXX: is this right? (subtracting 16)
+ memcpy(out + nbytes - 16, tmp, 16);
}
xor128(tmp, tmp, iv0);