|
|
|
|
|
|
|
|
"using password as enable_password for a privileged command"); |
|
|
"using password as enable_password for a privileged command"); |
|
|
check = ctx->password; |
|
|
check = ctx->password; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (check != NULL) { |
|
|
if (check != NULL) { |
|
|
if (!rspamd_is_encrypted_password (check, &pbkdf)) { |
|
|
if (!rspamd_is_encrypted_password (check, &pbkdf)) { |
|
|
ret = rspamd_constant_memcmp (password->begin, check, password->len); |
|
|
|
|
|
|
|
|
ret = FALSE; |
|
|
|
|
|
|
|
|
|
|
|
if (strlen (check) == password->len) { |
|
|
|
|
|
ret = rspamd_constant_memcmp (password->begin, check, |
|
|
|
|
|
password->len); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
ret = rspamd_check_encrypted_password (ctx, password, check, |
|
|
ret = rspamd_check_encrypted_password (ctx, password, check, |
|
|
|
|
|
|
|
|
/* Accept both normal and enable passwords */ |
|
|
/* Accept both normal and enable passwords */ |
|
|
if (ctx->password != NULL) { |
|
|
if (ctx->password != NULL) { |
|
|
check = ctx->password; |
|
|
check = ctx->password; |
|
|
|
|
|
|
|
|
if (!rspamd_is_encrypted_password (check, &pbkdf)) { |
|
|
if (!rspamd_is_encrypted_password (check, &pbkdf)) { |
|
|
check_normal = rspamd_constant_memcmp (password->begin, check, |
|
|
|
|
|
password->len); |
|
|
|
|
|
|
|
|
check_normal = FALSE; |
|
|
|
|
|
|
|
|
|
|
|
if (strlen (check) == password->len) { |
|
|
|
|
|
check_normal = rspamd_constant_memcmp (password->begin, |
|
|
|
|
|
check, |
|
|
|
|
|
password->len); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
check_normal = rspamd_check_encrypted_password (ctx, |
|
|
check_normal = rspamd_check_encrypted_password (ctx, |
|
|
|
|
|
|
|
|
else { |
|
|
else { |
|
|
check_normal = FALSE; |
|
|
check_normal = FALSE; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (ctx->enable_password != NULL) { |
|
|
if (ctx->enable_password != NULL) { |
|
|
check = ctx->enable_password; |
|
|
check = ctx->enable_password; |
|
|
|
|
|
|
|
|
if (!rspamd_is_encrypted_password (check, &pbkdf)) { |
|
|
if (!rspamd_is_encrypted_password (check, &pbkdf)) { |
|
|
check_enable = rspamd_constant_memcmp (password->begin, check, |
|
|
|
|
|
password->len); |
|
|
|
|
|
|
|
|
check_enable = FALSE; |
|
|
|
|
|
|
|
|
|
|
|
if (strlen (check) == password->len) { |
|
|
|
|
|
check_enable = rspamd_constant_memcmp (password->begin, |
|
|
|
|
|
check, |
|
|
|
|
|
password->len); |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
check_enable = rspamd_check_encrypted_password (ctx, |
|
|
check_enable = rspamd_check_encrypted_password (ctx, |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (check_normal == FALSE && check_enable == FALSE) { |
|
|
if (check_normal == FALSE && check_enable == FALSE) { |
|
|
msg_info("absent or incorrect password has been specified"); |
|
|
|
|
|
|
|
|
msg_info ("absent or incorrect password has been specified"); |
|
|
ret = FALSE; |
|
|
ret = FALSE; |
|
|
} |
|
|
} |
|
|
|
|
|
|