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:
Valient Gough 2008-12-28 05:31:15 +00:00
parent 89a2a08b38
commit 61c4ae51f6

View File

@ -144,7 +144,8 @@ int TimedPBKDF2(const char *pass, int passlen,
for(;;)
{
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);
if(res != 1)
return -1;
@ -423,9 +424,10 @@ CipherKey SSL_Cipher::newKey(const char *password, int passwdLength,
} else
{
// known iteration length
if(PKCS5_PBKDF2_HMAC_SHA1(password, passwdLength, salt, saltLen,
iterationCount, _keySize + _ivLength,
KeyData(key)) != 1)
if(PKCS5_PBKDF2_HMAC_SHA1(
password, passwdLength,
const_cast<unsigned char*>(salt), saltLen,
iterationCount, _keySize + _ivLength, KeyData(key)) != 1)
{
rWarning("openssl error, PBKDF2 failed");
return CipherKey();