summaryrefslogtreecommitdiff
path: root/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c')
-rw-r--r--toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
index 5a5c5525..d3e420e0 100644
--- a/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
+++ b/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/crypto_scrypt-common.c
@@ -29,7 +29,7 @@
29#include "crypto_pwhash_scryptsalsa208sha256.h" 29#include "crypto_pwhash_scryptsalsa208sha256.h"
30#include "crypto_scrypt.h" 30#include "crypto_scrypt.h"
31#include "runtime.h" 31#include "runtime.h"
32#include "utils.h" 32#include "../../toxcore/crypto_core.h"
33 33
34static const char * const itoa64 = 34static const char * const itoa64 =
35 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; 35 "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@@ -147,11 +147,11 @@ escrypt_r(escrypt_local_t * local, const uint8_t * passwd, size_t passwdlen,
147 prefixlen = src - setting; 147 prefixlen = src - setting;
148 148
149 salt = src; 149 salt = src;
150 src = (uint8_t *) strrchr((char *)salt, '$'); 150 src = (uint8_t *) strrchr((const char *)salt, '$');
151 if (src) { 151 if (src) {
152 saltlen = src - salt; 152 saltlen = src - salt;
153 } else { 153 } else {
154 saltlen = strlen((char *)salt); 154 saltlen = strlen((const char *)salt);
155 } 155 }
156 need = prefixlen + saltlen + 1 + 156 need = prefixlen + saltlen + 1 +
157 crypto_pwhash_scryptsalsa208sha256_STRHASHBYTES_ENCODED + 1; 157 crypto_pwhash_scryptsalsa208sha256_STRHASHBYTES_ENCODED + 1;
@@ -175,7 +175,7 @@ escrypt_r(escrypt_local_t * local, const uint8_t * passwd, size_t passwdlen,
175 *dst++ = '$'; 175 *dst++ = '$';
176 176
177 dst = encode64(dst, buflen - (dst - buf), hash, sizeof(hash)); 177 dst = encode64(dst, buflen - (dst - buf), hash, sizeof(hash));
178 sodium_memzero(hash, sizeof hash); 178 crypto_memzero(hash, sizeof hash);
179 if (!dst || dst >= buf + buflen) { /* Can't happen */ 179 if (!dst || dst >= buf + buflen) { /* Can't happen */
180 return NULL; 180 return NULL;
181 } 181 }