|
Greenbone Vulnerability Management Libraries 22.8.0
|

Go to the source code of this file.
Data Structures | |
| struct | PBASettings |
Macros | |
| #define | MAX_PEPPER_SIZE 4 |
| #define | COUNT_DEFAULT 20000 |
| #define | PREFIX_DEFAULT "$6$" |
Enumerations | |
| enum | pba_rc { VALID , UPDATE_RECOMMENDED , INVALID , ERR } |
Functions | |
| struct PBASettings * | pba_init (const char *pepper, unsigned int pepper_size, unsigned int count, char *prefix) |
| char * | pba_hash (struct PBASettings *setting, const char *password) |
| enum pba_rc | pba_verify_hash (const struct PBASettings *settings, const char *hash, const char *password) |
| void | pba_finalize (struct PBASettings *settings) |
| #define COUNT_DEFAULT 20000 |
Definition at line 12 of file passwordbasedauthentication.h.
| #define MAX_PEPPER_SIZE 4 |
Definition at line 10 of file passwordbasedauthentication.h.
| #define PREFIX_DEFAULT "$6$" |
Definition at line 14 of file passwordbasedauthentication.h.
| enum pba_rc |
| Enumerator | |
|---|---|
| VALID | |
| UPDATE_RECOMMENDED | |
| INVALID | |
| ERR | |
Definition at line 45 of file passwordbasedauthentication.h.
| void pba_finalize | ( | struct PBASettings * | settings | ) |
Definition at line 152 of file passwordbasedauthentication.c.
Referenced by Ensure().

| char * pba_hash | ( | struct PBASettings * | setting, |
| const char * | password | ||
| ) |
pba_hash tries to create a hash based SETTING and PASSWORD. Returns a hash on success or a NULL pointer on failure
Definition at line 168 of file passwordbasedauthentication.c.
References PBASettings::count, CRYPT_GENSALT_OUTPUT_SIZE, crypt_gensalt_r(), CRYPT_OUTPUT_SIZE, is_prefix_supported(), MAX_PEPPER_SIZE, PBASettings::pepper, and PBASettings::prefix.
Referenced by Ensure().


| struct PBASettings * pba_init | ( | const char * | pepper, |
| unsigned int | pepper_size, | ||
| unsigned int | count, | ||
| char * | prefix | ||
| ) |
Intitializes PBASettings with given PEPPER, PREFIX, COUNT.
PEPPER_SIZE must be lower or equal MAX_PEPPER_SIZE when PEPPER is set, when PEPPER is a NULL pointer, no pepper will be used and PEPPER_SIZE is ignored.
COUNT is set to COUNT_DEFAULT when it is 0, PREFIX is set to PREFIX_DEFAULT when prefix is a nullpointer.
Returns a pointer to PBASettings on success or NULL on failure.
Definition at line 133 of file passwordbasedauthentication.c.
References PBASettings::count, COUNT_DEFAULT, is_prefix_supported(), MAX_PEPPER_SIZE, PBASettings::pepper, PBASettings::prefix, and PREFIX_DEFAULT.
Referenced by Ensure().


| enum pba_rc pba_verify_hash | ( | const struct PBASettings * | settings, |
| const char * | hash, | ||
| const char * | password | ||
| ) |
pba_verify_hash tries to create hash based on PASSWORD and settings found via HASH and compares that with HASH.
Returns VALID if HASH and PASSWORD are correct; UPDATE_RECOMMENDED when the HASH and PASSWORD are correct but based on a deprecated algorithm; IVALID if HASH does not match PASSWORD; ERR if an unexpected error occurs.
Definition at line 215 of file passwordbasedauthentication.c.
References CRYPT_OUTPUT_SIZE, ERR, gvm_auth_init(), gvm_authenticate_classic(), initialized, INVALID, INVALID_HASH, is_prefix_supported(), MAX_PEPPER_SIZE, pba_is_phc_compliant(), PBASettings::pepper, PBASettings::prefix, UPDATE_RECOMMENDED, and VALID.
Referenced by Ensure().

