oc_token_mode_t token_mode, const char *token_str)
{
int ret;
+ char *file_token = NULL;
- ret = openconnect_set_token_mode(vpninfo, token_mode, token_str);
+ if (token_str) {
+ if (token_str[0] == '@')
+ read_file_into_string(vpninfo, &token_str[1], &file_token);
+ else if (token_str[0] == '/')
+ read_file_into_string(vpninfo, token_str, &file_token);
+ }
+
+ ret = openconnect_set_token_mode(vpninfo, token_mode, file_token ? : token_str);
+ free(file_token);
switch (token_mode) {
case OC_TOKEN_MODE_STOKEN:
.OP \-\-no\-xmlpost
.OP \-\-non\-inter
.OP \-\-passwd\-on\-stdin
-.OP \-\-token-mode mode
-.OP \-\-token-secret secret\fR[\fI,counter\fR]
+.OP \-\-token\-mode mode
+.OP \-\-token\-secret {secret\fR[\fI,counter\fR]|@\fIfile\fR}
.OP \-\-reconnect\-timeout
.OP \-\-servercert sha1
.OP \-\-useragent string
.B \-\-token\-mode=hotp
will call liboath to generate an RFC 4226 HMAC-based password.
.TP
-.B \-\-token\-secret=SECRET[,COUNTER]
+.B \-\-token\-secret={ SECRET[,COUNTER] | @FILENAME }
The secret to use when generating one-time passwords/verification codes.
Base 32-encoded TOTP/HOTP secrets can be used by specifying "base32:" at the
beginning of the secret, and for HOTP secrets the token counter can be
specified following a comma.
+RSA SecurID secrets can be specified as an Android/iPhone URI or a raw numeric
+CTF string (with or without dashes).
+
+.IR FILENAME ,
+if specified, can contain any of the above strings. Or, it can contain a
+SecurID XML (SDTID) seed.
+
If this option is omitted, and \-\-token\-mode is
"rsa", libstoken will try to use the software token seed saved in
.B ~/.stokenrc