SSH Agent: Fix invalid iqmp output for RSA keys

This fixes loading RSA keys to Pageant.
This commit is contained in:
Toni Spets 2018-05-20 09:49:47 +03:00 committed by Jonathan White
parent 9805f2331d
commit 8c70856a82
3 changed files with 87 additions and 3 deletions

View file

@ -102,14 +102,14 @@ namespace {
mpi_invm(u, q, p);
iqmp_hex.resize((bap.length() + 1) * 2);
gcry_mpi_print(GCRYMPI_FMT_HEX, reinterpret_cast<unsigned char*>(iqmp_hex.data()), iqmp_hex.length(), nullptr, u);
iqmp_hex.resize(bap.length() * 2);
gcry_mpi_print(GCRYMPI_FMT_HEX, reinterpret_cast<unsigned char*>(iqmp_hex.data()), iqmp_hex.size(), nullptr, u);
gcry_mpi_release(u);
gcry_mpi_release(p);
gcry_mpi_release(q);
return QByteArray::fromHex(iqmp_hex);
return QByteArray::fromHex(QString(iqmp_hex).toLatin1());
}
}