Back to index

openldap  2.4.31
ldap-tls.h
Go to the documentation of this file.
00001 /*  ldap-tls.h - TLS defines & prototypes internal to the LDAP library */
00002 /* $OpenLDAP$ */
00003 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
00004  *
00005  * Copyright 2008-2012 The OpenLDAP Foundation.
00006  * All rights reserved.
00007  *
00008  * Redistribution and use in source and binary forms, with or without
00009  * modification, are permitted only as authorized by the OpenLDAP
00010  * Public License.
00011  *
00012  * A copy of this license is available in the file LICENSE in the
00013  * top-level directory of the distribution or, alternatively, at
00014  * <http://www.OpenLDAP.org/license.html>.
00015  */
00016 
00017 #ifndef       _LDAP_TLS_H
00018 #define       _LDAP_TLS_H 1
00019 
00020 struct tls_impl;
00021 
00022 struct tls_ctx;
00023 struct tls_session;
00024 
00025 typedef struct tls_ctx tls_ctx;
00026 typedef struct tls_session tls_session;
00027 
00028 typedef int (TI_tls_init)(void);
00029 typedef void (TI_tls_destroy)(void);
00030 
00031 typedef tls_ctx *(TI_ctx_new)(struct ldapoptions *lo);
00032 typedef void (TI_ctx_ref)(tls_ctx *ctx);
00033 typedef void (TI_ctx_free)(tls_ctx *ctx);
00034 typedef int (TI_ctx_init)(struct ldapoptions *lo, struct ldaptls *lt, int is_server);
00035 
00036 typedef tls_session *(TI_session_new)(tls_ctx *ctx, int is_server);
00037 typedef int (TI_session_connect)(LDAP *ld, tls_session *s);
00038 typedef int (TI_session_accept)(tls_session *s);
00039 typedef int (TI_session_upflags)(Sockbuf *sb, tls_session *s, int rc);
00040 typedef char *(TI_session_errmsg)(tls_session *s, int rc, char *buf, size_t len );
00041 typedef int (TI_session_dn)(tls_session *sess, struct berval *dn);
00042 typedef int (TI_session_chkhost)(LDAP *ld, tls_session *s, const char *name_in);
00043 typedef int (TI_session_strength)(tls_session *sess);
00044 
00045 typedef void (TI_thr_init)(void);
00046 
00047 typedef struct tls_impl {
00048        const char *ti_name;
00049 
00050        TI_tls_init *ti_tls_init;   /* library initialization */
00051        TI_tls_destroy *ti_tls_destroy;
00052 
00053        TI_ctx_new *ti_ctx_new;
00054        TI_ctx_ref *ti_ctx_ref;
00055        TI_ctx_free *ti_ctx_free;
00056        TI_ctx_init *ti_ctx_init;
00057 
00058        TI_session_new *ti_session_new;
00059        TI_session_connect *ti_session_connect;
00060        TI_session_accept *ti_session_accept;
00061        TI_session_upflags *ti_session_upflags;
00062        TI_session_errmsg *ti_session_errmsg;
00063        TI_session_dn *ti_session_my_dn;
00064        TI_session_dn *ti_session_peer_dn;
00065        TI_session_chkhost *ti_session_chkhost;
00066        TI_session_strength *ti_session_strength;
00067 
00068        Sockbuf_IO *ti_sbio;
00069 
00070        TI_thr_init *ti_thr_init;
00071 
00072        int ti_inited;
00073 } tls_impl;
00074 
00075 extern tls_impl ldap_int_tls_impl;
00076 
00077 #endif /* _LDAP_TLS_H */