summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslkey_p.h
diff options
context:
space:
mode:
authorAndré Klitzing <aklitzing@gmail.com>2015-01-19 12:53:01 +0100
committerAndré Klitzing <aklitzing@gmail.com>2015-02-11 21:00:04 +0000
commit2688725eb73234a8870411017f85ec2fda6c80cd (patch)
treef77ce4f090c2d4601501acefcfa17895b5032d1c /src/network/ssl/qsslkey_p.h
parent2af127763194c13c3f7ccce507c94eb2de6dbefe (diff)
Use a union for different openssl types
Since the algorithm can only be one the underlying structure can share the same memory. Change-Id: Ifeaa1a2d5c4ad3566cbbf847445b805876275260 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.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.h17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/network/ssl/qsslkey_p.h b/src/network/ssl/qsslkey_p.h
index f557831c2c..acd16044e8 100644
--- a/src/network/ssl/qsslkey_p.h
+++ b/src/network/ssl/qsslkey_p.h
@@ -62,13 +62,6 @@ class QSslKeyPrivate
public:
inline QSslKeyPrivate()
: opaque(0)
-#ifndef QT_NO_OPENSSL
- , rsa(0)
- , dsa(0)
-#ifndef OPENSSL_NO_EC
- , ec(0)
-#endif
-#endif
{
clear();
}
@@ -97,12 +90,14 @@ public:
QSsl::KeyType type;
QSsl::KeyAlgorithm algorithm;
#ifndef QT_NO_OPENSSL
- EVP_PKEY *opaque;
- RSA *rsa;
- DSA *dsa;
+ union {
+ EVP_PKEY *opaque;
+ RSA *rsa;
+ DSA *dsa;
#ifndef OPENSSL_NO_EC
- EC_KEY *ec;
+ EC_KEY *ec;
#endif
+ };
#else
enum Cipher {
DesCbc,