projects
/
platform
/
upstream
/
cryptsetup.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 2.6.1
[platform/upstream/cryptsetup.git]
/
lib
/
crypto_backend
/
argon2
/
core.c
diff --git
a/lib/crypto_backend/argon2/core.c
b/lib/crypto_backend/argon2/core.c
index
b204ba9
..
f128d84
100644
(file)
--- a/
lib/crypto_backend/argon2/core.c
+++ b/
lib/crypto_backend/argon2/core.c
@@
-120,18
+120,24
@@
void free_memory(const argon2_context *context, uint8_t *memory,
}
}
}
}
-void NOT_OPTIMIZED secure_wipe_memory(void *v, size_t n) {
#if defined(_MSC_VER) && VC_GE_2005(_MSC_VER)
#if defined(_MSC_VER) && VC_GE_2005(_MSC_VER)
+void secure_wipe_memory(void *v, size_t n) {
SecureZeroMemory(v, n);
SecureZeroMemory(v, n);
+}
#elif defined memset_s
#elif defined memset_s
+void secure_wipe_memory(void *v, size_t n) {
memset_s(v, n, 0, n);
memset_s(v, n, 0, n);
+}
#elif defined(HAVE_EXPLICIT_BZERO)
#elif defined(HAVE_EXPLICIT_BZERO)
+void secure_wipe_memory(void *v, size_t n) {
explicit_bzero(v, n);
explicit_bzero(v, n);
+}
#else
#else
+void NOT_OPTIMIZED secure_wipe_memory(void *v, size_t n) {
static void *(*const volatile memset_sec)(void *, int, size_t) = &memset;
memset_sec(v, 0, n);
static void *(*const volatile memset_sec)(void *, int, size_t) = &memset;
memset_sec(v, 0, n);
-#endif
}
}
+#endif
/* Memory clear flag defaults to true. */
int FLAG_clear_internal_memory = 1;
/* Memory clear flag defaults to true. */
int FLAG_clear_internal_memory = 1;
@@
-273,7
+279,6
@@
static void *fill_segment_thr(void *thread_data)
{
argon2_thread_data *my_data = thread_data;
fill_segment(my_data->instance_ptr, my_data->pos);
{
argon2_thread_data *my_data = thread_data;
fill_segment(my_data->instance_ptr, my_data->pos);
- argon2_thread_exit();
return 0;
}
return 0;
}