|
OpenVAS Libraries
9.0.3
|


Go to the source code of this file.
Typedefs | |
| typedef enum authentication_method | auth_method_t |
| Type for the numerical representation of the supported. More... | |
Enumerations | |
| enum | authentication_method { AUTHENTICATION_METHOD_FILE = 0, AUTHENTICATION_METHOD_LDAP_CONNECT, AUTHENTICATION_METHOD_RADIUS_CONNECT, AUTHENTICATION_METHOD_LAST } |
| Numerical representation of the supported authentication methods. More... | |
Functions | |
| const gchar * | auth_method_name (auth_method_t) |
| Return name of auth_method_t. More... | |
| int | openvas_auth_init () |
| Initializes Gcrypt. More... | |
| void | openvas_auth_tear_down (void) |
| Free memory associated to authentication configuration. More... | |
| int | openvas_authenticate_classic (const gchar *, const gchar *, const gchar *) |
| Authenticate a credential pair against openvas user file contents. More... | |
| gchar * | get_password_hashes (int, const gchar *) |
| Generate a pair of hashes to be used in the OpenVAS "auth/hash" file for the user. More... | |
| gchar * | digest_hex (int, const guchar *) |
| Generate a hexadecimal representation of a message digest. More... | |
| int | openvas_auth_ldap_enabled () |
| Return whether libraries has been compiled with LDAP support. More... | |
| int | openvas_auth_radius_enabled () |
| Return whether libraries has been compiled with RADIUS support. More... | |
| typedef enum authentication_method auth_method_t |
Type for the numerical representation of the supported.
authentication methods.
Definition at line 50 of file openvas_auth.h.
Numerical representation of the supported authentication methods.
Beware to have it in sync with authentication_methods.
| Enumerator | |
|---|---|
| AUTHENTICATION_METHOD_FILE | |
| AUTHENTICATION_METHOD_LDAP_CONNECT | |
| AUTHENTICATION_METHOD_RADIUS_CONNECT | |
| AUTHENTICATION_METHOD_LAST | |
Definition at line 40 of file openvas_auth.h.
| const gchar* auth_method_name | ( | auth_method_t | method | ) |
Return name of auth_method_t.
Keep in sync with authentication_methods and authentication_method .
| method | Auth method. |
Definition at line 102 of file openvas_auth.c.
References AUTHENTICATION_METHOD_LAST.
| gchar* digest_hex | ( | int | gcrypt_algorithm, |
| const guchar * | digest | ||
| ) |
Generate a hexadecimal representation of a message digest.
| gcrypt_algorithm | The libgcrypt message digest algorithm used to create the digest (e.g. GCRY_MD_MD5; see the enum gcry_md_algos in gcrypt.h). |
| digest | The binary representation of the digest. |
Definition at line 184 of file openvas_auth.c.
References err.
Referenced by get_password_hashes(), and openvas_authenticate_classic().

| gchar* get_password_hashes | ( | int | digest_algorithm, |
| const gchar * | password | ||
| ) |
Generate a pair of hashes to be used in the OpenVAS "auth/hash" file for the user.
The "auth/hash" file consist of two hashes, h_1 and h_2. h_2 (the "seed") is the message digest of (currently) 256 bytes of random data. h_1 is the message digest of h_2 concatenated with the password in plaintext.
The current implementation was taken from the openvas-adduser shell script provided with openvas-server.
| digest_algorithm | The libgcrypt message digest algorithm used to create the digest (e.g. GCRY_MD_MD5; see the enum gcry_md_algos in gcrypt.h) |
| password | The password in plaintext. |
Definition at line 225 of file openvas_auth.c.
References digest_hex(), and err.

| int openvas_auth_init | ( | ) |
| int openvas_auth_ldap_enabled | ( | ) |
Return whether libraries has been compiled with LDAP support.
Definition at line 67 of file openvas_auth.c.
| int openvas_auth_radius_enabled | ( | ) |
Return whether libraries has been compiled with RADIUS support.
Definition at line 82 of file openvas_auth.c.
| void openvas_auth_tear_down | ( | void | ) |
Free memory associated to authentication configuration.
This will have no effect if openvas_auth_init was not called.
Definition at line 167 of file openvas_auth.c.
| int openvas_authenticate_classic | ( | const gchar * | username, |
| const gchar * | password, | ||
| const gchar * | hash_arg | ||
| ) |
Authenticate a credential pair against openvas user file contents.
| username | Username. |
| password | Password. |
| hash_arg | Hash. |
Definition at line 272 of file openvas_auth.c.
References digest_hex().
