summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslcertificate_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QSslCertificatePrivate: make use of QByteArray::toHex(separator)Andre Hartmann2017-07-101-11/+6
| | | | | | | | | | Qt 5.9 introduced a QByteArray::toHex() overload that inserts a separator char after each byte. The function colonSeparatedHex() could not be replaced completely, as it skips leading zeros also. Change-Id: Ic1d5d4771a0a5171f0e7e9813b83eb4c1f59f085 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Prospective MSVC 2013 build fixSimon Hausmann2016-05-101-2/+4
| | | | | | | MSVC 2013 does not like QStringLiteral between brackets. Change-Id: Ic42f80b7a3abbb48df3d0e222bd5c868045a0ded Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* QtNetwork: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-05-041-2/+4
| | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I42c9c44d948ab1512a69d42890187bc3cf2d7e58 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtNetwork: use const (and const APIs) moreAnton Kudryavtsev2016-04-271-2/+2
| | | | | | | | | | | For CoW types, prefer const methods to avoid needless detach()ing. Mark predictNextRequest() as const, because this method does not modify the object. Change-Id: Ic94e2b31445ece46ab1423bf5b5f4e66d9a5b6ca Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* ssl: add support for EC keys to non-OpenSSL backendsJeremy Lainé2015-07-311-0/+2
| | | | | | | | Adds basic support for QSslKey reading / writing Elliptic Curve keys on backends other than OpenSSL (i.e. WinRT / SecureTransport for now). Change-Id: I67012dbe6b844a3ed5b22b63e0cdbacf0497a74a Reviewed-by: Richard J. Moore <rich@kde.org>
* ssl: fix native parsing of certificates with DSA keysJeremy Lainé2015-07-281-1/+1
| | | | | | | | Fixes a typo which breaks the parsing of certificates with DSA public keys when using a non-OpenSSL backend (WinRT, SecureTransport). Change-Id: I250ba9948d5bd7739e281d7cd1b95cfbcb10e402 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Move Rfc822NameType, DnsNameType and UniformResourceIdentifierType.Richard J. Moore2015-02-041-15/+8
| | | | | | | | | Move these types to QAsn1Element so that they can use the toString() method which guards against malicious ASN.1. Change-Id: I7d6155147a6fc2d41da6f3ae87551b6cb75aa9ce Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com> Reviewed-by: Daniel Molkentin <daniel@molkentin.de>
* Add missing qdatastream.h includes.Richard J. Moore2015-01-051-0/+2
| | | | | Change-Id: I726041ec5e92d371bc5afb9b7f8cb854bfd41451 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix include headers for qsslcertificate_qt.cppThiago Macieira2014-12-231-2/+2
| | | | | | | | | | | | The order is: 1) own header 2) own private header, if any 3) other headers Commit f17d7a124f0fa817a7e1a2dda6f48098432c0dc0 broke the order. Change-Id: I7225024691db91fd936a057accdad65bacb3f979 Reviewed-by: Richard J. Moore <rich@kde.org>
* Use categorized logging for ssl codeKai Koehne2014-12-101-3/+4
| | | | | | | | | Place all debug output into the 'qt.network.ssl' category. This allows people to disable certain warnings at runtime. Task-number: QTBUG-43173 Change-Id: Ide731fae3109f9cd7730cc096ee069a5b99d35f1 Reviewed-by: Richard J. Moore <rich@kde.org>
* Add qHash(QSslCertificate) overloadMarc Mutz2014-10-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qsslsocket_winrt.cpp defined it locally, which runs the risk of clashes with a potential user-defined qHash(QSslCertificate), so make it public. Also, the implementation in qsslsocket_winrt.cpp simply hashed the handle(), which violates the principle that equal instances must hash to the same value. Also, for some platforms, the implementation returns nullptr unconditionally, which, while not violating the above-mentioned principle, will make all users of the hash have worst-case complexity. To calculate a meaningful hash, therefore, the certificate needs to be inspected deeper than just the handle. For OpenSSL, we use X509::sha1_hash, which also X509_cmp uses internally to determine inequality (it checks more stuff, but if X059::sha1_hash is different, X509_cmp() returns non-zero, which is sufficient for the purposes of qHash()). sha1_hash may not be up-to-date, though, so we call X509_cmp to make it valid. Ugh. For WinRT/Qt, we use the DER encoding, as that is the native storage format used in QSslCertificate. This is not equivalent to the implementation used in qsslsocket_winrt.cpp before, but since handle() == handle() => toDer() == toDer(), it should not be a problem. [ChangeLog][QtNetwork][QSslCertificate] Can now be used as a key in QSet/QHash. Change-Id: I10858fe648c70fc9535af6913dd3b7f3b2cf0eba Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Don't use QByteArrayLiteral in comparisonsMarc Mutz2014-10-091-4/+4
| | | | | | | | | | | | | | | For const char*s, operator== is overloaded, so comparing to a (C) string literal is efficient, since qstrcmp doesn't require the length of the strings to compare. OTOH, QByteArrayLiteral, when not using RVO, litters the code with QByteArray dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare with a (C) string literal instead. Change-Id: Id3bfdc89558ba51911f6317a7a73c287f96e6f24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSslCertificate: fold a string literal correctlyMarc Mutz2014-09-281-2/+2
| | | | | Change-Id: I8f812002302d3b74af252fa66e9e13154bbf80e1 Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* ssl: common certificate parser support for extensionsJeremy Lainé2014-09-051-2/+254
| | | | | | | | | | | | This makes non-OpenSSL backends able to handle to certificate extensions. This also converts the Q_OS_WINRT #ifdef's in the unit test to QT_NO_OPENSSL as the behavior is the same for any non-OpenSSL backend. Change-Id: I6a8306dc5c97a659ec96063d5a59cee2ee9a63a9 Reviewed-by: Richard J. Moore <rich@kde.org>
* ssl: disable (broken) i/o on DER encoded keysJeremy Lainé2014-08-301-1/+1
| | | | | | | | | | | | | | | | | | | | | QSslKey currently has methods which supposedly allow decoding and encoding private keys as DER protected by a passphrase. This is broken by design as explained in QTBUG-41038, as storing the encrypted DER data alone makes no sense: such a file lacks the necessary information about the encryption algorithm and initialization vector. This change: - explicitly stops using the passphrase when decoding DER in the constructor. The behavior is unchanged, it is not possible to read the encrypted DER alone. - refuses to honor the passphrase to DER encode a private key. The toDer method now outputs an empty QByteArray instead of garbage. Task-number: QTBUG-41038 Change-Id: I4281050cf1104f12d154db201a173633bfe22bd9 Reviewed-by: Richard J. Moore <rich@kde.org>
* winrt: complete QSslCertificate implementationOliver Wolff2014-08-301-0/+2
| | | | | | | | | The native handle and import functions are now available for use in other parts of the winrt backend. Change-Id: I07e6f95b3411c3dc7c1a7a164544b18e5e435d01 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Added qsslcertificate_qt.cppOliver Wolff2014-08-261-0/+264
Having QAsn1Element in place, we can have a common foundation for the ssl certificate class for upcoming ports like WinRT and SecureTransport. The only thing that has to be added to the existing class is the handle() functionality. Change-Id: I560a8e412b26f350855c7bc456fcdb8e9b750939 Reviewed-by: Richard J. Moore <rich@kde.org>