]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Fix token-related command line options
authorKevin Cernekee <cernekee@gmail.com>
Mon, 25 Mar 2013 01:13:58 +0000 (18:13 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 25 Mar 2013 15:30:26 +0000 (15:30 +0000)
Aliasing --stoken to --token-secret is not effective because token_mode
does not get set.  Might as well just drop --stoken.

For --token-mode, change "stoken" to "rsa" to make the UI more intuitive:
liboath provides TOTP token support, and libstoken provides RSA token
support.

Signed-off-by: Kevin Cernekee <cernekee@gmail.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
main.c

diff --git a/main.c b/main.c
index 3d081309bbcdce51af51f04f52acb47ee3f52bcd..d140d783a759203249f8e2e256a1095ba3e8e3bd 100644 (file)
--- a/main.c
+++ b/main.c
@@ -178,9 +178,7 @@ static struct option long_options[] = {
        OPTION("non-inter", 0, OPT_NON_INTER),
        OPTION("dtls-local-port", 1, OPT_DTLS_LOCAL_PORT),
        OPTION("token-mode", 1, OPT_TOKEN_MODE),
-       /* Alias --stoken to --token-secret for backwards compatibility. */
-       OPTION("stoken", 2, OPT_TOKEN_SECRET),
-       OPTION("token-secret", 2, OPT_TOKEN_SECRET),
+       OPTION("token-secret", 1, OPT_TOKEN_SECRET),
        OPTION("os", 1, OPT_OS),
        OPTION(NULL, 0, 0)
 };
@@ -290,9 +288,8 @@ static void usage(void)
        printf("      --no-cert-check             %s\n", _("Do not require server SSL cert to be valid"));
        printf("      --non-inter                 %s\n", _("Do not expect user input; exit if it is required"));
        printf("      --passwd-on-stdin           %s\n", _("Read password from standard input"));
-       printf("      --token-mode=MODE           %s\n", _("Software token type: stoken (default) or totp"));
-       printf("      --token-secret[=STRING]     %s\n", _("Software token secret (can be empty for stoken mode"));
-       printf("                                  %s\n", _("    to read from ~/.stokenrc)"));
+       printf("      --token-mode=MODE           %s\n", _("Software token type: rsa or totp"));
+       printf("      --token-secret=STRING       %s\n", _("Software token secret"));
 #ifndef HAVE_LIBSTOKEN
        printf("                                  %s\n", _("(NOTE: libstoken (RSA SecurID) disabled in this build)"));
 #endif
@@ -726,7 +723,7 @@ int main(int argc, char **argv)
                        vpninfo->dtls_local_port = atoi(config_arg);
                        break;
                case OPT_TOKEN_MODE:
-                       if (strcasecmp(config_arg, "stoken") == 0) {
+                       if (strcasecmp(config_arg, "rsa") == 0) {
                                token_mode = OC_TOKEN_MODE_STOKEN;
                        } else if (strcasecmp(config_arg, "totp") == 0) {
                                token_mode = OC_TOKEN_MODE_TOTP;