authutils.h
Go to the documentation of this file.
/* Copyright (C) 2009-2021 Greenbone Networks GmbH
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _GVM_AUTHUTILS_H
#define _GVM_AUTHUTILS_H
#include <glib.h>
enum authentication_method
{
AUTHENTICATION_METHOD_FILE = 0,
AUTHENTICATION_METHOD_LDAP_CONNECT,
AUTHENTICATION_METHOD_RADIUS_CONNECT,
AUTHENTICATION_METHOD_LAST
};
typedef enum authentication_method auth_method_t;
const gchar *auth_method_name (auth_method_t);
int
gvm_auth_init ();
int
gvm_authenticate_classic (const gchar *, const gchar *, const gchar *);
gchar *
get_password_hashes (const gchar *);
gchar *
digest_hex (int, const guchar *);
int
gvm_auth_ldap_enabled ();
int
gvm_auth_radius_enabled ();
#endif /* not _GVM_AUTHUTILS_H */
auth_method_t
enum authentication_method auth_method_t
Type for the numerical representation of the supported authentication methods.
Definition: authutils.h:45
auth_method_name
const gchar * auth_method_name(auth_method_t)
Return name of auth_method_t.
Definition: authutils.c:90
digest_hex
gchar * digest_hex(int, const guchar *)
Generate a hexadecimal representation of a message digest.
Definition: authutils.c:168
gvm_auth_ldap_enabled
int gvm_auth_ldap_enabled()
Return whether libraries has been compiled with LDAP support.
Definition: authutils.c:55
authentication_method
authentication_method
Numerical representation of the supported authentication methods. Beware to have it in sync with auth...
Definition: authutils.h:36
AUTHENTICATION_METHOD_FILE
@ AUTHENTICATION_METHOD_FILE
Definition: authutils.h:37
AUTHENTICATION_METHOD_LDAP_CONNECT
@ AUTHENTICATION_METHOD_LDAP_CONNECT
Definition: authutils.h:38
AUTHENTICATION_METHOD_LAST
@ AUTHENTICATION_METHOD_LAST
Definition: authutils.h:40
AUTHENTICATION_METHOD_RADIUS_CONNECT
@ AUTHENTICATION_METHOD_RADIUS_CONNECT
Definition: authutils.h:39
gvm_auth_init
int gvm_auth_init()
Initializes Gcrypt.
Definition: authutils.c:103
get_password_hashes
gchar * get_password_hashes(const gchar *)
Generate a pair of md5 hashes to be used in the "auth/hash" file for the user.
Definition: authutils.c:203
gvm_authenticate_classic
int gvm_authenticate_classic(const gchar *, const gchar *, const gchar *)
Authenticate a credential pair against user file contents.
Definition: authutils.c:243
gvm_auth_radius_enabled
int gvm_auth_radius_enabled()
Return whether libraries has been compiled with RADIUS support.
Definition: authutils.c:70