Skip to content

Fortitoken support - #69

Closed
kobosko wants to merge 2 commits into
streambinder:masterfrom
kobosko:fortitoken-support
Closed

kobosko wants to merge 2 commits into
streambinder:masterfrom
kobosko:fortitoken-support

Conversation

@kobosko

@kobosko kobosko commented Sep 11, 2026

Copy link
Copy Markdown

Ported FortiToken support from https://github.com/falkevik/vpnc

on top of streambinder:master which is still maintained (security fixes).

A Fortigate that authenticates with a FortiToken sends XAUTH_TYPE 2
rather than 0, so requiring the generic type aborts the handshake with

  xauth packet unsupported:  (ISAKMP_N_ATTRIBUTES_NOT_SUPPORTED)(13)

right after the password prompt, on a gateway that is otherwise happy
to talk to us. Nothing in the exchange is driven by that value: which
credentials we send is decided by the attributes the server asks for,
which we validate individually anyway. So check that the type is well
formed and note anything unusual at debug level 2 instead of refusing
to continue.

Name the offending attribute when we do reject one, too. Without it an
unsupported attribute and an unsupported type produce the same bare
(13) and neither says which attribute was at fault.
We advertise md5, des, 3des and null in both the IKE and the quick mode
proposals, and then call error(1) the moment the peer selects one of
them, telling the user to pass --enable-weak-authentication or
--enable-weak-encryption. Offering an algorithm we will not accept can
only lose us a handshake we had already won: a Fortigate that pairs md5
with dh2 in one of its phase 1 proposals answers with

  IKE SA selected psk+xauth-aes256-md5
  Peer has selected md5 as authentication method.

and the connection dies after phase 1 completed, even though the same
gateway negotiates aes256-sha1 happily once md5 is off the table.

Filter the proposals through the --enable-* options that already decide
whether we would accept the result. The checks on the peer's selection
stay as they are; they still catch a gateway that picks something we
never offered.
@streambinder

Copy link
Copy Markdown
Owner

Hello @kobosko, thanks for your contribution!
Please, address linter complaints:

  1. fixup to make this PR single-commit
  2. amend message to be Conventional Commits -compliant

Thanks :)

@kobosko

kobosko commented Sep 11, 2026

Copy link
Copy Markdown
Author

Closing this PR for now to re-evaluate it on my personal fork and will come back with a new one soon. :)

@kobosko kobosko closed this Sep 11, 2026
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