diff options
author | Jeremy Lainé <jeremy.laine@m4x.org> | 2014-08-28 23:56:03 +0200 |
---|---|---|
committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2014-08-29 23:18:22 +0200 |
commit | 6a4cb8d62b9ba68666e6d89f101a571da18432cb (patch) | |
tree | 8358e64d66d90cabc2998ac1836ba0c830f31829 /src/network/ssl/qsslkey_p.h | |
parent | def5a56b0316edcf95693c86e86b80b338fbbba4 (diff) |
ssl: Add common key parser for backends
This internal implementation of QSslKey can be used when OpenSSL is not
available. Encrypted keys are not supported, as the cryptography must
be supplied by a separate library.
With this commit, WinRT is migrated to the new implementation,
but qsslkey_winrt.cpp is left in place so that the missing crypto
implementation can be added later. This also means most of the expected
failures for that platform can be removed from the autotest.
Change-Id: I24a3ad1053bb72311613b28b3ae845aa1645a321
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
Diffstat (limited to 'src/network/ssl/qsslkey_p.h')
-rw-r--r-- | src/network/ssl/qsslkey_p.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/network/ssl/qsslkey_p.h b/src/network/ssl/qsslkey_p.h index e12bbadc06..64a157ba09 100644 --- a/src/network/ssl/qsslkey_p.h +++ b/src/network/ssl/qsslkey_p.h @@ -61,10 +61,6 @@ #ifndef QT_NO_OPENSSL #include <openssl/rsa.h> #include <openssl/dsa.h> -#else -struct RSA; -struct DSA; -struct EVP_PKEY; #endif QT_BEGIN_NAMESPACE @@ -73,9 +69,11 @@ class QSslKeyPrivate { public: inline QSslKeyPrivate() - : rsa(0) + : opaque(0) +#ifndef QT_NO_OPENSSL + , rsa(0) , dsa(0) - , opaque(0) +#endif { clear(); } @@ -85,7 +83,9 @@ public: void clear(bool deep = true); +#ifndef QT_NO_OPENSSL bool fromEVP_PKEY(EVP_PKEY *pkey); +#endif void decodeDer(const QByteArray &der, const QByteArray &passPhrase, bool deepClear = true); void decodePem(const QByteArray &pem, const QByteArray &passPhrase, @@ -102,9 +102,15 @@ public: bool isNull; QSsl::KeyType type; QSsl::KeyAlgorithm algorithm; +#ifndef QT_NO_OPENSSL + EVP_PKEY *opaque; RSA *rsa; DSA *dsa; - EVP_PKEY *opaque; +#else + Qt::HANDLE opaque; + QByteArray derData; + int keyLength; +#endif QAtomicInt ref; |