[network-manager-openconnect/NM_0_8] Support new libopenconnect (cherry picked from commit 9150dc373ec398d0260aa684d2d04960fb47359c)
- From: David Woodhouse <dwmw2 src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [network-manager-openconnect/NM_0_8] Support new libopenconnect (cherry picked from commit 9150dc373ec398d0260aa684d2d04960fb47359c)
- Date: Wed, 20 Jun 2012 15:38:00 +0000 (UTC)
commit 642c9cda9639544fb9ee474bbee7fdc21be9624d
Author: David Woodhouse <David Woodhouse intel com>
Date: Fri Jun 8 03:34:15 2012 +0100
Support new libopenconnect
(cherry picked from commit 9150dc373ec398d0260aa684d2d04960fb47359c)
Conflicts:
auth-dialog/main.c
auth-dialog/main.c | 26 +++++++++++++++-----------
configure.ac | 2 +-
2 files changed, 16 insertions(+), 12 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index 9dc3cad..9c4af3a 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -46,6 +46,10 @@
#include "openconnect.h"
+#if OPENCONNECT_API_VERSION_MAJOR == 1
+#define openconnect_vpninfo_new openconnect_vpninfo_new_with_cbdata
+#define openconnect_init_ssl openconnect_init_openssl
+#endif
static GConfClient *_gcl;
static char *_config_path;
@@ -607,10 +611,9 @@ static gboolean ui_form (struct oc_auth_form *form)
return ui_show(ui_data);
}
-static int nm_process_auth_form (struct openconnect_info *vpninfo,
- struct oc_auth_form *form)
+static int nm_process_auth_form (void *cbdata, struct oc_auth_form *form)
{
- auth_ui_data *ui_data = _ui_data; /* FIXME global */
+ auth_ui_data *ui_data = cbdata;
int response;
g_idle_add((GSourceFunc)ui_form, form);
@@ -751,19 +754,19 @@ static gboolean user_validate_cert(cert_data *data)
}
/* runs in worker thread */
-static int validate_peer_cert(struct openconnect_info *vpninfo,
+static int validate_peer_cert(void *cbdata,
OPENCONNECT_X509 *peer_cert, const char *reason)
{
char *config_path = _config_path; /* FIXME global */
GConfClient *gcl = _gcl; /* FIXME global */
- auth_ui_data *ui_data = _ui_data; /* FIXME global */
+ auth_ui_data *ui_data = cbdata;
char fingerprint[41];
char *certs_data;
char *key;
int ret = 0;
cert_data *data;
- ret = openconnect_get_cert_sha1(vpninfo, peer_cert, fingerprint);
+ ret = openconnect_get_cert_sha1(ui_data->vpninfo, peer_cert, fingerprint);
if (ret)
return ret;
@@ -1073,7 +1076,7 @@ static void populate_vpnhost_combo(auth_ui_data *ui_data)
}
}
-static int write_new_config(struct openconnect_info *vpninfo, char *buf, int buflen)
+static int write_new_config(void *cbdata, char *buf, int buflen)
{
char *config_path = _config_path; /* FIXME global */
GConfClient *gcl = _gcl; /* FIXME global */
@@ -1133,7 +1136,7 @@ static gboolean write_notice_real(char *message)
}
/* runs in worker thread */
-static void write_progress(struct openconnect_info *info, int level, const char *fmt, ...)
+static void write_progress(void *cbdata, int level, const char *fmt, ...)
{
va_list args;
char *msg;
@@ -1497,8 +1500,9 @@ static auth_ui_data *init_ui_data (char *vpn_name)
g_unix_set_fd_nonblocking(ui_data->cancel_pipes[1], TRUE, NULL);
ui_data->vpninfo = (void *)openconnect_vpninfo_new("OpenConnect VPN Agent (NetworkManager)",
- validate_peer_cert, write_new_config,
- nm_process_auth_form, write_progress);
+ validate_peer_cert, write_new_config,
+ nm_process_auth_form, write_progress,
+ ui_data);
#if OPENCONNECT_CHECK_VER(1,4)
openconnect_set_cancel_fd (ui_data->vpninfo, ui_data->cancel_pipes[0]);
@@ -1580,7 +1584,7 @@ int main (int argc, char **argv)
#ifdef OPENCONNECT_OPENSSL
init_openssl_ui();
#endif
- openconnect_init_openssl();
+ openconnect_init_ssl();
if (get_gconf_autoconnect(_gcl, _config_path))
queue_connect_host(_ui_data);
diff --git a/configure.ac b/configure.ac
index 4684346..9d2c98b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -74,7 +74,7 @@ if test x"$with_gnome" != xno; then
AC_SUBST(GNOMEKEYRING_LIBS)
if test x"$with_authdlg" != xno; then
- PKG_CHECK_MODULES(OPENCONNECT, openconnect)
+ PKG_CHECK_MODULES(OPENCONNECT, openconnect >= 3.02)
AC_SUBST(OPENCONNECT_CFLAGS)
AC_SUBST(OPENCONNECT_LIBS)
fi
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]