mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-15 15:16:49 +02:00
always init CipherKey digest pointer
This commit is contained in:
@@ -29,8 +29,7 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
|||||||
const std::string& passphrase,
|
const std::string& passphrase,
|
||||||
const std::string& salt,
|
const std::string& salt,
|
||||||
int iterationCount,
|
int iterationCount,
|
||||||
const std::string& digest):
|
const std::string& digest): _pCipher(0),
|
||||||
_pCipher(0),
|
|
||||||
_pDigest(0),
|
_pDigest(0),
|
||||||
_name(name),
|
_name(name),
|
||||||
_key(),
|
_key(),
|
||||||
@@ -57,8 +56,8 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
|||||||
|
|
||||||
CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
||||||
const ByteVec& key,
|
const ByteVec& key,
|
||||||
const ByteVec& iv):
|
const ByteVec& iv): _pCipher(0),
|
||||||
_pCipher(0),
|
_pDigest(0),
|
||||||
_name(name),
|
_name(name),
|
||||||
_key(key),
|
_key(key),
|
||||||
_iv(iv)
|
_iv(iv)
|
||||||
@@ -72,8 +71,8 @@ CipherKeyImpl::CipherKeyImpl(const std::string& name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CipherKeyImpl::CipherKeyImpl(const std::string& name):
|
CipherKeyImpl::CipherKeyImpl(const std::string& name): _pCipher(0),
|
||||||
_pCipher(0),
|
_pDigest(0),
|
||||||
_name(name),
|
_name(name),
|
||||||
_key(),
|
_key(),
|
||||||
_iv()
|
_iv()
|
||||||
@@ -165,7 +164,7 @@ void CipherKeyImpl::generateKey(
|
|||||||
// Now create the key and IV, using the digest set in the constructor.
|
// Now create the key and IV, using the digest set in the constructor.
|
||||||
int keySize = EVP_BytesToKey(
|
int keySize = EVP_BytesToKey(
|
||||||
_pCipher,
|
_pCipher,
|
||||||
_pDigest,
|
_pDigest ? _pDigest : EVP_md5(),
|
||||||
(salt.empty() ? 0 : saltBytes),
|
(salt.empty() ? 0 : saltBytes),
|
||||||
reinterpret_cast<const unsigned char*>(password.data()),
|
reinterpret_cast<const unsigned char*>(password.data()),
|
||||||
static_cast<int>(password.size()),
|
static_cast<int>(password.size()),
|
||||||
|
2
openssl
2
openssl
Submodule openssl updated: 91c24b8028...26b1673caa
Reference in New Issue
Block a user