mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-04 15:39:34 +01:00
Fix removing encrypted ASN.1 keys from ssh-agent (#6804)
Contents of id_rsa-encrypted-asn1 are from TestOpenSSHKey::testDecryptRSAAES128CBC(). Closes #6788
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
*/
|
||||
|
||||
#include "TestSSHAgent.h"
|
||||
#include "config-keepassx-tests.h"
|
||||
#include "core/Config.h"
|
||||
#include "crypto/Crypto.h"
|
||||
#include "sshagent/KeeAgentSettings.h"
|
||||
@@ -211,6 +212,18 @@ void TestSSHAgent::testConfirmConstraint()
|
||||
QVERIFY(agent.checkIdentity(m_key, keyInAgent) && !keyInAgent);
|
||||
}
|
||||
|
||||
void TestSSHAgent::testToOpenSSHKey()
|
||||
{
|
||||
KeeAgentSettings settings;
|
||||
settings.setSelectedType("file");
|
||||
settings.setFileName(QString("%1/id_rsa-encrypted-asn1").arg(QString(KEEPASSX_TEST_DATA_DIR)));
|
||||
|
||||
OpenSSHKey key;
|
||||
settings.toOpenSSHKey("username", "correctpassphrase", QString(), nullptr, key, false);
|
||||
|
||||
QVERIFY(!key.publicKey().isEmpty());
|
||||
}
|
||||
|
||||
void TestSSHAgent::cleanupTestCase()
|
||||
{
|
||||
if (m_agentProcess.state() != QProcess::NotRunning) {
|
||||
|
||||
Reference in New Issue
Block a user