#define CRYPT_SHA2_ROUNDS_MAX 999999999
#define CRYPT_SHA2_SALT_LEN 16
-static unsigned int encryption_rounds = 0;
+unsigned int password_scheme_encryption_rounds = 0;
void password_set_encryption_rounds(unsigned int rounds)
{
/* just take the new value. crypt_generate_*() will enforce their
limits. */
- encryption_rounds = rounds;
+ password_scheme_encryption_rounds = rounds;
}
static void
const unsigned char **raw_password_r, size_t *size_r)
{
const char *password, *salt, *magic_salt;
- unsigned int rounds = encryption_rounds;
+ unsigned int rounds = password_scheme_encryption_rounds;
if (rounds == 0)
rounds = CRYPT_BLF_ROUNDS_DEFAULT;
const unsigned char **raw_password_r, size_t *size_r)
{
const char *password, *salt, *magic_salt;
- unsigned int rounds = encryption_rounds;
+ unsigned int rounds = password_scheme_encryption_rounds;
if (rounds == 0)
rounds = CRYPT_SHA2_ROUNDS_DEFAULT;
const unsigned char **raw_password_r, size_t *size_r)
{
const char *password, *salt, *magic_salt;
- unsigned int rounds = encryption_rounds;
+ unsigned int rounds = password_scheme_encryption_rounds;
if (rounds == 0)
rounds = CRYPT_SHA2_ROUNDS_DEFAULT;
ARRAY_DEFINE_TYPE(password_scheme_p, const struct password_scheme *);
extern ARRAY_TYPE(password_scheme_p) password_schemes;
+extern unsigned int password_scheme_encryption_rounds;
/* Returns 1 = matched, 0 = didn't match, -1 = unknown scheme or invalid
raw_password */