Skip to content

Commit

Permalink
[auth] Return immediate errors for null cert/key when validating bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
dakcarto committed Oct 27, 2017
1 parent 671ce63 commit 4b9898b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/core/auth/qgsauthcertutils.cpp
Expand Up @@ -1331,6 +1331,16 @@ QList<QSslError> QgsAuthCertUtils::validateCertChain( const QList<QSslCertificat
QStringList QgsAuthCertUtils::validatePKIBundle( QgsPkiBundle &bundle, bool useIntermediates, bool trustRootCa )
{
QStringList errors;
if ( bundle.clientCert().isNull() )
errors << QObject::tr( "Client certificate is NULL." );

if ( bundle.clientKey().isNull() )
errors << QObject::tr( "Client certificate key is NULL." );

// immediately bail out if cert or key is NULL
if ( !errors.isEmpty() )
return errors;

QList<QSslError> sslErrors;
if ( useIntermediates )
{
Expand Down

0 comments on commit 4b9898b

Please sign in to comment.