Skip to content

Commit 4b9898b

Browse files
committedOct 27, 2017
[auth] Return immediate errors for null cert/key when validating bundle
1 parent 671ce63 commit 4b9898b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed
 

‎src/core/auth/qgsauthcertutils.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,6 +1331,16 @@ QList<QSslError> QgsAuthCertUtils::validateCertChain( const QList<QSslCertificat
13311331
QStringList QgsAuthCertUtils::validatePKIBundle( QgsPkiBundle &bundle, bool useIntermediates, bool trustRootCa )
13321332
{
13331333
QStringList errors;
1334+
if ( bundle.clientCert().isNull() )
1335+
errors << QObject::tr( "Client certificate is NULL." );
1336+
1337+
if ( bundle.clientKey().isNull() )
1338+
errors << QObject::tr( "Client certificate key is NULL." );
1339+
1340+
// immediately bail out if cert or key is NULL
1341+
if ( !errors.isEmpty() )
1342+
return errors;
1343+
13341344
QList<QSslError> sslErrors;
13351345
if ( useIntermediates )
13361346
{

0 commit comments

Comments
 (0)
Please sign in to comment.