test(Crypto): add empty password test for EVPPKey constructor

This commit is contained in:
nyashbox 2024-12-02 04:35:34 +02:00
parent 758310f304
commit 45d387d4a3
No known key found for this signature in database
GPG Key ID: B40E74A291D1DFA4

View File

@ -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;