-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.0, 5.9.1, 5.9.2
-
None
When building a QSslKey from a handle (the handle referring to an openssl EVP_PKEY) in Qt 5.9.*, the algorithm is not always set to QSsl::Opaque.
We have the case where we build a QSslKey from an EVP_PKEY which is a private key on a smartcard (accessed via p11) and with Qt 5.9.*, when we return that QSslKey from a method, the algorithm is set to QSsl::Rsa. This is an issue because when we call the handle() method on the QSslKey, we get a dummy RSA key that we can't use with the p11 interface anymore.
Please note that 5.7.0 and 5.7.1 didn't have this issue.
With the following code:
QSslKey loadKey()
{
EVP_PKEY *k = NULL;
QSslKey key;
// Load k
// k = ENGINE_load_private_key(...);
key = QSslKey(Qt::HANDLE(k));
return key;
}
void sign()
{
QSslKey key;
// ...
key = loadKey();
qDebug() << key;
}
We get the following output when building with Qt 5.9.2:
QSslKey(PrivateKey, RSA, 2048)
And the following output when building with Qt 5.7.1 (expected behavior):
QSslKey(PrivateKey, OPAQUE, -1)
See comment below and attachments for a minimal, complete, and verifiable example.
| For Gerrit Dashboard: QTBUG-64495 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V |
| 226467,1 | WIP Allow initialization of QsslKeys as Qssl::Opaque | dev | qt/qtbase | Status: NEW | -2 | 0 |