summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslkey_p.h
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2014-09-01 11:13:17 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2015-07-20 15:51:02 +0000
commit49fee77ccc68424758823dd2579e731e4ef4073f (patch)
tree2df39e42b8e538bfb6350afb859f59c437168bcd /src/network/ssl/qsslkey_p.h
parenta92a72dd11667fe37639f6a18896b66f1cccf6da (diff)
ssl: add openssl-based QSslKeyPrivate::encrypt / decrypt
This adds an OpenSSL-based implementation of the QSslKeyPrivate encrypt and decrypt method. This puts both the OpenSSL-based and non-OpenSSL backends (WinRT for now) on par. Change-Id: I18a75ee5f1c223601e51ebf0933f4430e7c5c29b Reviewed-by: Andrew Knight <andrew.knight@intopalo.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.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/network/ssl/qsslkey_p.h b/src/network/ssl/qsslkey_p.h
index be981bb484..fea0e30bbc 100644
--- a/src/network/ssl/qsslkey_p.h
+++ b/src/network/ssl/qsslkey_p.h
@@ -90,6 +90,16 @@ public:
bool isNull;
QSsl::KeyType type;
QSsl::KeyAlgorithm algorithm;
+
+ enum Cipher {
+ DesCbc,
+ DesEde3Cbc,
+ Rc2Cbc
+ };
+
+ Q_AUTOTEST_EXPORT static QByteArray decrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
+ Q_AUTOTEST_EXPORT static QByteArray encrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
+
#ifndef QT_NO_OPENSSL
union {
EVP_PKEY *opaque;
@@ -100,15 +110,6 @@ public:
#endif
};
#else
- enum Cipher {
- DesCbc,
- DesEde3Cbc,
- Rc2Cbc
- };
-
- Q_AUTOTEST_EXPORT static QByteArray decrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
- Q_AUTOTEST_EXPORT static QByteArray encrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv);
-
Qt::HANDLE opaque;
QByteArray derData;
int keyLength;