qt5base-lts/tests/auto
Marc Mutz e8bdc949fc Add qHash(QSslCertificate) overload
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>
2014-10-19 07:32:37 +02:00
..
android Update license headers and add new license files 2014-09-24 12:26:19 +02:00
bic/data test: Add 5.1.0 bic data for linux-gcc-ia32 2013-07-08 21:47:36 +02:00
cmake Update license headers and add new license files 2014-09-24 12:26:19 +02:00
compilerwarnings/data Update copyright year in Digia's license headers 2013-01-18 09:07:35 +01:00
concurrent Update license headers and add new license files 2014-09-24 12:26:19 +02:00
corelib QSettings: Prevent assert when passing empty keys. 2014-10-17 14:55:45 +02:00
dbus Update license headers and add new license files 2014-09-24 12:26:19 +02:00
gui Fix memory leak in QClipboard::setMimeData() 2014-10-10 13:37:59 +02:00
guiapplauncher Update the documentation after moving examples. 2011-07-05 21:19:08 +02:00
installed_cmake Add a unit test for testing Qt in its install location. 2013-07-02 23:08:54 +02:00
network Add qHash(QSslCertificate) overload 2014-10-19 07:32:37 +02:00
opengl Update license headers and add new license files 2014-09-24 12:26:19 +02:00
other Gcc 4.5.* build fix. 2014-10-10 13:20:30 +02:00
printsupport Update license headers and add new license files 2014-09-24 12:26:19 +02:00
shared Update license headers and add new license files 2014-09-24 12:26:19 +02:00
sql Expose QSqlDriverPrivate dbmsType in public QSqlDriver api 2014-09-24 14:44:49 +02:00
testlib Update license headers and add new license files 2014-09-24 12:26:19 +02:00
tools Silence moc warnings about 'argument mismatch' 2014-09-25 15:42:40 +02:00
widgets Merge "Merge remote-tracking branch 'origin/5.3' into 5.4" into refs/staging/5.4 2014-10-18 13:24:33 +02:00
xml Update license headers and add new license files 2014-09-24 12:26:19 +02:00
auto.pro iOS: Enable building of basic tests 2014-01-22 12:35:17 +01:00
network-settings.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
qtest-config.h Update license headers and add new license files 2014-09-24 12:26:19 +02:00
test.pl Update license headers and add new license files 2014-09-24 12:26:19 +02:00