Commit 966e6e9b authored by Bradley Nicholes's avatar Bradley Nicholes
Browse files

Recognize the new certificate formats

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@125810 13f79535-47bb-0310-9956-ffa450edef68
parent f4535047
Loading
Loading
Loading
Loading
+2 −0
Changes for docs/manual/mod/mod_ldap.xml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -480,8 +480,10 @@ Certificate Authority or global client certificates</description>
      <li>CERT_BASE64 - PEM encoded client certificate</li>
      <li>CERT_KEY3_DB - Netscape key3.db client certificate database file</li>
      <li>CERT_NICKNAME - Client certificate "nickname" (Netscape SDK)</li>
      <li>CERT_PFX - PKCS#12 encoded client certificate (Novell SDK)</li>
      <li>KEY_DER - binary DER encoded private key</li>
      <li>KEY_BASE64 - PEM encoded private key</li>
      <li>KEY_PFX - PKCS#12 encoded private key (Novell SDK)</li>
    </ul>
</usage>
</directivesynopsis>
+13 −2
Changes for modules/ldap/util_ldap.c: 13 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -1381,6 +1381,11 @@ static const int util_ldap_parse_cert_type(const char *type) {
        return APR_LDAP_CERT_TYPE_BASE64;
    }

    /* Client cert file in PKCS#12 format */
    else if (0 == strcasecmp("CERT_PFX", type)) {
        return APR_LDAP_CERT_TYPE_PFX;
    }

    /* Netscape client cert database file/directory */
    else if (0 == strcasecmp("CERT_KEY3_DB", type)) {
        return APR_LDAP_CERT_TYPE_KEY3_DB;
@@ -1401,6 +1406,11 @@ static const int util_ldap_parse_cert_type(const char *type) {
        return APR_LDAP_KEY_TYPE_BASE64;
    }

    /* Client cert key file in PKCS#12 format */
    else if (0 == strcasecmp("KEY_PFX", type)) {
        return APR_LDAP_KEY_TYPE_PFX;
    }

    else {
        return APR_LDAP_CA_TYPE_UNKNOWN;
    }
@@ -1504,13 +1514,14 @@ static const char *util_ldap_set_trusted_client_cert(cmd_parms *cmd, void *confi
            return apr_psprintf(cmd->pool, "The certificate type \"%s\" is "
                                           "not recognised. It should be one "
                                           "of CERT_DER, CERT_BASE64, "
                                           "CERT_NICKNAME, "
                                           "KEY_DER, KEY_BASE64", type);
                                           "CERT_NICKNAME, CERT_PFX,"
                                           "KEY_DER, KEY_BASE64, KEY_PFX", type);
        }
        else if (APR_LDAP_CA_TYPE_DER == cert_type ||
                 APR_LDAP_CA_TYPE_BASE64 == cert_type ||
                 APR_LDAP_CA_TYPE_CERT7_DB == cert_type ||
                 APR_LDAP_CA_TYPE_SECMOD == cert_type ||
                 APR_LDAP_CERT_TYPE_PFX == cert_type ||
                 APR_LDAP_CERT_TYPE_KEY3_DB == cert_type) {
            return apr_psprintf(cmd->pool, "The certificate type \"%s\" is "
                                           "only valid within a "