]> www.infradead.org Git - users/dwmw2/openconnect.git/commit
factor out internal_split_cookies from auth-juniper.c
authorDaniel Lenski <dlenski@gmail.com>
Mon, 8 Feb 2021 19:38:19 +0000 (11:38 -0800)
committerDaniel Lenski <dlenski@gmail.com>
Mon, 29 Mar 2021 02:27:01 +0000 (19:27 -0700)
commit8f113f32adcfeb03c919dbb8c96d1ccb041880fd
tree8a0058c9d16f881c245e84d7d610995a49c64173
parent3965188838e8d403dfe7d708c088696e62f79032
factor out internal_split_cookies from auth-juniper.c

This is useful for other protocols that use HTTP cookies for authentication, and may
need a way to handoff >1 cookie from the authentication phase to the connection phase.

Improve it slightly by allowing it to set a "default" HTTP cookie if the
authcookie string doesn't contain '=', since most protocols really only NEED
one cookie for the connection phase to work.

This allows shortcuts (like `openconnect --protocol=nc -C 'foobar'` → 'Cookie: DSID=foobar'
or `openconnect --protocol=fortinet -C 'ABCD123456=='` → 'Cookie: SVPNCOOKIE=ABCD123456==') without limiting
the ability to store multiple cookies if/when useful.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
http.c
oncp.c
openconnect-internal.h