2008-08-14 00:18:51 +08:00
|
|
|
/* ldap-tls.h - TLS defines & prototypes internal to the LDAP library */
|
|
|
|
/* $OpenLDAP$ */
|
|
|
|
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
|
|
|
|
*
|
2021-01-12 03:25:53 +08:00
|
|
|
* Copyright 2008-2021 The OpenLDAP Foundation.
|
2008-08-14 00:18:51 +08:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted only as authorized by the OpenLDAP
|
|
|
|
* Public License.
|
|
|
|
*
|
|
|
|
* A copy of this license is available in the file LICENSE in the
|
|
|
|
* top-level directory of the distribution or, alternatively, at
|
|
|
|
* <http://www.OpenLDAP.org/license.html>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LDAP_TLS_H
|
|
|
|
#define _LDAP_TLS_H 1
|
|
|
|
|
|
|
|
struct tls_impl;
|
|
|
|
|
2009-01-26 10:06:45 +08:00
|
|
|
struct tls_ctx;
|
|
|
|
struct tls_session;
|
2008-08-14 00:18:51 +08:00
|
|
|
|
2021-07-23 04:07:21 +08:00
|
|
|
#define CERTPATHSEP ";"
|
|
|
|
|
2009-01-26 10:06:45 +08:00
|
|
|
typedef struct tls_ctx tls_ctx;
|
|
|
|
typedef struct tls_session tls_session;
|
2008-08-14 00:18:51 +08:00
|
|
|
|
|
|
|
typedef int (TI_tls_init)(void);
|
|
|
|
typedef void (TI_tls_destroy)(void);
|
|
|
|
|
|
|
|
typedef tls_ctx *(TI_ctx_new)(struct ldapoptions *lo);
|
|
|
|
typedef void (TI_ctx_ref)(tls_ctx *ctx);
|
|
|
|
typedef void (TI_ctx_free)(tls_ctx *ctx);
|
2021-07-22 22:26:29 +08:00
|
|
|
#define ERRBUFSIZE 256
|
|
|
|
typedef int (TI_ctx_init)(struct ldapoptions *lo, struct ldaptls *lt, int is_server, char *errmsg);
|
2008-08-14 00:18:51 +08:00
|
|
|
|
|
|
|
typedef tls_session *(TI_session_new)(tls_ctx *ctx, int is_server);
|
2020-04-27 10:41:12 +08:00
|
|
|
typedef int (TI_session_connect)(LDAP *ld, tls_session *s, const char *name_in);
|
2008-08-14 00:18:51 +08:00
|
|
|
typedef int (TI_session_accept)(tls_session *s);
|
|
|
|
typedef int (TI_session_upflags)(Sockbuf *sb, tls_session *s, int rc);
|
2009-10-01 00:25:23 +08:00
|
|
|
typedef char *(TI_session_errmsg)(tls_session *s, int rc, char *buf, size_t len );
|
2008-08-14 00:18:51 +08:00
|
|
|
typedef int (TI_session_dn)(tls_session *sess, struct berval *dn);
|
|
|
|
typedef int (TI_session_chkhost)(LDAP *ld, tls_session *s, const char *name_in);
|
|
|
|
typedef int (TI_session_strength)(tls_session *sess);
|
2013-08-27 14:31:48 +08:00
|
|
|
typedef int (TI_session_unique)(tls_session *sess, struct berval *buf, int is_server);
|
2020-04-14 21:10:48 +08:00
|
|
|
typedef int (TI_session_endpoint)(tls_session *sess, struct berval *buf, int is_server);
|
2013-09-08 03:22:09 +08:00
|
|
|
typedef const char *(TI_session_name)(tls_session *s);
|
2013-09-10 19:26:51 +08:00
|
|
|
typedef int (TI_session_peercert)(tls_session *s, struct berval *der);
|
2017-11-08 02:35:33 +08:00
|
|
|
typedef int (TI_session_pinning)(LDAP *ld, tls_session *s, char *hashalg, struct berval *hash);
|
2008-08-14 00:18:51 +08:00
|
|
|
|
|
|
|
typedef void (TI_thr_init)(void);
|
|
|
|
|
|
|
|
typedef struct tls_impl {
|
|
|
|
const char *ti_name;
|
|
|
|
|
|
|
|
TI_tls_init *ti_tls_init; /* library initialization */
|
|
|
|
TI_tls_destroy *ti_tls_destroy;
|
|
|
|
|
|
|
|
TI_ctx_new *ti_ctx_new;
|
|
|
|
TI_ctx_ref *ti_ctx_ref;
|
|
|
|
TI_ctx_free *ti_ctx_free;
|
|
|
|
TI_ctx_init *ti_ctx_init;
|
|
|
|
|
|
|
|
TI_session_new *ti_session_new;
|
|
|
|
TI_session_connect *ti_session_connect;
|
|
|
|
TI_session_accept *ti_session_accept;
|
|
|
|
TI_session_upflags *ti_session_upflags;
|
|
|
|
TI_session_errmsg *ti_session_errmsg;
|
|
|
|
TI_session_dn *ti_session_my_dn;
|
|
|
|
TI_session_dn *ti_session_peer_dn;
|
|
|
|
TI_session_chkhost *ti_session_chkhost;
|
|
|
|
TI_session_strength *ti_session_strength;
|
2013-08-27 14:31:48 +08:00
|
|
|
TI_session_unique *ti_session_unique;
|
2020-04-14 21:10:48 +08:00
|
|
|
TI_session_endpoint *ti_session_endpoint;
|
2013-09-08 03:22:09 +08:00
|
|
|
TI_session_name *ti_session_version;
|
|
|
|
TI_session_name *ti_session_cipher;
|
2013-09-10 19:26:51 +08:00
|
|
|
TI_session_peercert *ti_session_peercert;
|
2017-11-08 02:35:33 +08:00
|
|
|
TI_session_pinning *ti_session_pinning;
|
2008-08-14 00:18:51 +08:00
|
|
|
|
|
|
|
Sockbuf_IO *ti_sbio;
|
|
|
|
|
|
|
|
TI_thr_init *ti_thr_init;
|
|
|
|
|
|
|
|
int ti_inited;
|
|
|
|
} tls_impl;
|
|
|
|
|
2009-01-26 10:06:45 +08:00
|
|
|
extern tls_impl ldap_int_tls_impl;
|
|
|
|
|
2008-08-14 00:18:51 +08:00
|
|
|
#endif /* _LDAP_TLS_H */
|