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,8 +144,9 @@ 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(
iter, keylen, out); pass, passlen, const_cast<unsigned char*>(salt), saltlen,
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();