summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2005-01-20 20:01:27 +0000
committerbnicholes <bnicholes@13f79535-47bb-0310-9956-ffa450edef68>2005-01-20 20:01:27 +0000
commitc2531495609229aebcad04189aadf489ec04d8ae (patch)
treebd8537a2f335ac6c67bee920421822f718c40c91
parent6fe98f1c118474081404f987892425494110828e (diff)
downloadlibapr-util-c2531495609229aebcad04189aadf489ec04d8ae.tar.gz
Add another certificate format type for the Novell LDAP SDK
git-svn-id: http://svn.apache.org/repos/asf/apr/apr-util/trunk@125808 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--include/apr_ldap_option.h4
-rw-r--r--ldap/apr_ldap_option.c12
2 files changed, 16 insertions, 0 deletions
diff --git a/include/apr_ldap_option.h b/include/apr_ldap_option.h
index 23afa1d2..24aaaa48 100644
--- a/include/apr_ldap_option.h
+++ b/include/apr_ldap_option.h
@@ -127,6 +127,10 @@ extern "C" {
#define APR_LDAP_KEY_TYPE_DER 11
/** PEM encoded private key */
#define APR_LDAP_KEY_TYPE_BASE64 12
+/** PKCS#12 encoded client certificate */
+#define APR_LDAP_CERT_TYPE_PFX 13
+/** PKCS#12 encoded private key */
+#define APR_LDAP_KEY_TYPE_PFX 14
/**
* Certificate structure.
diff --git a/ldap/apr_ldap_option.c b/ldap/apr_ldap_option.c
index 3f72a113..fccbb50a 100644
--- a/ldap/apr_ldap_option.c
+++ b/ldap/apr_ldap_option.c
@@ -434,6 +434,12 @@ static void option_set_cert(apr_pool_t *pool, LDAP *ldap,
(void*)ents[i].password);
result->msg = ldap_err2string(result->rc);
break;
+ case APR_LDAP_CERT_TYPE_PFX:
+ result->rc = ldapssl_set_client_cert((void *)ents[i].path,
+ LDAPSSL_FILETYPE_P12,
+ (void*)ents[i].password);
+ result->msg = ldap_err2string(result->rc);
+ break;
case APR_LDAP_KEY_TYPE_DER:
result->rc = ldapssl_set_client_private_key((void *)ents[i].path,
LDAPSSL_CERT_FILETYPE_DER,
@@ -446,6 +452,12 @@ static void option_set_cert(apr_pool_t *pool, LDAP *ldap,
(void*)ents[i].password);
result->msg = ldap_err2string(result->rc);
break;
+ case APR_LDAP_KEY_TYPE_PFX:
+ result->rc = ldapssl_set_client_private_key((void *)ents[i].path,
+ LDAPSSL_FILETYPE_P12,
+ (void*)ents[i].password);
+ result->msg = ldap_err2string(result->rc);
+ break;
default:
result->rc = -1;
result->reason = "LDAP: The Novell LDAP SDK only understands the "