summaryrefslogtreecommitdiff
path: root/libs/libsodium/src/sodium/utils.c
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-10-08 20:59:56 +0300
committeraunsane <aunsane@gmail.com>2018-10-08 20:59:56 +0300
commit1656da33a4750283e1024ea65e1c6573a07fd50a (patch)
treeba298f7f7aeb7db6df4061e806486b50a4708a89 /libs/libsodium/src/sodium/utils.c
parentb8ad6c3cc2edef99dc2a416667c3933c1061994c (diff)
updated libsodium to version 1.0.17
Diffstat (limited to 'libs/libsodium/src/sodium/utils.c')
-rw-r--r--libs/libsodium/src/sodium/utils.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/libsodium/src/sodium/utils.c b/libs/libsodium/src/sodium/utils.c
index 3a5f835b9f..007f284aeb 100644
--- a/libs/libsodium/src/sodium/utils.c
+++ b/libs/libsodium/src/sodium/utils.c
@@ -110,6 +110,8 @@ sodium_memzero(void *const pnt, const size_t len)
}
#elif defined(HAVE_EXPLICIT_BZERO)
explicit_bzero(pnt, len);
+#elif defined(HAVE_EXPLICIT_MEMSET)
+ explicit_memset(pnt, 0, len);
#elif HAVE_WEAK_SYMBOLS
memset(pnt, 0, len);
_sodium_dummy_symbol_to_prevent_memzero_lto(pnt, len);
@@ -695,7 +697,8 @@ sodium_pad(size_t *padded_buflen_p, unsigned char *buf,
}
mask = 0U;
for (i = 0; i < blocksize; i++) {
- barrier_mask = (unsigned char) (((i ^ xpadlen) - 1U) >> 8);
+ barrier_mask = (unsigned char) (((i ^ xpadlen) - 1U)
+ >> ((sizeof(size_t) - 1) * CHAR_BIT));
tail[-i] = (tail[-i] & mask) | (0x80 & barrier_mask);
mask |= barrier_mask;
}