I made some small changes in that procedure of the patch I sent, for LDAP
client cert status check:

/*
 * Giacob: ldap cert status check
 */
void ldap_check_hook(request_rec *r, X509 *xs,  SSLSrvConfigRec *sc,
conn_rec *conn)
{
    RESPONSE_FILE *response = NULL;
    STRTBL *table;
    X509_NAME *xn_s;
    X509_NAME *xn_i;
    LDAP_FILE *ldap;
    pool *buf_pool;

    buf_pool=ap_make_sub_pool(r->pool);

    xn_s = X509_get_subject_name(xs);
    xn_i = X509_get_issuer_name(xs);

    ldap = (LDAP_FILE *)ap_palloc(buf_pool, (sizeof(LDAP_FILE)));
    if (ldap == NULL) {
        ssl_log(r->server, SSL_LOG_ERROR, "Allocation memory error");
        response->rsp_status = OCSP_RESPONSE_STATUS_INTERNALERROR;
        response->cert_file->status = V_OCSP_CERTSTATUS_UNKNOWN;
        table = &respStatus[response->rsp_status];
        ap_ctx_set(conn->client->ctx, "ssl::ocsp::resp::status", table->m);
        table = &certStatus[response->cert_file->status];
        ap_ctx_set(conn->client->ctx, "ssl::ocsp::cert::status", table->m);
        return;
    }
    else {
        ldap->servers = sc->ldapServers;
        ldap->base_dn = sc->ldapBaseDn;
        ldap->user = sc->ldapUser;
        ldap->pwd = sc->ldapPwd;
    }

    if (X509_name_cmp(xn_i, xn_s) < 0) {
        response = ocsp_responder_hook (r, xs, ldap);
        if (response != NULL) {
            table = &respStatus[response->rsp_status];
            ap_ctx_set(conn->client->ctx, "ssl::ocsp::resp::status",
table->m);
            table = &certStatus[response->cert_file->status];
            ap_ctx_set(conn->client->ctx, "ssl::ocsp::cert::status",
table->m);
        }
    }
    free(ldap);
return;
}

Sorry last minute changes,
Andrea


______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to