Skip to content

openfortivpn: add password2 parameter#28598

Open
andoniElBicho wants to merge 1 commit intoopenwrt:masterfrom
andoniElBicho:feature_openfortivpn-password2
Open

openfortivpn: add password2 parameter#28598
andoniElBicho wants to merge 1 commit intoopenwrt:masterfrom
andoniElBicho:feature_openfortivpn-password2

Conversation

@andoniElBicho
Copy link

Introduce password2 new parameter in openfortivpn to enable introducing OTP or other DFA necessary for the VPN connection established.Password2 parameter name and coding has been copied from openconnect package.

Introduce password2 new parameter in openfortivpn to enable
introducing OTP or other DFA necessary for the VPN connection
established.Password2 parameter name and coding has been
copied from openconnect package.

Signed-off-by: Andoni Diaz de Cerio <andoni.diazdecerio@gmail.com>
@systemcrash
Copy link
Contributor

Show me a binary distribution of openfortivpn that takes a password2 parameter.

@systemcrash
Copy link
Contributor

@adrienverge is this some AI hallucination?

@andoniElBicho
Copy link
Author

Show me a binary distribution of openfortivpn that takes a password2 parameter.

No, openfortivpn binary has no password2 parameter and neither has openconnect binary. Password2 parameter, as implemented in openconnect package, is used to specify via stdin an optional second password (OTP code for example) that some VPN connections require for being established.

Here openconnect example, I have copied the password2 parameter from that package (https://github.com/openwrt/packages/blob/master/net/openconnect/files/openconnect.sh)

@systemcrash
Copy link
Contributor

Show how it's supposed to be used by openfortivpn. I don't see this functionality exposed in the source.

@andoniElBicho
Copy link
Author

The idea is that openfortivpn binary uses following the same mechanism that is used to pass the existing password. In my case when trying to establish a new VPN connection with openfortivpn the server requests to introduce two different passwords: the password corresponding to the username and another doble auth factor ( for example an OTP code send to my phone or mail). This second password is request via stdin at runtime when you manually execute openfortivpn. In this case, I propose to use the same mechanism than in openconnect package : in this package this password2 parameter is passed in the second line of the password file used to this purpose. Openfortivpn binary is executed using a wrapper (https://github.com/openwrt/packages/blob/master/net/openfortivpn/files/openfortivpn-wrapper) that takes this PWD file as a parameter and then passes it to openfortivpn command when executing it via stdin. When using this password2 two different lines are passed the first one with the password parameter and the second one with the password2 parameter. This is the way openconnect package has implemented it (https://github.com/openwrt/packages/tree/master/net/openconnect/files). I have tested it in my set up and it works fine as it does in openconnect package.

Thanks and sorry for so long explanation :)

@systemcrash
Copy link
Contributor

I don't see this mentioned in the help or manpage, but... it works for you? Does the server side use a modified binary?

@andoniElBicho
Copy link
Author

Maybe it is not mentioned in the manpage because it is only an internal mechanism to pass both passwords to the binary, in its manual execution they are typed with the keyboard. Yes, it works for me using a normal server side FortiVPN server without any modification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants