Fixed maximum password length in modules of hash-modes 600, 7800, 7801 and 9900

pull/2478/head
Jens Steube 4 years ago
parent 1563405950
commit 5d04e97adc

@ -11,6 +11,7 @@
## Bugs
##
- Fixed maximum password length in modules of hash-modes 600, 7800, 7801 and 9900
- Fixed uninitialized value in bitsliced DES kernel (BF mode only) leading to false negatives
##

@ -44,18 +44,6 @@ const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig,
static const char *SIGNATURE_BLAKE2B = "$BLAKE2$";
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
// this overrides the reductions of pw_max in case optimized kernel is selected
// IOW, even in optimized kernel mode it support length 64
const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL);
const u32 pw_max = (optimized_kernel == true) ? 64 : PW_MAX;
return pw_max;
}
int module_hash_decode (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED void *digest_buf, MAYBE_UNUSED salt_t *salt, MAYBE_UNUSED void *esalt_buf, MAYBE_UNUSED void *hook_salt_buf, MAYBE_UNUSED hashinfo_t *hash_info, const char *line_buf, MAYBE_UNUSED const int line_len)
{
u64 *digest = (u64 *) digest_buf;
@ -178,7 +166,7 @@ void module_init (module_ctx_t *module_ctx)
module_ctx->module_potfile_disable = MODULE_DEFAULT;
module_ctx->module_potfile_keep_all_hashes = MODULE_DEFAULT;
module_ctx->module_pwdump_column = MODULE_DEFAULT;
module_ctx->module_pw_max = module_pw_max;
module_ctx->module_pw_max = MODULE_DEFAULT;
module_ctx->module_pw_min = MODULE_DEFAULT;
module_ctx->module_salt_max = MODULE_DEFAULT;
module_ctx->module_salt_min = MODULE_DEFAULT;

@ -46,7 +46,9 @@ const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig,
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const u32 pw_max = 40; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/
const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL);
const u32 pw_max = (optimized_kernel == false) ? 40 : hashconfig->pw_max; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/
return pw_max;
}

@ -46,7 +46,9 @@ const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig,
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const u32 pw_max = 40; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/
const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL);
const u32 pw_max = (optimized_kernel == false) ? 40 : hashconfig->pw_max; // https://www.daniel-berlin.de/security/sap-sec/password-hash-algorithms/
return pw_max;
}

@ -46,7 +46,9 @@ const char *module_st_pass (MAYBE_UNUSED const hashconfig_t *hashconfig,
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const u32 pw_max = 100; // RAdmin2 sets w[25] = 0x80
const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL);
const u32 pw_max = (optimized_kernel == false) ? 100 : hashconfig->pw_max; // RAdmin2 sets w[25] = 0x80
return pw_max;
}

@ -74,9 +74,9 @@ char *module_jit_build_options (MAYBE_UNUSED const hashconfig_t *hashconfig, MAY
u64 module_tmp_size (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)
{
const u64 pw_max = (const u64) sizeof (bsdicrypt_tmp_t);
const u64 tmp_size = (const u64) sizeof (bsdicrypt_tmp_t);
return pw_max;
return tmp_size;
}
u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED const user_options_t *user_options, MAYBE_UNUSED const user_options_extra_t *user_options_extra)

@ -52,7 +52,7 @@ u32 module_pw_max (MAYBE_UNUSED const hashconfig_t *hashconfig, MAYBE_UNUSED con
{
const bool optimized_kernel = (hashconfig->opti_type & OPTI_TYPE_OPTIMIZED_KERNEL);
u32 pw_max = (optimized_kernel == true) ? PW_MAX_OLD : 64; // HMAC-MD5 and `doveadm pw` are different for password more than 64 bytes
const u32 pw_max = (optimized_kernel == false) ? 64 : hashconfig->pw_max; // HMAC-MD5 and `doveadm pw` are different for password more than 64 bytes
return pw_max;
}

Loading…
Cancel
Save