Navigation Menu

Skip to content

Commit

Permalink
Reread token file in lock_token()
Browse files Browse the repository at this point in the history
If someone else has used a HOTP token between the initial invocation of
openconnect and the time the token gets used, we want to use the current
value of the counter not the original value.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 14, 2014
1 parent 05d9a6b commit 215654d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions main.c
Expand Up @@ -1774,9 +1774,18 @@ static int process_auth_form_cb(void *_vpninfo,

static int lock_token(void *tokdata)
{
/* FIXME: actually do file locking? Is there anything defined for
PSKC files? And call openconnect_set_token_mode() again if the
contents of the file have changed. */
struct openconnect_info *vpninfo = tokdata;
char *file_token;
int err;

/* FIXME: Actually lock the file */
err = read_file_into_string(vpninfo, token_filename, &file_token);
if (err < 0)
return err;

err = openconnect_set_token_mode(vpninfo, vpninfo->token_mode, file_token);
free(file_token);

return 0;
}

Expand Down

0 comments on commit 215654d

Please sign in to comment.