]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
Add `openconnect_get_auth_expiration` function to library and JNI
authorDaniel Lenski <dlenski@gmail.com>
Thu, 24 Sep 2020 23:54:57 +0000 (16:54 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Mon, 14 Dec 2020 22:44:03 +0000 (14:44 -0800)
commitf152cf7d43cf3c288c0c915c47141b6dce68b3d1
tree319534b3f26952b5d917afe0c1f0ba74ccb842fd
parent64e97762a08492fc1b159a98464063130fcabe4f
Add `openconnect_get_auth_expiration` function to library and JNI

This allows protocols to save the moment when a session's authentication
(`vpninfo->cookie`) is expected to expire and no longer be useful for
reconnection.

The motivation is to eventually allow front-ends to know whether
reauthentication is needed, or whether they should try using a cached
cookie.

Current state:

- AnyConnect protocol: expiration is determined from the CONNECT
  response header `X-CSTP-Session-Timeout-Remaining` (with
  `X-CSTP-Session-Timeout` or `X-CSTP-Lease-Duration` as upper bounds in its
  absence)
- GlobalProtect protocol: expiration is determined from the `<lifetime>` tag of
  the XML config.
- Juniper Network Connect protocol: no currently known way to determine
  expiration. The `DSID` cookie is a standard HTTP cookie, so perhaps its
  expiration timestamp is intended for this purpose; however, I can find
  no real-world case where it has an expiration timestamp set.
- None of the currently-supported protocols provide the expiration
  timestamp until the connection phase, so it can't be obtained for
  export by the `--authenticate` option.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
cstp.c
gpst.c
java/src/com/example/LibTest.java
java/src/org/infradead/libopenconnect/LibOpenConnect.java
jni.c
libopenconnect.map.in
library.c
main.c
openconnect-internal.h
openconnect.h