qt5base-lts/tests/auto/network/ssl/qsslcertificate
Edward Welbourne b9557296cb Fix crash when reading a PKCS12 file with no private key
The only reason our code wants PKCS12 files is for a private key, but
a valid file needn't contain one; and reading a file without lead to a
crash in QSslKeyPrivate::fromEVP_PKEY().  So check for missing key and
fail the load, since the file is useless to us.  Also ensure the
caller's pkey is initialized, as we aren't promised that
PKCS12_parse() will set it when there is no private key.

Add a test for this case (it crashes without the fix) and update the
instructions for how to generate test data to cover it also.
(Corrected the wording there, too; at the interactive prompt,
"providing no password" really provides an empty password.)

Task-number: QTBUG-62335
Change-Id: I617508b903f6d9dee40d539b7136b0be8bc2c747
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2017-08-17 06:43:49 +00:00
..
certificates Updated license headers 2016-01-21 18:55:18 +00:00
more-certificates QSslCertificate: blacklist NIC certificates from India 2014-07-09 21:30:11 +02:00
pkcs12 Fix crash when reading a PKCS12 file with no private key 2017-08-17 06:43:49 +00:00
verify-certs
.gitignore
BLACKLIST Disable tst_QSslCertificate::subjectAndIssuerAttributes completely 2015-10-29 10:13:57 +00:00
qsslcertificate.pro QtNetwork: Remove Windows CE. 2016-03-29 20:28:18 +00:00
tst_qsslcertificate.cpp Fix crash when reading a PKCS12 file with no private key 2017-08-17 06:43:49 +00:00