From fcf9f451a56b90662124254349b3885cf0552544 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 11 Mar 2002 03:39:08 +0000 Subject: [PATCH] Copyright 2001, Adrian Thurston, All rights reserved. This software is not subject to any license of Xandros Corporation. This is free software; you can redistribute and use it under the same terms as OpenLDAP itself. ------------------------------------------------------------------- This patch adds an option to ldap_get_option which can be called after ldap_start_tls in order to obtain the pointer to the SSL object used --- include/ldap.h | 1 + libraries/libldap/tls.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/include/ldap.h b/include/ldap.h index 385419e191..25b5294626 100644 --- a/include/ldap.h +++ b/include/ldap.h @@ -122,6 +122,7 @@ LDAP_BEGIN_DECL /* #define LDAP_OPT_X_TLS_PROTOCOL 0x6007 */ #define LDAP_OPT_X_TLS_CIPHER_SUITE 0x6008 #define LDAP_OPT_X_TLS_RANDOM_FILE 0x6009 +#define LDAP_OPT_X_TLS_SSL_CTX 0x600a #define LDAP_OPT_X_TLS_NEVER 0 #define LDAP_OPT_X_TLS_HARD 1 diff --git a/libraries/libldap/tls.c b/libraries/libldap/tls.c index 8d5bd36670..be701e561f 100644 --- a/libraries/libldap/tls.c +++ b/libraries/libldap/tls.c @@ -1024,6 +1024,18 @@ ldap_pvt_tls_get_option( LDAP *ld, int option, void *arg ) *(char **)arg = tls_opt_randfile ? LDAP_STRDUP( tls_opt_randfile ) : NULL; break; + case LDAP_OPT_X_TLS_SSL_CTX: { + void *retval = 0; + if ( ld != NULL ) { + LDAPConn *conn = ld->ld_defconn; + if ( conn != NULL ) { + Sockbuf *sb = conn->lconn_sb; + retval = ldap_pvt_tls_sb_ctx( sb ); + } + } + *(void **)arg = retval; + break; + } default: return -1; } -- 2.39.5