ldap-tls.h revision 1.1.1.4
1/*	$NetBSD: ldap-tls.h,v 1.1.1.4 2017/02/09 01:46:46 christos Exp $	*/
2
3/*  ldap-tls.h - TLS defines & prototypes internal to the LDAP library */
4/* $OpenLDAP$ */
5/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
6 *
7 * Copyright 2008-2016 The OpenLDAP Foundation.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted only as authorized by the OpenLDAP
12 * Public License.
13 *
14 * A copy of this license is available in the file LICENSE in the
15 * top-level directory of the distribution or, alternatively, at
16 * <http://www.OpenLDAP.org/license.html>.
17 */
18
19#ifndef	_LDAP_TLS_H
20#define	_LDAP_TLS_H 1
21
22struct tls_impl;
23
24struct tls_ctx;
25struct tls_session;
26
27typedef struct tls_ctx tls_ctx;
28typedef struct tls_session tls_session;
29
30typedef int (TI_tls_init)(void);
31typedef void (TI_tls_destroy)(void);
32
33typedef tls_ctx *(TI_ctx_new)(struct ldapoptions *lo);
34typedef void (TI_ctx_ref)(tls_ctx *ctx);
35typedef void (TI_ctx_free)(tls_ctx *ctx);
36typedef int (TI_ctx_init)(struct ldapoptions *lo, struct ldaptls *lt, int is_server);
37
38typedef tls_session *(TI_session_new)(tls_ctx *ctx, int is_server);
39typedef int (TI_session_connect)(LDAP *ld, tls_session *s);
40typedef int (TI_session_accept)(tls_session *s);
41typedef int (TI_session_upflags)(Sockbuf *sb, tls_session *s, int rc);
42typedef char *(TI_session_errmsg)(tls_session *s, int rc, char *buf, size_t len );
43typedef int (TI_session_dn)(tls_session *sess, struct berval *dn);
44typedef int (TI_session_chkhost)(LDAP *ld, tls_session *s, const char *name_in);
45typedef int (TI_session_strength)(tls_session *sess);
46
47typedef void (TI_thr_init)(void);
48
49typedef struct tls_impl {
50	const char *ti_name;
51
52	TI_tls_init *ti_tls_init;	/* library initialization */
53	TI_tls_destroy *ti_tls_destroy;
54
55	TI_ctx_new *ti_ctx_new;
56	TI_ctx_ref *ti_ctx_ref;
57	TI_ctx_free *ti_ctx_free;
58	TI_ctx_init *ti_ctx_init;
59
60	TI_session_new *ti_session_new;
61	TI_session_connect *ti_session_connect;
62	TI_session_accept *ti_session_accept;
63	TI_session_upflags *ti_session_upflags;
64	TI_session_errmsg *ti_session_errmsg;
65	TI_session_dn *ti_session_my_dn;
66	TI_session_dn *ti_session_peer_dn;
67	TI_session_chkhost *ti_session_chkhost;
68	TI_session_strength *ti_session_strength;
69
70	Sockbuf_IO *ti_sbio;
71
72	TI_thr_init *ti_thr_init;
73
74	int ti_inited;
75} tls_impl;
76
77extern tls_impl ldap_int_tls_impl;
78
79#endif /* _LDAP_TLS_H */
80