gsasl
2.2.1
|
Go to the source code of this file.
Macros | |
#define | CLIENT_KEY "Client Key" |
#define | SERVER_KEY "Server Key" |
Functions | |
int | gsasl_nonce (char *data, size_t datalen) |
int | gsasl_random (char *data, size_t datalen) |
size_t | gsasl_hash_length (Gsasl_hash hash) |
int | gsasl_scram_secrets_from_salted_password (Gsasl_hash hash, const char *salted_password, char *client_key, char *server_key, char *stored_key) |
int | gsasl_scram_secrets_from_password (Gsasl_hash hash, const char *password, unsigned int iteration_count, const char *salt, size_t saltlen, char *salted_password, char *client_key, char *server_key, char *stored_key) |
#define CLIENT_KEY "Client Key" |
#define SERVER_KEY "Server Key" |
size_t gsasl_hash_length | ( | Gsasl_hash | hash | ) |
gsasl_hash_length:
hash | a Gsasl_hash element, e.g., GSASL_HASH_SHA256. |
Return the digest output size for hash function @hash. For example, gsasl_hash_length(GSASL_HASH_SHA256) returns GSASL_HASH_SHA256_SIZE which is 32.
Returns: size of supplied Gsasl_hash element.
Since: 1.10
int gsasl_nonce | ( | char * | data, |
size_t | datalen | ||
) |
int gsasl_random | ( | char * | data, |
size_t | datalen | ||
) |
int gsasl_scram_secrets_from_password | ( | Gsasl_hash | hash, |
const char * | password, | ||
unsigned int | iteration_count, | ||
const char * | salt, | ||
size_t | saltlen, | ||
char * | salted_password, | ||
char * | client_key, | ||
char * | server_key, | ||
char * | stored_key | ||
) |
gsasl_scram_secrets_from_password:
hash | a Gsasl_hash element, e.g., GSASL_HASH_SHA256. |
password | input parameter with password. |
iteration_count | number of PBKDF2 rounds to apply. |
salt | input character array of @saltlen length with salt for PBKDF2. |
saltlen | length of @salt. |
salted_password | pre-allocated output array with derived salted password. |
client_key | pre-allocated output array with derived client key. |
server_key | pre-allocated output array with derived server key. |
stored_key | pre-allocated output array with derived stored key. |
Helper function to generate SCRAM secrets from a password. The @salted_password, @client_key, @server_key, and @stored_key buffers must have room to hold digest for given @hash, use GSASL_HASH_MAX_SIZE which is sufficient for all hashes.
Return value: Returns GSASL_OK if successful, or error code.
Since: 1.10
int gsasl_scram_secrets_from_salted_password | ( | Gsasl_hash | hash, |
const char * | salted_password, | ||
char * | client_key, | ||
char * | server_key, | ||
char * | stored_key | ||
) |
gsasl_scram_secrets_from_salted_password:
hash | a Gsasl_hash element, e.g., GSASL_HASH_SHA256. |
salted_password | input array with salted password. |
client_key | pre-allocated output array with derived client key. |
server_key | pre-allocated output array with derived server key. |
stored_key | pre-allocated output array with derived stored key. |
Helper function to derive SCRAM ClientKey/ServerKey/StoredKey. The @client_key, @server_key, and @stored_key buffers must have room to hold digest for given @hash, use GSASL_HASH_MAX_SIZE which is sufficient for all hashes.
Return value: Returns GSASL_OK if successful, or error code.
Since: 1.10