Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
stoken: Fix CSD/stoken interaction
When using CSD, the auth form could be parsed more than once per
connection.  Change the accounting so that stoken_tries only gets
incremented if a tokencode is actually generated.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
  • Loading branch information
cernekee committed Oct 28, 2012
1 parent cff6b33 commit d7f91bb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions auth.c
Expand Up @@ -973,8 +973,6 @@ static int can_gen_tokencode(struct openconnect_info *vpninfo, struct oc_form_op
_("Server is rejecting the soft token; switching to manual entry\n"));
return -ENOENT;
}

vpninfo->stoken_tries++;
return 0;
#else
return -EOPNOTSUPP;
Expand Down Expand Up @@ -1010,6 +1008,7 @@ static int do_gen_tokencode(struct openconnect_info *vpninfo, struct oc_auth_for
return -EIO;
}

vpninfo->stoken_tries++;
opt->value = strdup(tokencode);
return opt->value ? 0 : -ENOMEM;
#else
Expand Down

0 comments on commit d7f91bb

Please sign in to comment.