Changeset View
Changeset View
Standalone View
Standalone View
src/core/ksslcertificatemanager.cpp
Show First 20 Lines • Show All 500 Lines • ▼ Show 20 Line(s) | 500 | { | |||
---|---|---|---|---|---|
501 | QMutexLocker certLocker(&d->certListMutex); | 501 | QMutexLocker certLocker(&d->certListMutex); | ||
502 | if (!d->isCertListLoaded) { | 502 | if (!d->isCertListLoaded) { | ||
503 | d->loadDefaultCaCertificates(); | 503 | d->loadDefaultCaCertificates(); | ||
504 | } | 504 | } | ||
505 | return d->defaultCaCertificates; | 505 | return d->defaultCaCertificates; | ||
506 | } | 506 | } | ||
507 | 507 | | |||
508 | //static | 508 | //static | ||
509 | QList<KSslError> KSslCertificateManager::nonIgnorableErrors(const QList<KSslError> &/*e*/) | 509 | QList<KSslError> KSslCertificateManager::nonIgnorableErrors(const QList<KSslError> &errors) | ||
510 | { | 510 | { | ||
511 | QList<KSslError> ret; | 511 | QList<KSslError> ret; | ||
512 | // ### add filtering here... | 512 | // errors not handled in KSSLD | ||
513 | std::copy_if(errors.begin(), errors.end(), std::back_inserter(ret), [](const KSslError &e) { | ||||
514 | return e.error() == KSslError::NoPeerCertificate || e.error() == KSslError::PathLengthExceeded; | ||||
515 | }); | ||||
513 | return ret; | 516 | return ret; | ||
514 | } | 517 | } | ||
515 | 518 | | |||
516 | //static | 519 | //static | ||
517 | QList<KSslError::Error> KSslCertificateManager::nonIgnorableErrors(const QList<KSslError::Error> &/*e*/) | 520 | QList<KSslError::Error> KSslCertificateManager::nonIgnorableErrors(const QList<KSslError::Error> &errors) | ||
518 | { | 521 | { | ||
519 | QList<KSslError::Error> ret; | 522 | QList<KSslError::Error> ret; | ||
520 | // ### add filtering here... | 523 | // errors not handled in KSSLD | ||
524 | std::copy_if(errors.begin(), errors.end(), std::back_inserter(ret), [](const KSslError::Error &e) { | ||||
525 | return e == KSslError::NoPeerCertificate || e == KSslError::PathLengthExceeded; | ||||
526 | }); | ||||
521 | return ret; | 527 | return ret; | ||
522 | } | 528 | } | ||
523 | 529 | | |||
524 | QList<QSslError> KSslCertificateManager::nonIgnorableErrors(const QList<QSslError> &errors) | 530 | QList<QSslError> KSslCertificateManager::nonIgnorableErrors(const QList<QSslError> &errors) | ||
525 | { | 531 | { | ||
526 | Q_UNUSED(errors) | 532 | QList<QSslError> ret; | ||
527 | // ### add filtering here... | 533 | // errors not handled in KSSLD | ||
534 | std::copy_if(errors.begin(), errors.end(), std::back_inserter(ret), [](const QSslError &e) { | ||||
535 | return e.error() == QSslError::NoPeerCertificate || e.error() == QSslError::PathLengthExceeded || e.error() == QSslError::NoSslSupport; | ||||
536 | }); | ||||
528 | return {}; | 537 | return {}; | ||
apol: `return ret; ` ;) | |||||
529 | } | 538 | } | ||
530 | 539 | | |||
531 | QList<KSslCaCertificate> _allKsslCaCertificates(KSslCertificateManager *cm) | 540 | QList<KSslCaCertificate> _allKsslCaCertificates(KSslCertificateManager *cm) | ||
532 | { | 541 | { | ||
533 | return KSslCertificateManagerPrivate::get(cm)->allCertificates(); | 542 | return KSslCertificateManagerPrivate::get(cm)->allCertificates(); | ||
534 | } | 543 | } | ||
535 | 544 | | |||
536 | void _setAllKsslCaCertificates(KSslCertificateManager *cm, const QList<KSslCaCertificate> &certsIn) | 545 | void _setAllKsslCaCertificates(KSslCertificateManager *cm, const QList<KSslCaCertificate> &certsIn) | ||
537 | { | 546 | { | ||
538 | KSslCertificateManagerPrivate::get(cm)->setAllCertificates(certsIn); | 547 | KSslCertificateManagerPrivate::get(cm)->setAllCertificates(certsIn); | ||
539 | } | 548 | } | ||
540 | 549 | | |||
541 | #include "moc_kssld_interface.cpp" | 550 | #include "moc_kssld_interface.cpp" |
return ret; ;)