Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Crypto/include/Poco/Crypto/EVPPKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class Crypto_API EVPPKey
if (pFile)
{
pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)0 : &passCB;
void* pPassword = pass.empty() ? (void*)0 : (void*)pass.c_str();
void* pPassword = (void*)pass.c_str();
if (readFunc(pFile, &pKey, pCB, pPassword))
{
fclose(pFile); pFile = 0;
Expand Down Expand Up @@ -302,7 +302,7 @@ class Crypto_API EVPPKey
if (pKey)
{
pem_password_cb* pCB = pass.empty() ? (pem_password_cb*)0 : &passCB;
void* pPassword = pass.empty() ? (void*)0 : (void*)pass.c_str();
void* pPassword = (void*)pass.c_str();
if (readFunc(pBIO, &pKey, pCB, pPassword))
{
BIO_free(pBIO); pBIO = 0;
Expand Down
9 changes: 9 additions & 0 deletions Crypto/testsuite/src/EVPTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,15 @@ void EVPTest::testECEVPSaveLoadFile()
key3.save(&strPub3);
std::string pubFromPrivate = strPub3.str();
assertTrue (pubFromPrivate == pubKey);

// Create new key with empty password
EVPPKey key4(curveName);

key4.save(filePub.path(), filePriv.path(), "");

// Load key from file with empty password.
// No input string should be prompted
EVPPKey key4LoadEmptyPass { "", filePriv.path(), "" };
}
else
std::cerr << "No elliptic curves found!" << std::endl;
Expand Down
Loading