Commit 39f618b8 authored by Michal Klocek's avatar Michal Klocek
Browse files

Fixes generated RSA private key in OpenSSL format with no crypt option



* adds missing fields dmp1, dmq1 and iqmp to RSA structure
* verified with openssl 1.0.1

Change-Id: I2891cd04303f7b44bbe24a844b2d74669c07f521
Reviewed-by: default avatarChristian Kandeler <christian.kandeler@digia.com>
parent ed929630
......@@ -151,6 +151,10 @@ void SshKeyGenerator::generateOpenSslPrivateKeyString(const KeyPtr &key)
= key.dynamicCast<RSA_PrivateKey>();
params << rsaKey->get_n() << rsaKey->get_e() << rsaKey->get_d() << rsaKey->get_p()
<< rsaKey->get_q();
const BigInt dmp1 = rsaKey->get_d() % (rsaKey->get_p() - 1);
const BigInt dmq1 = rsaKey->get_d() % (rsaKey->get_q() - 1);
const BigInt iqmp = inverse_mod(rsaKey->get_q(), rsaKey->get_p());
params << dmp1 << dmq1 << iqmp;
keyId = SshCapabilities::PubKeyRsa;
label = "RSA PRIVATE KEY";
} else {
......
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