summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2015-10-02 16:07:02 -0500
committerTimothy Pearson <[email protected]>2015-10-02 16:07:02 -0500
commit78e17a285caf43585f43ef2d7f3f970c4b79b2f5 (patch)
tree6380b4c3dd5cfead2f0b0298ae64ae23c5f26203 /src
parent5f90079891a07dc451111174baa8ca8a625d460e (diff)
downloadkcmldap-78e17a285caf43585f43ef2d7f3f970c4b79b2f5.tar.gz
kcmldap-78e17a285caf43585f43ef2d7f3f970c4b79b2f5.zip
Abort certificate load process on initial CA certificate retrieval failure
Diffstat (limited to 'src')
-rw-r--r--src/ldapbonding.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/ldapbonding.cpp b/src/ldapbonding.cpp
index abe4e95..f7ef751 100644
--- a/src/ldapbonding.cpp
+++ b/src/ldapbonding.cpp
@@ -283,13 +283,15 @@ void LDAPConfig::save() {
if (ldap_mgr->getTDECertificate("publicRootCertificate", KERBEROS_PKI_PUBLICDIR + m_realms[m_clientRealmConfig.defaultRealm].admin_server + ".ldap.crt", &errorstring) != 0) {
KMessageBox::sorry(this, i18n("<qt><b>Unable to obtain root certificate for realm %1!</b><p>Details: %2</qt>").arg(m_clientRealmConfig.defaultRealm.upper()).arg(errorstring), i18n("Unable to Obtain Certificate"));
}
- if (ldap_mgr->installCACertificateInHostCAStore(&errorstring) != 0) {
- KMessageBox::sorry(this, i18n("<qt><b>Unable to install root CA certificate for realm %1!</b><p>Details: %2</qt>").arg(m_clientRealmConfig.defaultRealm.upper()).arg(errorstring), i18n("Unable to Install Root CA"));
- }
+ else {
+ if (ldap_mgr->installCACertificateInHostCAStore(&errorstring) != 0) {
+ KMessageBox::sorry(this, i18n("<qt><b>Unable to install root CA certificate for realm %1!</b><p>Details: %2</qt>").arg(m_clientRealmConfig.defaultRealm.upper()).arg(errorstring), i18n("Unable to Install Root CA"));
+ }
- // Get and install the CA root CRL from LDAP
- if (ldap_mgr->retrieveAndInstallCaCrl(ldap_mgr, &errorstring) != 0) {
- KMessageBox::sorry(this, i18n("<qt><b>Unable to obtain root CRL for realm %1!</b><p>Details: %2</qt>").arg(m_clientRealmConfig.defaultRealm.upper()).arg(errorstring), i18n("Unable to Obtain CRL"));
+ // Get and install the CA root CRL from LDAP
+ if (ldap_mgr->retrieveAndInstallCaCrl(ldap_mgr, &errorstring) != 0) {
+ KMessageBox::sorry(this, i18n("<qt><b>Unable to obtain root CRL for realm %1!</b><p>Details: %2</qt>").arg(m_clientRealmConfig.defaultRealm.upper()).arg(errorstring), i18n("Unable to Obtain CRL"));
+ }
}
delete ldap_mgr;