libidav/crypto.c

changeset 515
2465dd550bb5
parent 506
ceed7714846a
child 520
da2b0cc44e4f
--- a/libidav/crypto.c	Tue Feb 26 10:34:10 2019 +0100
+++ b/libidav/crypto.c	Tue Feb 26 10:40:23 2019 +0100
@@ -359,7 +359,7 @@
     return util_hexstr(hash, DAV_SHA256_DIGEST_LENGTH);
 }
 
-DavKey* dav_pw2key(const char *password, const char *salt, int saltlen, int pwfunc, int enc) {
+DavKey* dav_pw2key(const char *password, const unsigned char *salt, int saltlen, int pwfunc, int enc) {
     if(!password) {
         return NULL;
     }
@@ -779,7 +779,7 @@
     return util_hexstr(hash, DAV_SHA256_DIGEST_LENGTH);
 }
 
-DavKey* dav_pw2key(const char *password, const char *salt, int saltlen, int pwfunc, int enc) {
+DavKey* dav_pw2key(const char *password, const unsigned char *salt, int saltlen, int pwfunc, int enc) {
     if(!password) {
         return NULL;
     }
@@ -804,7 +804,7 @@
                     kCCPBKDF2,
                     password,
                     len,
-                    (uint8_t*)salt,
+                    salt,
                     saltlen,
                     kCCPRFHmacAlgSHA256,
                     DAV_CRYPTO_ITERATION_COUNT,
@@ -820,7 +820,7 @@
                     kCCPBKDF2,
                     password,
                     len,
-                    (uint8_t*)salt,
+                    salt,
                     saltlen,
                     kCCPRFHmacAlgSHA512,
                     DAV_CRYPTO_ITERATION_COUNT,

mercurial