Greenbone Vulnerability Management Libraries 22.5.2
ldaputils.h
Go to the documentation of this file.
1/* Copyright (C) 2012-2022 Greenbone AG
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
25#ifndef _GVM_LDAPUTILS_H
26#define _GVM_LDAPUTILS_H
27
28#include <glib.h>
29
32
40{
41 gchar *ldap_host;
42 gchar *auth_dn;
43 gboolean allow_plaintext;
44 gboolean ldaps_only;
45};
46
47int
49
50int
51ldap_connect_authenticate (const gchar *, const gchar *,
52 /* ldap_auth_info_t */ void *, const gchar *);
53
55
57ldap_auth_info_new (const gchar *, const gchar *, gboolean);
58
60ldap_auth_info_new_2 (const gchar *, const gchar *, gboolean, gboolean);
61
62#ifdef ENABLE_LDAP_AUTH
63
64#include <ldap.h>
65
66gchar *
67ldap_auth_info_auth_dn (const ldap_auth_info_t, const gchar *);
68
69LDAP *
70ldap_auth_bind (const gchar *, const gchar *, const gchar *, gboolean,
71 const gchar *);
72
73LDAP *
74ldap_auth_bind_2 (const gchar *, const gchar *, const gchar *, gboolean,
75 const gchar *, gboolean);
76
77gboolean
78ldap_auth_dn_is_good (const gchar *);
79
80#endif /* ENABLE_LDAP_AUTH */
81
82#endif /* not _GVM_LDAPUTILS_H */
ldap_auth_info_t ldap_auth_info_new(const gchar *, const gchar *, gboolean)
Dummy function for manager.
Definition: ldaputils.c:665
struct ldap_auth_info * ldap_auth_info_t
Authentication schema and address type.
Definition: ldaputils.h:31
int ldap_connect_authenticate(const gchar *, const gchar *, void *, const gchar *)
Dummy function for Manager.
Definition: ldaputils.c:710
ldap_auth_info_t ldap_auth_info_new_2(const gchar *, const gchar *, gboolean, gboolean)
Dummy function for manager.
Definition: ldaputils.c:689
void ldap_auth_info_free(ldap_auth_info_t)
Dummy function for Manager.
Definition: ldaputils.c:727
int ldap_enable_debug(void)
Dummy function for enabling LDAP debugging for manager.
Definition: ldaputils.c:645
Schema (dn) and info to use for a basic ldap authentication.
Definition: ldaputils.h:40
gboolean allow_plaintext
!Whether or not StartTLS or LDAPS is required.
Definition: ldaputils.h:43
gboolean ldaps_only
Whether to try LDAPS before StartTLS.
Definition: ldaputils.h:44
gchar * ldap_host
Address of the ldap server, might include port.
Definition: ldaputils.h:41
gchar * auth_dn
DN to authenticate with.
Definition: ldaputils.h:42