VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common/libzip/zip_crypto_win.c
diff options
context:
space:
mode:
authorDLL125 <134442578+DLL125@users.noreply.github.com>2023-07-17 14:11:12 +0200
committerGitHub <noreply@github.com>2023-07-17 14:11:12 +0200
commit65765798d85258c0358b28b90aac68ed1851f49b (patch)
tree22f573edc4e16790d9be208fce95db1134fe2ba4 /src/Common/libzip/zip_crypto_win.c
parent6267b91931af87db2b95172389a6fbaac206e42e (diff)
downloadVeraCrypt-65765798d85258c0358b28b90aac68ed1851f49b.tar.gz
VeraCrypt-65765798d85258c0358b28b90aac68ed1851f49b.zip
Libzip (#1152)
* Update LZMA to latest * Update Libzip Libzip updated to latest.
Diffstat (limited to 'src/Common/libzip/zip_crypto_win.c')
-rw-r--r--src/Common/libzip/zip_crypto_win.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Common/libzip/zip_crypto_win.c b/src/Common/libzip/zip_crypto_win.c
index 6dc1bb1d..ee3ccc30 100644
--- a/src/Common/libzip/zip_crypto_win.c
+++ b/src/Common/libzip/zip_crypto_win.c
@@ -254,7 +254,7 @@ pbkdf2(PUCHAR pbPassword, ULONG cbPassword, PUCHAR pbSalt, ULONG cbSalt, DWORD c
for (j = 0; j < cIterations; j++) {
if (j == 0) {
/* construct first input for PRF */
- memcpy(U, pbSalt, cbSalt);
+ (void)memcpy_s(U, cbSalt, pbSalt, cbSalt);
U[cbSalt] = (BYTE)((i & 0xFF000000) >> 24);
U[cbSalt + 1] = (BYTE)((i & 0x00FF0000) >> 16);
U[cbSalt + 2] = (BYTE)((i & 0x0000FF00) >> 8);
@@ -262,7 +262,7 @@ pbkdf2(PUCHAR pbPassword, ULONG cbPassword, PUCHAR pbSalt, ULONG cbSalt, DWORD c
dwULen = cbSalt + 4;
}
else {
- memcpy(U, V, DIGEST_SIZE);
+ (void)memcpy_s(U, DIGEST_SIZE, V, DIGEST_SIZE);
dwULen = DIGEST_SIZE;
}
@@ -274,11 +274,11 @@ pbkdf2(PUCHAR pbPassword, ULONG cbPassword, PUCHAR pbSalt, ULONG cbSalt, DWORD c
}
if (i != l) {
- memcpy(&pbDerivedKey[(i - 1) * DIGEST_SIZE], Ti, DIGEST_SIZE);
+ (void)memcpy_s(&pbDerivedKey[(i - 1) * DIGEST_SIZE], cbDerivedKey - (i - 1) * DIGEST_SIZE, Ti, DIGEST_SIZE);
}
else {
/* Take only the first r bytes */
- memcpy(&pbDerivedKey[(i - 1) * DIGEST_SIZE], Ti, r);
+ (void)memcpy_s(&pbDerivedKey[(i - 1) * DIGEST_SIZE], cbDerivedKey - (i - 1) * DIGEST_SIZE, Ti, r);
}
}