summaryrefslogtreecommitdiff
path: root/libs/libsodium/src/sodium
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
parentb8ad6c3cc2edef99dc2a416667c3933c1061994c (diff)
updated libsodium to version 1.0.17
Diffstat (limited to 'libs/libsodium/src/sodium')
-rw-r--r--libs/libsodium/src/sodium/core.c15
-rw-r--r--libs/libsodium/src/sodium/utils.c5
2 files changed, 4 insertions, 16 deletions
diff --git a/libs/libsodium/src/sodium/core.c b/libs/libsodium/src/sodium/core.c
index d667312f19..2241a2ea5b 100644
--- a/libs/libsodium/src/sodium/core.c
+++ b/libs/libsodium/src/sodium/core.c
@@ -21,21 +21,6 @@
#include "private/implementations.h"
#include "private/mutex.h"
-#if !defined(_MSC_VER) && 1
-# warning *** This is unstable, untested, development code.
-# warning It might not compile. It might not work as expected.
-# warning It might be totally insecure.
-# warning Do not use this in production.
-# warning Use releases available at https://download.libsodium.org/libsodium/releases/ instead.
-# warning Alternatively, use the "stable" branch in the git repository.
-#endif
-
-#if !defined(_MSC_VER) && (!defined(CONFIGURED) || CONFIGURED != 1)
-# warning *** The library is being compiled using an undocumented method.
-# warning This is not supported. It has not been tested, it might not
-# warning work as expected, and performance is likely to be suboptimal.
-#endif
-
static volatile int initialized;
static volatile int locked;
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;
}