fix cipher initialization

git-svn-id: http://encfs.googlecode.com/svn/trunk@110 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
Valient Gough 2013-06-22 21:00:05 +00:00
parent c44b208078
commit 1e6b715380
2 changed files with 4 additions and 8 deletions

View File

@ -358,8 +358,9 @@ CipherKey CipherV1::newKey(const char *password, int passwdLength,
{
LOG(ERROR) << "openssl error, PBKDF2 failed";
return CipherKey();
} else
} else {
*iterationCount = res;
}
} else
{
// known iteration length
@ -574,7 +575,6 @@ int CipherV1::keySize() const
int CipherV1::cipherBlockSize() const
{
rAssert( _keySet );
return _blockCipher->blockSize();
}

View File

@ -1170,7 +1170,8 @@ RootPtr createConfig( EncFS_Context *ctx,
void showFSInfo( const EncfsConfig &config )
{
shared_ptr<CipherV1> cipher = CipherV1::New( config.cipher(), -1 );
shared_ptr<CipherV1> cipher = CipherV1::New( config.cipher(),
config.key().size() );
{
cout << autosprintf(
// xgroup(diag)
@ -1204,11 +1205,6 @@ void showFSInfo( const EncfsConfig &config )
cout << "\n";
} else
{
// Set a null key - the cipher won't work, but it will at least know the
// key size and blocksize.
CipherKey tmpKey(config.key().size());
cipher->setKey(tmpKey);
// check if we support the filename encoding interface..
shared_ptr<NameIO> nameCoder = NameIO::New( config.naming(), cipher );
if(!nameCoder)