mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 16:57:00 +08:00
enforce the actual number of MAX_TRIES in authentication
This commit is contained in:
@@ -232,7 +232,7 @@ static int plain_auth_pass(void *ctx, const char *pass, unsigned pass_len)
|
||||
&& strcmp(crypt(pass, pctx->cpass), pctx->cpass) == 0)
|
||||
return 0;
|
||||
else {
|
||||
if (pctx->retries++ < MAX_TRIES) {
|
||||
if (pctx->retries++ < MAX_TRIES-1) {
|
||||
pctx->pass_msg = pass_msg_failed;
|
||||
return ERR_AUTH_CONTINUE;
|
||||
} else {
|
||||
|
||||
@@ -277,7 +277,7 @@ static int radius_auth_pass(void *ctx, const char *pass, unsigned pass_len)
|
||||
if (ret == PW_ACCESS_CHALLENGE) {
|
||||
pctx->pass_msg = pass_msg_second;
|
||||
return ERR_AUTH_CONTINUE;
|
||||
} else if (pctx->retries++ < MAX_TRIES) {
|
||||
} else if (pctx->retries++ < MAX_TRIES-1) {
|
||||
pctx->pass_msg = pass_msg_failed;
|
||||
return ERR_AUTH_CONTINUE;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user