]> git.sur5r.net Git - openldap/commitdiff
Copyright 2001, Adrian Thurston, All rights reserved.
authorKurt Zeilenga <kurt@openldap.org>
Mon, 11 Mar 2002 03:39:08 +0000 (03:39 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 11 Mar 2002 03:39:08 +0000 (03:39 +0000)
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
libraries/libldap/tls.c

index 385419e19171cd8cbe7bd6f8deeaff81b23af2a7..25b529462659450f9b9e83ba7bb0f07763cd56a3 100644 (file)
@@ -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
index 8d5bd366700b70873236818d34bfd17ee1041c67..be701e561f21525d5a6dd3b5b60fa7e21e257c24 100644 (file)
@@ -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;
        }