if (PREF_GetBoolPref(ctrl->m_prefs, "security.enable_tls", &prefval) != PR_SUCCESS) { goto loser; } SSL_EnableDefault(SSL_ENABLE_TLS, prefval);
static SSMStatus ssm_enable_security_prefs(SSMControlConnection* ctrl){    PRBool prefval;    PRIntn ask;    PRIntn timeout;    PK11SlotInfo* slot = NULL;    PRBool ocspOn;    char *ocspURL = NULL, *ocspSigner = NULL;    PR_ASSERT((ctrl != NULL) && (ctrl->m_prefs != NULL));    /* enforce the user's preferences for SSL cipher families */    if (PREF_GetBoolPref(ctrl->m_prefs, "security.enable_ssl2", &prefval) !=         PR_SUCCESS) {        goto loser;    }    SSL_EnableDefault(SSL_ENABLE_SSL2, prefval);    if (PREF_GetBoolPref(ctrl->m_prefs, "security.enable_ssl3", &prefval) !=         PR_SUCCESS) {        goto loser;    }    SSL_EnableDefault(SSL_ENABLE_SSL3, prefval);    /* set password values */    if (PREF_GetIntPref(ctrl->m_prefs, "security.ask_for_password", &ask) !=        PR_SUCCESS) {        goto loser;    }    if (PREF_GetIntPref(ctrl->m_prefs, "security.password_lifetime",                         &timeout) != PR_SUCCESS) {        goto loser;    }    slot = PK11_GetInternalKeySlot();    PK11_SetSlotPWValues(slot, ssm_ask_pref_to_pk11((int)ask),                          (int)timeout);    PK11_FreeSlot(slot);    /* disable any additional ciphers that might be marked in prefs */    ssm_enable_ssl_cipher_prefs(ctrl);    ssm_enable_smime_cipher_prefs(ctrl);    /*     * Let's take care of OCSP prefs.     */    if (PREF_GetBoolPref(ctrl->m_prefs, "security.OCSP.enabled",                          &ocspOn) != SSM_SUCCESS   ||        !ocspOn) {        CERT_DisableOCSPChecking(ctrl->m_certdb);        CERT_DisableOCSPDefaultResponder(ctrl->m_certdb);    } else {        /* OCSP should be enabled */        CERT_EnableOCSPChecking(ctrl->m_certdb);        /* Do we have a default responder set? */        if (PREF_GetBoolPref(ctrl->m_prefs,               "security.OCSP.useDefaultResponder", &ocspOn) == SSM_SUCCESS &&            ocspOn) {            /* First let's make sure the default URL and              * signer have been set.              */            PREF_GetStringPref(ctrl->m_prefs, "security.OCSP.URL", &ocspURL);            PREF_GetStringPref(ctrl->m_prefs, "security.OCSP.signingCA",                               &ocspSigner);            if (ocspURL != NULL && ocspSigner != NULL) {                CERT_SetOCSPDefaultResponder(ctrl->m_certdb, ocspURL,                                              ocspSigner);                CERT_EnableOCSPDefaultResponder(ctrl->m_certdb);            }        }    }    return PR_SUCCESS;loser:    return PR_FAILURE;}