diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-03-04 16:11:20 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-03-08 05:36:14 +0000 |
commit | 01a54342521de9994ef54f4a01916b8782c685f6 (patch) | |
tree | 0e461db5863612954c47385f0fb1f61c87b36cb3 /src/network/ssl/qsslkey_openssl.cpp | |
parent | f91aae6397378f7f86a3dd320f4e2caa3843a5de (diff) |
QSslKey - add a support for AES encrypted keys
for SecureTransport backend. OpenSSL, while reading
RSA/DSA, is internally calling EVP_BytesToKey that
essentially does the same thing this patch does in
'deriveAesKey' and thus able to correctly decrypt
whatever it first encrypted (while generating/
encrypting keys).
Fixes: QTBUG-54422
Change-Id: Ia9f7599c5b19bf364c179f2abd2aab7ea5359a65
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/ssl/qsslkey_openssl.cpp')
-rw-r--r-- | src/network/ssl/qsslkey_openssl.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/network/ssl/qsslkey_openssl.cpp b/src/network/ssl/qsslkey_openssl.cpp index 99c1a39c73..dfb80bd829 100644 --- a/src/network/ssl/qsslkey_openssl.cpp +++ b/src/network/ssl/qsslkey_openssl.cpp @@ -333,6 +333,14 @@ static QByteArray doCrypt(QSslKeyPrivate::Cipher cipher, const QByteArray &data, type = q_EVP_rc2_cbc(); #endif break; + case QSslKeyPrivate::Aes128Cbc: + case QSslKeyPrivate::Aes192Cbc: + case QSslKeyPrivate::Aes256Cbc: + // Just to avoid compiler warnings/errors. OpenSSL uses a different + // codepath when reading encrypted keys, and they all correctly + // deduce the cipher and know how to derive a key. + Q_UNREACHABLE(); + break; } if (type == nullptr) |