mirror of
https://github.com/vgough/encfs.git
synced 2024-11-22 16:03:34 +01:00
change casts to use C++ style const_cast
git-svn-id: http://encfs.googlecode.com/svn/trunk@44 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
parent
89a2a08b38
commit
61c4ae51f6
@ -144,7 +144,8 @@ int TimedPBKDF2(const char *pass, int passlen,
|
|||||||
for(;;)
|
for(;;)
|
||||||
{
|
{
|
||||||
gettimeofday( &start, 0 );
|
gettimeofday( &start, 0 );
|
||||||
int res = PKCS5_PBKDF2_HMAC_SHA1(pass, passlen, salt, saltlen,
|
int res = PKCS5_PBKDF2_HMAC_SHA1(
|
||||||
|
pass, passlen, const_cast<unsigned char*>(salt), saltlen,
|
||||||
iter, keylen, out);
|
iter, keylen, out);
|
||||||
if(res != 1)
|
if(res != 1)
|
||||||
return -1;
|
return -1;
|
||||||
@ -423,9 +424,10 @@ CipherKey SSL_Cipher::newKey(const char *password, int passwdLength,
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
// known iteration length
|
// known iteration length
|
||||||
if(PKCS5_PBKDF2_HMAC_SHA1(password, passwdLength, salt, saltLen,
|
if(PKCS5_PBKDF2_HMAC_SHA1(
|
||||||
iterationCount, _keySize + _ivLength,
|
password, passwdLength,
|
||||||
KeyData(key)) != 1)
|
const_cast<unsigned char*>(salt), saltLen,
|
||||||
|
iterationCount, _keySize + _ivLength, KeyData(key)) != 1)
|
||||||
{
|
{
|
||||||
rWarning("openssl error, PBKDF2 failed");
|
rWarning("openssl error, PBKDF2 failed");
|
||||||
return CipherKey();
|
return CipherKey();
|
||||||
|
Loading…
Reference in New Issue
Block a user