]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
libopenconnect: add public interface stubs for SAML support
authorLuca Boccassi <bluca@debian.org>
Wed, 18 Mar 2020 16:36:25 +0000 (12:36 -0400)
committerLuca Boccassi <bluca@debian.org>
Fri, 11 Feb 2022 09:37:16 +0000 (09:37 +0000)
The SAML support is still work in progress and not merged yet.
Start adding the new public API to libopenconnect, so that
distributions can choose to ship with out-of-tree support to
let their users have the feature without breaking ABI
compatibility.

Signed-off-by: Luca Boccassi <luca.boccassi@microsoft.com>
Co-authored-by: Steven Walter <steven@stevenwalter.org>
libopenconnect.map.in
library.c
openconnect.h

index 9e47bdf47fdb6ea63a9db7672e77271c54fa1e37..c8bd45c2ec706c478272fce7474ec7921062f340 100644 (file)
@@ -115,6 +115,8 @@ OPENCONNECT_5_7 {
        openconnect_get_auth_expiration;
        openconnect_disable_dtls;
        openconnect_get_connect_url;
+       openconnect_set_webview_callback;
+       openconnect_webview_load_changed;
 } OPENCONNECT_5_6;
 
 OPENCONNECT_PRIVATE {
index a06ba6afc239e96e1f5ab26efe4befdbf6f4b4f8..943b2982dcbbe7ce02a350dc1c3e89178bad41c5 100644 (file)
--- a/library.c
+++ b/library.c
@@ -1606,3 +1606,15 @@ retry:
 
        return ret;
 }
+
+void openconnect_set_webview_callback(struct openconnect_info *vpninfo,
+                                     openconnect_open_webview_vfn webview_fn)
+{
+       return;
+}
+
+int openconnect_webview_load_changed(struct openconnect_info *vpninfo,
+                                     const struct oc_webview_result *result)
+{
+       return -EOPNOTSUPP;
+}
index 4f2297a1878bc399aa57f6eb544190b2ea4485f3..e735f33ecdbfd7b469d6f2eb53f655df42698ae6 100644 (file)
@@ -43,6 +43,8 @@ extern "C" {
  *  - Add openconnect_get_auth_expiration()
  *  - Add openconnect_disable_dtls()
  *  - Make openconnect_disable_ipv6() return int
+ *  - Add openconnect_set_webview_callback()
+ *  - Add openconnect_webview_load_changed()
  *
  * API version 5.6 (v8.06; 2020-03-31):
  *  - Add openconnect_set_trojan_interval()
@@ -324,6 +326,17 @@ struct oc_cert {
        void *reserved;
 };
 
+/* Used by openconnect_webview_load_changed() to return data to OC.
+ * The arrays must contain an even number of const strings, with names and
+ * values, and a NULL to terminate. E.g.:
+ * name0, val0, name1, val1, NULL
+ */
+struct oc_webview_result {
+       const char *uri;
+       const char **cookies;
+       const char **headers;
+};
+
 /****************************************************************************/
 
 #define PRG_ERR                0
@@ -732,6 +745,16 @@ struct openconnect_info *openconnect_vpninfo_new(const char *useragent,
                                                 void *privdata);
 void openconnect_vpninfo_free(struct openconnect_info *vpninfo);
 
+typedef int (*openconnect_open_webview_vfn) (struct openconnect_info *,
+                                            const char *uri,
+                                            void *privdata);
+
+void openconnect_set_webview_callback(struct openconnect_info *vpninfo,
+                                     openconnect_open_webview_vfn);
+
+int openconnect_webview_load_changed(struct openconnect_info *vpninfo,
+                                     const struct oc_webview_result *result);
+
 /* Callback to allow binding a newly created socket's file descriptor to
    a specific interface, e.g. with SO_BINDTODEVICE. This tells the kernel
    not to route the traffic in question over the VPN tunnel. */