[PATCH 21/24] stoken: Fix CSD/stoken interaction

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 at gmail.com>
---
 auth.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/auth.c b/auth.c
index 1092dbb..5634224 100644
--- a/auth.c
+++ b/auth.c
@@ -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;
@@ -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
-- 
1.7.10.4




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux