Commit 344e00aa authored by Christian Kandeler's avatar Christian Kandeler

SSH: Fix PKCS8 key reading.

Change-Id: I68db752269119cc4231151991eadf5ba176f056e
Reviewed-on: http://codereview.qt.nokia.com/2348Reviewed-by: default avatarChristian Kandeler <christian.kandeler@nokia.com>
parent aa311475
......@@ -228,11 +228,13 @@ void SshEncryptionFacility::createAuthenticationKeyFromPKCS8(const QByteArray &p
privKeyFileContents.size());
Private_Key * const key = PKCS8::load_key(pipe, m_rng);
if (DSA_PrivateKey * const dsaKey = dynamic_cast<DSA_PrivateKey *>(key)) {
m_authKeyAlgoName = SshCapabilities::PubKeyDss;
m_authKey.reset(dsaKey);
pubKeyParams << dsaKey->group_p() << dsaKey->group_q()
<< dsaKey->group_g() << dsaKey->get_y();
allKeyParams << pubKeyParams << dsaKey->get_x();
} else if (RSA_PrivateKey * const rsaKey = dynamic_cast<RSA_PrivateKey *>(key)) {
m_authKeyAlgoName = SshCapabilities::PubKeyRsa;
m_authKey.reset(rsaKey);
pubKeyParams << rsaKey->get_e() << rsaKey->get_n();
allKeyParams << pubKeyParams << rsaKey->get_p() << rsaKey->get_q()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment