Moved sources of the NetworkManager plugin to src/frontends.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
compile
|
||||
config.h
|
||||
config.h.in
|
||||
intltool-extract.in
|
||||
intltool-merge.in
|
||||
intltool-update.in
|
||||
mkinstalldirs
|
||||
nm-strongswan-service.name
|
||||
stamp-h1
|
||||
config.guess.cdbs-orig
|
||||
config.sub.cdbs-orig
|
||||
@@ -0,0 +1,26 @@
|
||||
AUTOMAKE_OPTIONS = foreign
|
||||
|
||||
SUBDIRS = properties auth-dialog po
|
||||
|
||||
dbusservicedir = $(sysconfdir)/dbus-1/system.d
|
||||
dbusservice_DATA = nm-strongswan-service.conf
|
||||
|
||||
nmvpnservicedir = $(sysconfdir)/NetworkManager/VPN
|
||||
nmvpnservice_DATA = nm-strongswan-service.name
|
||||
|
||||
@INTLTOOL_DESKTOP_RULE@
|
||||
|
||||
nm-strongswan-service.name: $(srcdir)/nm-strongswan-service.name.in
|
||||
sed -e 's|[@]LIBEXECDIR[@]|$(libexecdir)|' \
|
||||
-e 's|[@]CHARON[@]|$(charon)|' $< >$@
|
||||
|
||||
EXTRA_DIST = nm-strongswan-service.name.in \
|
||||
$(dbusservice_DATA) \
|
||||
intltool-extract.in \
|
||||
intltool-merge.in \
|
||||
intltool-update.in
|
||||
|
||||
CLEANFILES = $(nmvpnservice_DATA) *~
|
||||
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
@@ -0,0 +1,29 @@
|
||||
NetworkManager-strongswan-1.2.0
|
||||
-------------------------------
|
||||
|
||||
- Added Smartcard support
|
||||
|
||||
NetworkManager-strongswan-1.1.2
|
||||
-------------------------------
|
||||
|
||||
- Additionally look for libnm-glib[-vpn] pkgconfig packages during configure
|
||||
- Tooltips are translatable
|
||||
- Update german translations
|
||||
|
||||
NetworkManager-strongswan-1.1.1
|
||||
-------------------------------
|
||||
|
||||
- Implemented save_secrets(), fixes crash when saving connections
|
||||
|
||||
NetworkManager-strongswan-1.1.0
|
||||
-------------------------------
|
||||
|
||||
- updated to NetworkManager 7.1 API
|
||||
|
||||
- requires >= strongswan-4.1.13
|
||||
|
||||
|
||||
NetworkManager-strongswan-1.0.0
|
||||
-------------------------------
|
||||
|
||||
- First release
|
||||
@@ -0,0 +1 @@
|
||||
nm-strongswan-auth-dialog
|
||||
@@ -0,0 +1,26 @@
|
||||
libexec_PROGRAMS = nm-strongswan-auth-dialog
|
||||
|
||||
nm_strongswan_auth_dialog_CPPFLAGS = \
|
||||
$(GTHREAD_CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
$(LIBGNOMEUI_CFLAGS) \
|
||||
$(GNOMEKEYRING_CFLAGS) \
|
||||
$(NETWORK_MANAGER_CFLAGS) \
|
||||
$(NM_UTILS_CFLAGS) \
|
||||
-DICONDIR=\""$(datadir)/pixmaps"\" \
|
||||
-DGLADEDIR=\""$(gladedir)"\" \
|
||||
-DBINDIR=\""$(bindir)"\" \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGNOME_DISABLE_DEPRECATED \
|
||||
-DGNOMELOCALEDIR=\"$(datadir)/locale\" \
|
||||
-DVERSION=\"$(VERSION)\"
|
||||
|
||||
nm_strongswan_auth_dialog_SOURCES = \
|
||||
main.c
|
||||
|
||||
nm_strongswan_auth_dialog_LDADD = \
|
||||
$(GTK_LIBS) \
|
||||
$(LIBGNOMEUI_LIBS) \
|
||||
$(GNOMEKEYRING_LIBS)
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Martin Willi
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
* Copyright (C) 2004 Dan Williams
|
||||
* Red Hat, Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <gnome-keyring.h>
|
||||
#include <libgnomeui/libgnomeui.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
#include <nm-vpn-plugin.h>
|
||||
#include <nm-setting-vpn.h>
|
||||
#include <nm-setting-connection.h>
|
||||
|
||||
#define NM_DBUS_SERVICE_STRONGSWAN "org.freedesktop.NetworkManager.strongswan"
|
||||
|
||||
/**
|
||||
* lookup a password in the keyring
|
||||
*/
|
||||
static char *lookup_password(char *name, char *service)
|
||||
{
|
||||
GList *list;
|
||||
GList *iter;
|
||||
char *pass = NULL;
|
||||
|
||||
if (gnome_keyring_find_network_password_sync(g_get_user_name(), NULL, name,
|
||||
NULL, service, NULL, 0, &list) != GNOME_KEYRING_RESULT_OK)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (iter = list; iter; iter = iter->next)
|
||||
{
|
||||
GnomeKeyringNetworkPasswordData *data = iter->data;
|
||||
|
||||
if (strcmp(data->object, "password") == 0 && data->password)
|
||||
{
|
||||
pass = g_strdup(data->password);
|
||||
break;
|
||||
}
|
||||
}
|
||||
gnome_keyring_network_password_list_free(list);
|
||||
return pass;
|
||||
}
|
||||
|
||||
/**
|
||||
* get the connection type
|
||||
*/
|
||||
static char* get_connection_type(char *uuid)
|
||||
{
|
||||
GConfClient *client = NULL;
|
||||
GSList *list;
|
||||
GSList *iter;
|
||||
char *key, *str, *path, *found = NULL, *method = NULL;
|
||||
|
||||
client = gconf_client_get_default();
|
||||
|
||||
list = gconf_client_all_dirs(client, "/system/networking/connections", NULL);
|
||||
g_return_val_if_fail(list, NULL);
|
||||
|
||||
for (iter = list; iter; iter = iter->next)
|
||||
{
|
||||
path = (char *) iter->data;
|
||||
|
||||
key = g_strdup_printf("%s/%s/%s", path,
|
||||
NM_SETTING_CONNECTION_SETTING_NAME,
|
||||
NM_SETTING_CONNECTION_UUID);
|
||||
str = gconf_client_get_string(client, key, NULL);
|
||||
g_free (key);
|
||||
|
||||
if (str && !strcmp(str, uuid))
|
||||
{
|
||||
found = g_strdup(path);
|
||||
}
|
||||
g_free (str);
|
||||
if (found)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
g_slist_foreach(list, (GFunc)g_free, NULL);
|
||||
g_slist_free(list);
|
||||
|
||||
if (found)
|
||||
{
|
||||
key = g_strdup_printf ("%s/%s/%s", found,
|
||||
NM_SETTING_VPN_SETTING_NAME, "method");
|
||||
method = gconf_client_get_string(client, key, NULL);
|
||||
g_free(found);
|
||||
g_free(key);
|
||||
}
|
||||
g_object_unref(client);
|
||||
return method;
|
||||
}
|
||||
|
||||
int main (int argc, char *argv[])
|
||||
{
|
||||
gboolean retry = FALSE;
|
||||
gchar *name = NULL, *uuid = NULL, *service = NULL, *keyring = NULL, *pass;
|
||||
GOptionContext *context;
|
||||
GnomeProgram *program = NULL;
|
||||
char buf, *agent, *type;
|
||||
guint32 itemid;
|
||||
GtkWidget *dialog;
|
||||
GOptionEntry entries[] = {
|
||||
{ "reprompt", 'r', 0, G_OPTION_ARG_NONE, &retry, "Reprompt for passwords", NULL},
|
||||
{ "uuid", 'u', 0, G_OPTION_ARG_STRING, &uuid, "UUID of VPN connection", NULL},
|
||||
{ "name", 'n', 0, G_OPTION_ARG_STRING, &name, "Name of VPN connection", NULL},
|
||||
{ "service", 's', 0, G_OPTION_ARG_STRING, &service, "VPN service type", NULL},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
bindtextdomain(GETTEXT_PACKAGE, NULL);
|
||||
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
|
||||
textdomain(GETTEXT_PACKAGE);
|
||||
|
||||
context = g_option_context_new ("- strongswan auth dialog");
|
||||
g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE);
|
||||
|
||||
program = gnome_program_init ("nm-strongswan-auth-dialog", VERSION,
|
||||
LIBGNOMEUI_MODULE,
|
||||
argc, argv,
|
||||
GNOME_PARAM_GOPTION_CONTEXT, context,
|
||||
GNOME_PARAM_NONE);
|
||||
|
||||
if (uuid == NULL || name == NULL || service == NULL)
|
||||
{
|
||||
fprintf (stderr, "Have to supply UUID, name, and service\n");
|
||||
g_object_unref (program);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(service, NM_DBUS_SERVICE_STRONGSWAN) != 0)
|
||||
{
|
||||
fprintf(stderr, "This dialog only works with the '%s' service\n",
|
||||
NM_DBUS_SERVICE_STRONGSWAN);
|
||||
g_object_unref (program);
|
||||
return 1;
|
||||
}
|
||||
|
||||
type = get_connection_type(uuid);
|
||||
if (!type)
|
||||
{
|
||||
fprintf(stderr, "Connection lookup failed\n");
|
||||
g_object_unref (program);
|
||||
return 1;
|
||||
}
|
||||
if (!strcmp(type, "eap") || !strcmp(type, "key") || !strcmp(type, "smartcard"))
|
||||
{
|
||||
pass = lookup_password(name, service);
|
||||
if (!pass || retry)
|
||||
{
|
||||
if (!strcmp(type, "eap"))
|
||||
{
|
||||
dialog = gnome_password_dialog_new(_("VPN password required"),
|
||||
_("EAP password required to establish VPN connection:"),
|
||||
NULL, NULL, TRUE);
|
||||
gnome_password_dialog_set_show_remember(GNOME_PASSWORD_DIALOG(dialog), TRUE);
|
||||
}
|
||||
else if (!strcmp(type, "key"))
|
||||
{
|
||||
dialog = gnome_password_dialog_new(_("VPN password required"),
|
||||
_("Private key decryption password required to establish VPN connection:"),
|
||||
NULL, NULL, TRUE);
|
||||
gnome_password_dialog_set_show_remember(GNOME_PASSWORD_DIALOG(dialog), TRUE);
|
||||
}
|
||||
else /* smartcard */
|
||||
{
|
||||
dialog = gnome_password_dialog_new(_("VPN password required"),
|
||||
_("Smartcard PIN required to establish VPN connection:"),
|
||||
NULL, NULL, TRUE);
|
||||
gnome_password_dialog_set_show_remember(GNOME_PASSWORD_DIALOG(dialog), FALSE);
|
||||
}
|
||||
gnome_password_dialog_set_show_username(GNOME_PASSWORD_DIALOG(dialog), FALSE);
|
||||
if (pass)
|
||||
{
|
||||
gnome_password_dialog_set_password(GNOME_PASSWORD_DIALOG(dialog), pass);
|
||||
}
|
||||
if (!gnome_password_dialog_run_and_block(GNOME_PASSWORD_DIALOG(dialog)))
|
||||
{
|
||||
g_object_unref (program);
|
||||
return 1;
|
||||
}
|
||||
|
||||
pass = gnome_password_dialog_get_password(GNOME_PASSWORD_DIALOG(dialog));
|
||||
switch (gnome_password_dialog_get_remember(GNOME_PASSWORD_DIALOG(dialog)))
|
||||
{
|
||||
case GNOME_PASSWORD_DIALOG_REMEMBER_NOTHING:
|
||||
break;
|
||||
case GNOME_PASSWORD_DIALOG_REMEMBER_SESSION:
|
||||
keyring = "session";
|
||||
/* FALL */
|
||||
case GNOME_PASSWORD_DIALOG_REMEMBER_FOREVER:
|
||||
if (gnome_keyring_set_network_password_sync(keyring,
|
||||
g_get_user_name(), NULL, name, "password", service, NULL, 0,
|
||||
pass, &itemid) != GNOME_KEYRING_RESULT_OK)
|
||||
{
|
||||
g_warning ("storing password in keyring failed");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("password\n%s\n", pass);
|
||||
}
|
||||
else
|
||||
{
|
||||
agent = getenv("SSH_AUTH_SOCK");
|
||||
if (agent)
|
||||
{
|
||||
printf("agent\n%s\n", agent);
|
||||
}
|
||||
else
|
||||
{
|
||||
dialog = gtk_message_dialog_new(NULL, 0, GTK_MESSAGE_ERROR,
|
||||
GTK_BUTTONS_OK,
|
||||
_("Configuration uses ssh-agent for authentication, "
|
||||
"but ssh-agent is not running!"));
|
||||
gtk_dialog_run (GTK_DIALOG (dialog));
|
||||
gtk_widget_destroy (dialog);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
printf("\n\n");
|
||||
/* flush output, wait for input */
|
||||
fflush(stdout);
|
||||
if (fread(&buf, 1, sizeof(buf), stdin));
|
||||
g_object_unref(program);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# Run this to generate all the initial makefiles, etc.
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
REQUIRED_AUTOMAKE_VERSION=1.7
|
||||
PKG_NAME=NetworkManager-strongswan
|
||||
|
||||
which gnome-autogen.sh || {
|
||||
echo "You need to install gnome-common from the GNOME CVS"
|
||||
exit 1
|
||||
}
|
||||
USE_GNOME2_MACROS=1 . gnome-autogen.sh
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
AC_PREREQ(2.52)
|
||||
|
||||
AC_INIT(NetworkManager-strongswan, 1.2.0, [email protected], NetworkManager-strongswan)
|
||||
AM_INIT_AUTOMAKE([subdir-objects])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
|
||||
dnl
|
||||
dnl Require programs
|
||||
dnl
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
dnl
|
||||
dnl Required headers
|
||||
dnl
|
||||
AC_HEADER_STDC
|
||||
AC_CHECK_HEADERS(fcntl.h paths.h sys/ioctl.h sys/time.h syslog.h unistd.h)
|
||||
|
||||
dnl
|
||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||
dnl
|
||||
AC_TYPE_MODE_T
|
||||
AC_TYPE_PID_T
|
||||
AC_HEADER_TIME
|
||||
|
||||
dnl
|
||||
dnl Checks for library functions.
|
||||
dnl
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MEMCMP
|
||||
AC_CHECK_FUNCS(select socket uname)
|
||||
|
||||
GETTEXT_PACKAGE=NetworkManager-strongswan
|
||||
AC_SUBST(GETTEXT_PACKAGE)
|
||||
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
|
||||
|
||||
IT_PROG_INTLTOOL([0.35])
|
||||
AM_GLIB_GNU_GETTEXT
|
||||
|
||||
PKG_CHECK_MODULES(GTHREAD, gthread-2.0)
|
||||
AC_SUBST(GTHREAD_CFLAGS)
|
||||
AC_SUBST(GTHREAD_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.30)
|
||||
AC_SUBST(DBUS_CFLAGS)
|
||||
AC_SUBST(DBUS_LIBS)
|
||||
|
||||
if test x"$with_gnome" != xno; then
|
||||
PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6)
|
||||
AC_SUBST(GTK_CFLAGS)
|
||||
AC_SUBST(GTK_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(GDK_PIXBUF, gdk-pixbuf-2.0)
|
||||
AC_SUBST(GDK_PIXBUF_CFLAGS)
|
||||
AC_SUBST(GDK_PIXBUF_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(GLADE, libglade-2.0)
|
||||
AC_SUBST(GLADE_CFLAGS)
|
||||
AC_SUBST(GLADE_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(LIBGNOMEUI, libgnomeui-2.0)
|
||||
AC_SUBST(LIBGNOMEUI_CFLAGS)
|
||||
AC_SUBST(LIBGNOMEUI_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(GCONF, gconf-2.0)
|
||||
AC_SUBST(GCONF_CFLAGS)
|
||||
AC_SUBST(GCONF_LIBS)
|
||||
|
||||
PKG_CHECK_MODULES(GNOMEKEYRING, gnome-keyring-1)
|
||||
AC_SUBST(GNOMEKEYRING_CFLAGS)
|
||||
AC_SUBST(GNOMEKEYRING_LIBS)
|
||||
fi
|
||||
|
||||
PKG_CHECK_EXISTS([libnm-glib],
|
||||
[PKG_CHECK_MODULES(NM_UTILS, NetworkManager >= 0.7.0 libnm-util libnm-glib libnm-glib-vpn)],
|
||||
[PKG_CHECK_MODULES(NM_UTILS, NetworkManager >= 0.7.0 libnm-util libnm_glib libnm_glib_vpn)]
|
||||
)
|
||||
AC_SUBST(NM_UTILS_CFLAGS)
|
||||
AC_SUBST(NM_UTILS_LIBS)
|
||||
|
||||
AC_ARG_WITH(
|
||||
[charon],
|
||||
AS_HELP_STRING([--with-charon=file],[path to the strongSwan IKEv2 daemon charon"]),
|
||||
[AC_SUBST(charon, "$withval")],
|
||||
[AC_SUBST(charon, "${libexecdir}/ipsec/charon")]
|
||||
)
|
||||
|
||||
NM_COMPILER_WARNINGS
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
Makefile
|
||||
properties/Makefile
|
||||
auth-dialog/Makefile
|
||||
po/Makefile.in
|
||||
])
|
||||
AC_OUTPUT
|
||||
@@ -0,0 +1,6 @@
|
||||
files
|
||||
network-manager-strongswan.debhelper.log
|
||||
network-manager-strongswan.substvars
|
||||
network-manager-strongswan/
|
||||
stamp-autotools-files
|
||||
stamp-makefile-build
|
||||
@@ -0,0 +1,33 @@
|
||||
network-manager-strongswan (1.1.2-1) unstable; urgency=low
|
||||
|
||||
* New upstream release, fixes pkgconfig for new libnm-glib packages
|
||||
(Closes: #569302)
|
||||
|
||||
-- Martin Willi <[email protected]> Thu, 18 Feb 2010 09:41:39 +0100
|
||||
|
||||
network-manager-strongswan (1.1.1-2) unstable; urgency=low
|
||||
|
||||
* Added ${shlibs:Depends} dependency
|
||||
* Reload network-manager after installation, reloading dbus is insufficient.
|
||||
* Fixed debhelper-but-no-misc-depends, out-of-date-standards-version and
|
||||
copyright-without-copyright-notice lintian warnings
|
||||
|
||||
-- Martin Willi <[email protected]> Mon, 12 Oct 2009 10:19:40 +0200
|
||||
|
||||
network-manager-strongswan (1.1.1-1) unstable; urgency=low
|
||||
|
||||
* New upstream release fixing a crasher when saving connections
|
||||
* Fix "Wrong path to network-manager initscript in postinst"
|
||||
Reload dbus instead of network-manager, as other VPN plugins do.
|
||||
(Closes: #529189)
|
||||
* Fix "FTBFS: No package 'libnm-util' found"
|
||||
added dependencies to libnm-util-dev and libnm-glib-vpn-dev
|
||||
(Closes: #528977)
|
||||
|
||||
-- Martin Willi <[email protected]> Tue, 19 May 2009 13:16:51 +0200
|
||||
|
||||
network-manager-strongswan (1.1.0-1) unstable; urgency=low
|
||||
|
||||
* Initial Debian packaging of NetworkManager plugin for strongSwan
|
||||
|
||||
-- Martin Willi <[email protected]> Wed, 25 Mar 2009 09:07:05 +0100
|
||||
@@ -0,0 +1 @@
|
||||
7
|
||||
@@ -0,0 +1,29 @@
|
||||
Source: network-manager-strongswan
|
||||
Section: net
|
||||
Priority: extra
|
||||
Maintainer: Martin Willi <[email protected]>
|
||||
Build-Depends: cdbs,
|
||||
debhelper (>= 7),
|
||||
network-manager-dev (>= 0.7),
|
||||
libnm-util-dev (>= 0.7),
|
||||
libnm-glib-dev (>= 0.7),
|
||||
libnm-glib-vpn-dev (>= 0.7),
|
||||
libdbus-glib-1-dev,
|
||||
libglade2-dev,
|
||||
libgnomeui-dev,
|
||||
automake1.9,
|
||||
gnome-common,
|
||||
Standards-Version: 3.8.3
|
||||
|
||||
Package: network-manager-strongswan
|
||||
Architecture: any
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}, strongswan-nm, network-manager
|
||||
Description: network management framework (strongSwan plugin)
|
||||
NetworkManager attempts to keep an active network connection available at
|
||||
all times. It is intended primarily for laptops where it allows easy
|
||||
switching between local wireless networks, it's also useful on desktops
|
||||
with a selection of different interfaces to use. It is not intended for
|
||||
usage on servers.
|
||||
.
|
||||
This package provides a VPN plugin for strongSwan, providing easy access to
|
||||
IKEv2 IPSec VPN's.
|
||||
@@ -0,0 +1,10 @@
|
||||
Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59
|
||||
Name: NetworkManager-strongswan
|
||||
Source: http://download.strongswan.org/NetworkManager
|
||||
|
||||
Copyright: 2008-2009, Martin Willi <[email protected]>
|
||||
2005-2008, Dan Williams
|
||||
2005, David Zeuthen
|
||||
License: GPL-2
|
||||
On Debian systems the full text of the GNU General Public License can be found
|
||||
in the `/usr/share/common-licenses/GPL-2' file.
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
case "$1" in
|
||||
configure)
|
||||
if [ -x "/etc/init.d/network-manager" ]; then
|
||||
if [ -x /usr/sbin/invoke-rc.d ]; then
|
||||
invoke-rc.d network-manager force-reload || true
|
||||
else
|
||||
/etc/init.d/network-manager force-reload || true
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
#DEBHELPER#
|
||||
|
||||
exit 0
|
||||
Executable
+15
@@ -0,0 +1,15 @@
|
||||
#!/usr/bin/make -f
|
||||
|
||||
include /usr/share/cdbs/1/rules/debhelper.mk
|
||||
include /usr/share/cdbs/1/class/autotools.mk
|
||||
|
||||
DEB_CONFIGURE_EXTRA_FLAGS := --with-charon=/usr/lib/ipsec/charon
|
||||
|
||||
DEB_CONFIGURE_LIBEXECDIR := "\$$(prefix)/lib/NetworkManager"
|
||||
|
||||
DEB_DH_MAKESHLIBS_ARGS_ALL := -X/usr/lib/NetworkManager/
|
||||
|
||||
DEB_DH_INSTALL_SOURCEDIR := debian/tmp
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
intltool.m4
|
||||
libtool.m4
|
||||
ltoptions.m4
|
||||
ltsugar.m4
|
||||
ltversion.m4
|
||||
lt~obsolete.m4
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
AC_DEFUN([NM_COMPILER_WARNINGS],
|
||||
[AC_ARG_ENABLE(more-warnings,
|
||||
AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]),
|
||||
set_more_warnings="$enableval",set_more_warnings=yes)
|
||||
AC_MSG_CHECKING(for more warnings, including -Werror)
|
||||
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
|
||||
|
||||
for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \
|
||||
-Wdeclaration-after-statement -Wstrict-prototypes \
|
||||
-Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \
|
||||
-fno-strict-aliasing; do
|
||||
SAVE_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS $option"
|
||||
AC_MSG_CHECKING([whether gcc understands $option])
|
||||
AC_TRY_COMPILE([], [],
|
||||
has_option=yes,
|
||||
has_option=no,)
|
||||
if test $has_option = no; then
|
||||
CFLAGS="$SAVE_CFLAGS"
|
||||
fi
|
||||
AC_MSG_RESULT($has_option)
|
||||
unset has_option
|
||||
unset SAVE_CFLAGS
|
||||
done
|
||||
unset option
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])
|
||||
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE busconfig PUBLIC
|
||||
"-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
|
||||
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
|
||||
<busconfig>
|
||||
<policy user="root">
|
||||
<allow own="org.freedesktop.NetworkManager.strongswan"/>
|
||||
<allow send_destination="org.freedesktop.NetworkManager.strongswan"/>
|
||||
<allow send_interface="org.freedesktop.NetworkManager.strongswan"/>
|
||||
</policy>
|
||||
<policy context="default">
|
||||
<deny own="org.freedesktop.NetworkManager.strongswan"/>
|
||||
<deny send_destination="org.freedesktop.NetworkManager.strongswan"/>
|
||||
<deny send_interface="org.freedesktop.NetworkManager.strongswan"/>
|
||||
</policy>
|
||||
</busconfig>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
[VPN Connection]
|
||||
name=strongswan
|
||||
service=org.freedesktop.NetworkManager.strongswan
|
||||
program=@CHARON@
|
||||
|
||||
[GNOME]
|
||||
auth-dialog=@LIBEXECDIR@/nm-strongswan-auth-dialog
|
||||
properties=libnm-strongswan-properties
|
||||
@@ -0,0 +1,4 @@
|
||||
Makefile.in.in
|
||||
POTFILES
|
||||
de.gmo
|
||||
stamp-it
|
||||
@@ -0,0 +1,2 @@
|
||||
# please keep this list sorted alphabetically
|
||||
de
|
||||
@@ -0,0 +1,5 @@
|
||||
# List of source files containing translatable strings.
|
||||
# Please keep this file sorted alphabetically.
|
||||
properties/nm-strongswan.c
|
||||
properties/nm-strongswan-dialog.glade
|
||||
auth-dialog/main.c
|
||||
@@ -0,0 +1,173 @@
|
||||
# Translations for NetworkManager-strongswan.
|
||||
# Copyright (C) 2010 Martin Willi <[email protected]>
|
||||
# This file is distributed under the same license as the
|
||||
# NetworkManager-strongswan package.
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: NetworkManager-strongswan\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2010-08-11 16:12+0200\n"
|
||||
"PO-Revision-Date: 2010-02-18 09:20+0100\n"
|
||||
"Last-Translator: Martin Willi <[email protected]>\n"
|
||||
"Language-Team: de <[email protected]>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: ../properties/nm-strongswan.c:38
|
||||
msgid "IPsec/IKEv2 (strongswan)"
|
||||
msgstr "IPsec/IKEv2 (strongswan)"
|
||||
|
||||
#: ../properties/nm-strongswan.c:39
|
||||
msgid "IPsec with the IKEv2 key exchange protocol."
|
||||
msgstr "IPsec mit dem IKEv2 Protokoll."
|
||||
|
||||
#: ../properties/nm-strongswan.c:208
|
||||
msgid "Certificate/private key"
|
||||
msgstr "Zertifikat/Privater Schlüssel"
|
||||
|
||||
#: ../properties/nm-strongswan.c:209
|
||||
msgid "Certificate/ssh-agent"
|
||||
msgstr "Zertifikat/ssh-agent"
|
||||
|
||||
#: ../properties/nm-strongswan.c:210
|
||||
msgid "Smartcard"
|
||||
msgstr "Smartcard"
|
||||
|
||||
#: ../properties/nm-strongswan.c:211
|
||||
msgid "EAP"
|
||||
msgstr "EAP"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:1
|
||||
msgid "<b>Client</b>"
|
||||
msgstr "<b>Client</b>"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:2
|
||||
msgid "<b>Gateway</b>"
|
||||
msgstr "<b>Gateway</b>"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:3
|
||||
msgid "<b>Options</b>"
|
||||
msgstr "<b>Optionen</b>"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:4
|
||||
msgid "An IP address or hostname the Gateway can be contacted."
|
||||
msgstr "Ein IP-Adresse oder einen Rechnernamen des Gateways."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:5
|
||||
msgid "Au_thentication:"
|
||||
msgstr "Au_thentisierung:"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:6
|
||||
msgid "Authentication Method to use for authentication against the Gateway. "
|
||||
msgstr "Methode zur Authentisierung gegenüber dem Gateway."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:7
|
||||
msgid "C_ertificate:"
|
||||
msgstr "Z_ertifikat:"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:8
|
||||
msgid "Ce_rtificate:"
|
||||
msgstr "Ze_rtifikat:"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:9
|
||||
msgid "Client certificate to use for client authentication."
|
||||
msgstr "Zertifikat des Clients für dessen Authentisierung."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:10
|
||||
msgid "En_force UDP encapsulation"
|
||||
msgstr "Erzwingen einer zusätzlichen Einbettung der Datenpakete in _UDP"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:11
|
||||
msgid ""
|
||||
"Gateway or CA certificate to use for gateway authentication. If none is "
|
||||
"specified, pre-installed CA certificates are used."
|
||||
msgstr ""
|
||||
"Gateway- oder CA-Zertifikat für die Authentisierung des Gateways. Ohne "
|
||||
"Angabe eines Zertifikates werden die CA-Zertifikate des Systems verwendet."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:12
|
||||
msgid ""
|
||||
"IPComp compresses raw IP packets before they get encrypted. This saves some "
|
||||
"bandwith, but uses more processing power."
|
||||
msgstr ""
|
||||
"IPComp komprimiert IP-Pakete, bevor sie verschlüsselt werden. Diese Option "
|
||||
"kann Bandbreite sparen, benötigt jedoch zusätzliche Rechenleistung."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:13
|
||||
msgid "Private _key:"
|
||||
msgstr "Privater _Schlüssel:"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:14
|
||||
msgid ""
|
||||
"Private key to use for client authentication. This key has to match the "
|
||||
"certificates public key and may be encrypted."
|
||||
msgstr ""
|
||||
"Privater Schlüssel für die Authentisierung des Clients. Dieser Schlüssel "
|
||||
"muss zum konfigurierten Zertifikat passen und kann verschlüsselt sein."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:15
|
||||
msgid "Request an _inner IP address"
|
||||
msgstr "_Innere IP-Adresse beziehen"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:16
|
||||
msgid ""
|
||||
"Some firewalls block ESP traffic. Enforcing UDP capsulation even if no NAT "
|
||||
"situation is detected might help in such cases."
|
||||
msgstr ""
|
||||
"Manche Firewalls blockieren Datenverkehr mit dem ESP-Protokoll. Das "
|
||||
"erzwingen einer zustzlichen Einbettung in UDP, auch wenn kein NAT-Router "
|
||||
"detektiert wurde, kann in solchen Situationen hilfreich sein."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:17
|
||||
msgid ""
|
||||
"The Gateway may provide addresses from a pool to use for communication in "
|
||||
"the Gateways network. Check to request such an address."
|
||||
msgstr ""
|
||||
"Der Gateway kann IP-Adressen bereitstellen, welche der Client für die "
|
||||
"Kommunikation im dahinterliegenden Netz verwenden kann. Aktivieren, um eine "
|
||||
"solche Adresse zu beziehen."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:18
|
||||
msgid "The username (identity) to use for authentication against the gateway."
|
||||
msgstr "Benutzername/Identität für die Authentisierung gegenüber dem Gateway."
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:19
|
||||
msgid "Use IP c_ompression"
|
||||
msgstr "IP-Pakete k_omprimieren"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:20
|
||||
msgid "_Address:"
|
||||
msgstr "_Adresse:"
|
||||
|
||||
#: ../properties/nm-strongswan-dialog.glade.h:21
|
||||
msgid "_Username:"
|
||||
msgstr "_Benutzername:"
|
||||
|
||||
#: ../auth-dialog/main.c:172 ../auth-dialog/main.c:179
|
||||
#: ../auth-dialog/main.c:186
|
||||
msgid "VPN password required"
|
||||
msgstr "VPN Passwort notwendig"
|
||||
|
||||
#: ../auth-dialog/main.c:173
|
||||
msgid "EAP password required to establish VPN connection:"
|
||||
msgstr "Für die Erstellung des VPN-Tunnels ist ein EAP-Passwort erforderlich:"
|
||||
|
||||
#: ../auth-dialog/main.c:180
|
||||
msgid "Private key decryption password required to establish VPN connection:"
|
||||
msgstr ""
|
||||
"Der Private Schlüssel für die Erstellung des VPN-Tunnels ist durch ein "
|
||||
"Passwort geschützt:"
|
||||
|
||||
#: ../auth-dialog/main.c:187
|
||||
#, fuzzy
|
||||
msgid "Smartcard PIN required to establish VPN connection:"
|
||||
msgstr "Für die Smartcard ist eine PIN erforderlich:"
|
||||
|
||||
#: ../auth-dialog/main.c:233
|
||||
msgid ""
|
||||
"Configuration uses ssh-agent for authentication, but ssh-agent is not "
|
||||
"running!"
|
||||
msgstr ""
|
||||
"Die Konfiguration verwendet ssh-agent fr die Authentisierung, aber ssh-agent "
|
||||
"ist nicht gestartet!"
|
||||
@@ -0,0 +1,37 @@
|
||||
plugindir = $(libdir)/NetworkManager
|
||||
plugin_LTLIBRARIES = libnm-strongswan-properties.la
|
||||
|
||||
libnm_strongswan_properties_la_SOURCES = \
|
||||
nm-strongswan.c \
|
||||
nm-strongswan.h
|
||||
|
||||
gladedir = $(datadir)/gnome-vpn-properties/strongswan
|
||||
glade_DATA = nm-strongswan-dialog.glade
|
||||
|
||||
libnm_strongswan_properties_la_CFLAGS = \
|
||||
$(GLADE_CFLAGS) \
|
||||
$(GTK_CFLAGS) \
|
||||
$(GCONF_CFLAGS) \
|
||||
$(LIBGNOMEUI_CFLAGS) \
|
||||
$(NM_UTILS_CFLAGS) \
|
||||
-DICONDIR=\""$(datadir)/pixmaps"\" \
|
||||
-DGLADEDIR=\""$(gladedir)"\" \
|
||||
-DG_DISABLE_DEPRECATED \
|
||||
-DGDK_DISABLE_DEPRECATED \
|
||||
-DGNOME_DISABLE_DEPRECATED \
|
||||
-DGNOMELOCALEDIR=\"$(datadir)/locale\" \
|
||||
-DVERSION=\"$(VERSION)\"
|
||||
|
||||
libnm_strongswan_properties_la_LIBADD = \
|
||||
$(GLADE_LIBS) \
|
||||
$(GTK_LIBS) \
|
||||
$(GCONF_LIBS) \
|
||||
$(LIBGNOMEUI_LIBS) \
|
||||
$(NM_UTILS_LIBS)
|
||||
|
||||
libnm_strongswan_properties_la_LDFLAGS = \
|
||||
-avoid-version
|
||||
|
||||
CLEANFILES = *.bak *.gladep *~
|
||||
|
||||
EXTRA_DIST = $(glade_DATA)
|
||||
@@ -0,0 +1,346 @@
|
||||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<!-- interface-requires gtk+ 2.12 -->
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<widget class="GtkWindow" id="strongswan-widget">
|
||||
<property name="title" translatable="yes">window1</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="strongswan-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="border_width">12</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">16</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="gateway-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="gateway-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes"><b>Gateway</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="gateway-alignement">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="gateway-table">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">2</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="address-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Address:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">address-entry</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="address-entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip" translatable="yes">An IP address or hostname the Gateway can be contacted.</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="certificate-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">C_ertificate:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">certificate-button</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkFileChooserButton" id="certificate-button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Gateway or CA certificate to use for gateway authentication. If none is specified, pre-installed CA certificates are used.</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="client-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="client-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes"><b>Client</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="client-aligement">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkTable" id="client-table">
|
||||
<property name="visible">True</property>
|
||||
<property name="n_rows">4</property>
|
||||
<property name="n_columns">2</property>
|
||||
<property name="column_spacing">6</property>
|
||||
<property name="row_spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkFileChooserButton" id="userkey-button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Private key to use for client authentication. This key has to match the certificates public key and may be encrypted.</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="userkey-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Private _key:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">userkey-button</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">3</property>
|
||||
<property name="bottom_attach">4</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkComboBox" id="method-combo">
|
||||
<property name="visible">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip" translatable="yes">Authentication Method to use for authentication against the Gateway. </property>
|
||||
<property name="items"></property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="method-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Au_thentication:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">method-combo</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="user-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">_Username:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">user-entry</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkEntry" id="user-entry">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip" translatable="yes">The username (identity) to use for authentication against the gateway.</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="usercert-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Ce_rtificate:</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="mnemonic_widget">usercert-button</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
<property name="x_options">GTK_FILL</property>
|
||||
<property name="y_options"></property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkFileChooserButton" id="usercert-button">
|
||||
<property name="visible">True</property>
|
||||
<property name="tooltip" translatable="yes">Client certificate to use for client authentication.</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="options-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="options-label">
|
||||
<property name="visible">True</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes"><b>Options</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkAlignment" id="options-alignement">
|
||||
<property name="visible">True</property>
|
||||
<property name="left_padding">12</property>
|
||||
<child>
|
||||
<widget class="GtkVBox" id="options-inner-vbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="virtual-check">
|
||||
<property name="label" translatable="yes">Request an _inner IP address</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip" translatable="yes">The Gateway may provide addresses from a pool to use for communication in the Gateways network. Check to request such an address.</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="encap-check">
|
||||
<property name="label" translatable="yes">En_force UDP encapsulation</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip" translatable="yes">Some firewalls block ESP traffic. Enforcing UDP capsulation even if no NAT situation is detected might help in such cases.</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="ipcomp-check">
|
||||
<property name="label" translatable="yes">Use IP c_ompression</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">False</property>
|
||||
<property name="has_tooltip">True</property>
|
||||
<property name="tooltip" translatable="yes">IPComp compresses raw IP packets before they get encrypted. This saves some bandwith, but uses more processing power.</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</child>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
@@ -0,0 +1,541 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Martin Willi
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
* Copyright (C) 2005 David Zeuthen
|
||||
* Copyright (C) 2005-2008 Dan Williams
|
||||
*
|
||||
* Based on NetworkManager's vpnc plugin
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <glade/glade.h>
|
||||
|
||||
#define NM_VPN_API_SUBJECT_TO_CHANGE
|
||||
|
||||
#include <nm-vpn-plugin-ui-interface.h>
|
||||
#include <nm-setting-vpn.h>
|
||||
#include <nm-setting-connection.h>
|
||||
#include <nm-setting-ip4-config.h>
|
||||
|
||||
#include "nm-strongswan.h"
|
||||
|
||||
#define STRONGSWAN_PLUGIN_NAME _("IPsec/IKEv2 (strongswan)")
|
||||
#define STRONGSWAN_PLUGIN_DESC _("IPsec with the IKEv2 key exchange protocol.")
|
||||
#define STRONGSWAN_PLUGIN_SERVICE "org.freedesktop.NetworkManager.strongswan"
|
||||
#define NM_DBUS_SERVICE_STRONGSWAN "org.freedesktop.NetworkManager.strongswan"
|
||||
|
||||
/************** plugin class **************/
|
||||
|
||||
static void strongswan_plugin_ui_interface_init (NMVpnPluginUiInterface *iface_class);
|
||||
|
||||
G_DEFINE_TYPE_EXTENDED (StrongswanPluginUi, strongswan_plugin_ui, G_TYPE_OBJECT, 0,
|
||||
G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_PLUGIN_UI_INTERFACE,
|
||||
strongswan_plugin_ui_interface_init))
|
||||
|
||||
/************** UI widget class **************/
|
||||
|
||||
static void strongswan_plugin_ui_widget_interface_init (NMVpnPluginUiWidgetInterface *iface_class);
|
||||
|
||||
G_DEFINE_TYPE_EXTENDED (StrongswanPluginUiWidget, strongswan_plugin_ui_widget, G_TYPE_OBJECT, 0,
|
||||
G_IMPLEMENT_INTERFACE (NM_TYPE_VPN_PLUGIN_UI_WIDGET_INTERFACE,
|
||||
strongswan_plugin_ui_widget_interface_init))
|
||||
|
||||
#define STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), STRONGSWAN_TYPE_PLUGIN_UI_WIDGET, StrongswanPluginUiWidgetPrivate))
|
||||
|
||||
typedef struct {
|
||||
GladeXML *xml;
|
||||
GtkWidget *widget;
|
||||
} StrongswanPluginUiWidgetPrivate;
|
||||
|
||||
|
||||
#define STRONGSWAN_PLUGIN_UI_ERROR strongswan_plugin_ui_error_quark ()
|
||||
|
||||
static GQuark
|
||||
strongswan_plugin_ui_error_quark (void)
|
||||
{
|
||||
static GQuark error_quark = 0;
|
||||
|
||||
if (G_UNLIKELY (error_quark == 0))
|
||||
error_quark = g_quark_from_static_string ("strongswan-plugin-ui-error-quark");
|
||||
|
||||
return error_quark;
|
||||
}
|
||||
|
||||
#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
|
||||
|
||||
GType
|
||||
strongswan_plugin_ui_error_get_type (void)
|
||||
{
|
||||
static GType etype = 0;
|
||||
|
||||
if (etype == 0) {
|
||||
static const GEnumValue values[] = {
|
||||
/* Unknown error. */
|
||||
ENUM_ENTRY (STRONGSWAN_PLUGIN_UI_ERROR_UNKNOWN, "UnknownError"),
|
||||
/* The specified property was invalid. */
|
||||
ENUM_ENTRY (STRONGSWAN_PLUGIN_UI_ERROR_INVALID_PROPERTY, "InvalidProperty"),
|
||||
/* The specified property was missing and is required. */
|
||||
ENUM_ENTRY (STRONGSWAN_PLUGIN_UI_ERROR_MISSING_PROPERTY, "MissingProperty"),
|
||||
{ 0, 0, 0 }
|
||||
};
|
||||
etype = g_enum_register_static ("StrongswanPluginUiError", values);
|
||||
}
|
||||
return etype;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
check_validity (StrongswanPluginUiWidget *self, GError **error)
|
||||
{
|
||||
StrongswanPluginUiWidgetPrivate *priv = STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
|
||||
GtkWidget *widget;
|
||||
char *str;
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "address-entry");
|
||||
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
|
||||
if (!str || !strlen (str)) {
|
||||
g_set_error (error,
|
||||
STRONGSWAN_PLUGIN_UI_ERROR,
|
||||
STRONGSWAN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
|
||||
"address");
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void update_layout (GtkWidget *widget, StrongswanPluginUiWidgetPrivate *priv)
|
||||
{
|
||||
switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
|
||||
{
|
||||
default:
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
|
||||
/* FALL */
|
||||
case 0:
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "usercert-label"));
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "usercert-button"));
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "userkey-label"));
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "userkey-button"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "user-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "user-entry"));
|
||||
break;
|
||||
case 1:
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "usercert-label"));
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "usercert-button"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "user-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "user-entry"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "userkey-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "userkey-button"));
|
||||
break;
|
||||
case 2:
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "usercert-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "usercert-button"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "user-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "user-entry"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "userkey-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "userkey-button"));
|
||||
break;
|
||||
case 3:
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "user-label"));
|
||||
gtk_widget_show (glade_xml_get_widget (priv->xml, "user-entry"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "usercert-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "usercert-button"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "userkey-label"));
|
||||
gtk_widget_hide (glade_xml_get_widget (priv->xml, "userkey-button"));
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
settings_changed_cb (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
StrongswanPluginUiWidget *self = STRONGSWAN_PLUGIN_UI_WIDGET (user_data);
|
||||
StrongswanPluginUiWidgetPrivate *priv = STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
|
||||
|
||||
if (widget == glade_xml_get_widget (priv->xml, "method-combo"))
|
||||
{
|
||||
update_layout(glade_xml_get_widget (priv->xml, "method-combo"), priv);
|
||||
}
|
||||
g_signal_emit_by_name (STRONGSWAN_PLUGIN_UI_WIDGET (user_data), "changed");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
init_plugin_ui (StrongswanPluginUiWidget *self, NMConnection *connection, GError **error)
|
||||
{
|
||||
StrongswanPluginUiWidgetPrivate *priv = STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
|
||||
NMSettingVPN *settings;
|
||||
GtkWidget *widget;
|
||||
const char *value;
|
||||
|
||||
settings = NM_SETTING_VPN(nm_connection_get_setting(connection, NM_TYPE_SETTING_VPN));
|
||||
widget = glade_xml_get_widget (priv->xml, "address-entry");
|
||||
value = nm_setting_vpn_get_data_item (settings, "address");
|
||||
if (value)
|
||||
gtk_entry_set_text (GTK_ENTRY (widget), value);
|
||||
g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "certificate-button");
|
||||
value = nm_setting_vpn_get_data_item (settings, "certificate");
|
||||
if (value)
|
||||
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
|
||||
g_signal_connect (G_OBJECT (widget), "selection-changed", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "user-label");
|
||||
gtk_widget_set_no_show_all (widget, TRUE);
|
||||
widget = glade_xml_get_widget (priv->xml, "user-entry");
|
||||
gtk_widget_set_no_show_all (widget, TRUE);
|
||||
value = nm_setting_vpn_get_data_item (settings, "user");
|
||||
if (value)
|
||||
gtk_entry_set_text (GTK_ENTRY (widget), value);
|
||||
g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "method-combo");
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Certificate/private key"));
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Certificate/ssh-agent"));
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("Smartcard"));
|
||||
gtk_combo_box_append_text (GTK_COMBO_BOX (widget), _("EAP"));
|
||||
value = nm_setting_vpn_get_data_item (settings, "method");
|
||||
if (value) {
|
||||
if (g_strcmp0 (value, "key") == 0) {
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
|
||||
}
|
||||
if (g_strcmp0 (value, "agent") == 0) {
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 1);
|
||||
}
|
||||
if (g_strcmp0 (value, "smartcard") == 0) {
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 2);
|
||||
}
|
||||
if (g_strcmp0 (value, "eap") == 0) {
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 3);
|
||||
}
|
||||
}
|
||||
if (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)) == -1)
|
||||
{
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (widget), 0);
|
||||
}
|
||||
update_layout (widget, priv);
|
||||
g_signal_connect (G_OBJECT (widget), "changed", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "usercert-label");
|
||||
gtk_widget_set_no_show_all (widget, TRUE);
|
||||
widget = glade_xml_get_widget (priv->xml, "usercert-button");
|
||||
gtk_widget_set_no_show_all (widget, TRUE);
|
||||
value = nm_setting_vpn_get_data_item (settings, "usercert");
|
||||
if (value)
|
||||
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
|
||||
g_signal_connect (G_OBJECT (widget), "selection-changed", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "userkey-label");
|
||||
gtk_widget_set_no_show_all (widget, TRUE);
|
||||
widget = glade_xml_get_widget (priv->xml, "userkey-button");
|
||||
gtk_widget_set_no_show_all (widget, TRUE);
|
||||
value = nm_setting_vpn_get_data_item (settings, "userkey");
|
||||
if (value)
|
||||
gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (widget), value);
|
||||
g_signal_connect (G_OBJECT (widget), "selection-changed", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "virtual-check");
|
||||
value = nm_setting_vpn_get_data_item (settings, "virtual");
|
||||
if (value && strcmp(value, "yes") == 0)
|
||||
{
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
|
||||
}
|
||||
g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "encap-check");
|
||||
value = nm_setting_vpn_get_data_item (settings, "encap");
|
||||
if (value && strcmp(value, "yes") == 0)
|
||||
{
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
|
||||
}
|
||||
g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "ipcomp-check");
|
||||
value = nm_setting_vpn_get_data_item (settings, "ipcomp");
|
||||
if (value && strcmp(value, "yes") == 0)
|
||||
{
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
|
||||
}
|
||||
g_signal_connect (G_OBJECT (widget), "toggled", G_CALLBACK (settings_changed_cb), self);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GObject *
|
||||
get_widget (NMVpnPluginUiWidgetInterface *iface)
|
||||
{
|
||||
StrongswanPluginUiWidget *self = STRONGSWAN_PLUGIN_UI_WIDGET (iface);
|
||||
StrongswanPluginUiWidgetPrivate *priv = STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
|
||||
|
||||
return G_OBJECT (priv->widget);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
update_connection (NMVpnPluginUiWidgetInterface *iface,
|
||||
NMConnection *connection,
|
||||
GError **error)
|
||||
{
|
||||
StrongswanPluginUiWidget *self = STRONGSWAN_PLUGIN_UI_WIDGET (iface);
|
||||
StrongswanPluginUiWidgetPrivate *priv = STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (self);
|
||||
NMSettingVPN *settings;
|
||||
GtkWidget *widget;
|
||||
gboolean active;
|
||||
char *str;
|
||||
|
||||
if (!check_validity (self, error))
|
||||
return FALSE;
|
||||
settings = NM_SETTING_VPN (nm_setting_vpn_new ());
|
||||
|
||||
g_object_set (settings, NM_SETTING_VPN_SERVICE_TYPE,
|
||||
NM_DBUS_SERVICE_STRONGSWAN, NULL);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "address-entry");
|
||||
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
|
||||
if (str && strlen (str)) {
|
||||
nm_setting_vpn_add_data_item (settings, "address", str);
|
||||
}
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "certificate-button");
|
||||
str = (char *) gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
||||
if (str) {
|
||||
nm_setting_vpn_add_data_item (settings, "certificate", str);
|
||||
}
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "method-combo");
|
||||
switch (gtk_combo_box_get_active (GTK_COMBO_BOX (widget)))
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
widget = glade_xml_get_widget (priv->xml, "userkey-button");
|
||||
str = (char *) gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
||||
if (str) {
|
||||
nm_setting_vpn_add_data_item (settings, "userkey", str);
|
||||
}
|
||||
widget = glade_xml_get_widget (priv->xml, "usercert-button");
|
||||
str = (char *) gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
||||
if (str) {
|
||||
nm_setting_vpn_add_data_item (settings, "usercert", str);
|
||||
}
|
||||
str = "key";
|
||||
break;
|
||||
case 1:
|
||||
widget = glade_xml_get_widget (priv->xml, "usercert-button");
|
||||
str = (char *) gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (widget));
|
||||
if (str) {
|
||||
nm_setting_vpn_add_data_item (settings, "usercert", str);
|
||||
}
|
||||
str = "agent";
|
||||
break;
|
||||
case 2:
|
||||
str = "smartcard";
|
||||
break;
|
||||
case 3:
|
||||
widget = glade_xml_get_widget (priv->xml, "user-entry");
|
||||
str = (char *) gtk_entry_get_text (GTK_ENTRY (widget));
|
||||
if (str && strlen (str)) {
|
||||
nm_setting_vpn_add_data_item (settings, "user", str);
|
||||
}
|
||||
str = "eap";
|
||||
break;
|
||||
}
|
||||
nm_setting_vpn_add_data_item (settings, "method", str);
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "virtual-check");
|
||||
active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
|
||||
nm_setting_vpn_add_data_item (settings, "virtual", active ? "yes" : "no");
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "encap-check");
|
||||
active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
|
||||
nm_setting_vpn_add_data_item (settings, "encap", active ? "yes" : "no");
|
||||
|
||||
widget = glade_xml_get_widget (priv->xml, "ipcomp-check");
|
||||
active = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
|
||||
nm_setting_vpn_add_data_item (settings, "ipcomp", active ? "yes" : "no");
|
||||
|
||||
nm_connection_add_setting (connection, NM_SETTING (settings));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
save_secrets (NMVpnPluginUiWidgetInterface *iface,
|
||||
NMConnection *connection, GError **error)
|
||||
{
|
||||
/* no secrets to save */
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static NMVpnPluginUiWidgetInterface *
|
||||
nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
|
||||
{
|
||||
NMVpnPluginUiWidgetInterface *object;
|
||||
StrongswanPluginUiWidgetPrivate *priv;
|
||||
char *glade_file;
|
||||
|
||||
if (error)
|
||||
g_return_val_if_fail (*error == NULL, NULL);
|
||||
|
||||
object = NM_VPN_PLUGIN_UI_WIDGET_INTERFACE (g_object_new (STRONGSWAN_TYPE_PLUGIN_UI_WIDGET, NULL));
|
||||
if (!object) {
|
||||
g_set_error (error, STRONGSWAN_PLUGIN_UI_ERROR, 0, "could not create strongswan object");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
priv = STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (object);
|
||||
|
||||
glade_file = g_strdup_printf ("%s/%s", GLADEDIR, "nm-strongswan-dialog.glade");
|
||||
priv->xml = glade_xml_new (glade_file, "strongswan-vbox", GETTEXT_PACKAGE);
|
||||
if (priv->xml == NULL) {
|
||||
g_set_error (error, STRONGSWAN_PLUGIN_UI_ERROR, 0,
|
||||
"could not load required resources at %s", glade_file);
|
||||
g_free (glade_file);
|
||||
g_object_unref (object);
|
||||
return NULL;
|
||||
}
|
||||
g_free (glade_file);
|
||||
|
||||
priv->widget = glade_xml_get_widget (priv->xml, "strongswan-vbox");
|
||||
if (!priv->widget) {
|
||||
g_set_error (error, STRONGSWAN_PLUGIN_UI_ERROR, 0, "could not load UI widget");
|
||||
g_object_unref (object);
|
||||
return NULL;
|
||||
}
|
||||
g_object_ref_sink (priv->widget);
|
||||
|
||||
if (!init_plugin_ui (STRONGSWAN_PLUGIN_UI_WIDGET (object), connection, error)) {
|
||||
g_object_unref (object);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return object;
|
||||
}
|
||||
|
||||
static void
|
||||
dispose (GObject *object)
|
||||
{
|
||||
StrongswanPluginUiWidget *plugin = STRONGSWAN_PLUGIN_UI_WIDGET (object);
|
||||
StrongswanPluginUiWidgetPrivate *priv = STRONGSWAN_PLUGIN_UI_WIDGET_GET_PRIVATE (plugin);
|
||||
|
||||
if (priv->widget)
|
||||
g_object_unref (priv->widget);
|
||||
|
||||
if (priv->xml)
|
||||
g_object_unref (priv->xml);
|
||||
|
||||
G_OBJECT_CLASS (strongswan_plugin_ui_widget_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
strongswan_plugin_ui_widget_class_init (StrongswanPluginUiWidgetClass *req_class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
|
||||
|
||||
g_type_class_add_private (req_class, sizeof (StrongswanPluginUiWidgetPrivate));
|
||||
|
||||
object_class->dispose = dispose;
|
||||
}
|
||||
|
||||
static void
|
||||
strongswan_plugin_ui_widget_init (StrongswanPluginUiWidget *plugin)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
strongswan_plugin_ui_widget_interface_init (NMVpnPluginUiWidgetInterface *iface_class)
|
||||
{
|
||||
/* interface implementation */
|
||||
iface_class->get_widget = get_widget;
|
||||
iface_class->update_connection = update_connection;
|
||||
iface_class->save_secrets = save_secrets;
|
||||
}
|
||||
|
||||
static guint32
|
||||
get_capabilities (NMVpnPluginUiInterface *iface)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static NMVpnPluginUiWidgetInterface *
|
||||
ui_factory (NMVpnPluginUiInterface *iface, NMConnection *connection, GError **error)
|
||||
{
|
||||
return nm_vpn_plugin_ui_widget_interface_new (connection, error);
|
||||
}
|
||||
|
||||
static void
|
||||
get_property (GObject *object, guint prop_id,
|
||||
GValue *value, GParamSpec *pspec)
|
||||
{
|
||||
switch (prop_id) {
|
||||
case NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME:
|
||||
g_value_set_string (value, STRONGSWAN_PLUGIN_NAME);
|
||||
break;
|
||||
case NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC:
|
||||
g_value_set_string (value, STRONGSWAN_PLUGIN_DESC);
|
||||
break;
|
||||
case NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE:
|
||||
g_value_set_string (value, STRONGSWAN_PLUGIN_SERVICE);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
strongswan_plugin_ui_class_init (StrongswanPluginUiClass *req_class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (req_class);
|
||||
|
||||
object_class->get_property = get_property;
|
||||
|
||||
g_object_class_override_property (object_class,
|
||||
NM_VPN_PLUGIN_UI_INTERFACE_PROP_NAME,
|
||||
NM_VPN_PLUGIN_UI_INTERFACE_NAME);
|
||||
|
||||
g_object_class_override_property (object_class,
|
||||
NM_VPN_PLUGIN_UI_INTERFACE_PROP_DESC,
|
||||
NM_VPN_PLUGIN_UI_INTERFACE_DESC);
|
||||
|
||||
g_object_class_override_property (object_class,
|
||||
NM_VPN_PLUGIN_UI_INTERFACE_PROP_SERVICE,
|
||||
NM_VPN_PLUGIN_UI_INTERFACE_SERVICE);
|
||||
}
|
||||
|
||||
static void
|
||||
strongswan_plugin_ui_init (StrongswanPluginUi *plugin)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
strongswan_plugin_ui_interface_init (NMVpnPluginUiInterface *iface_class)
|
||||
{
|
||||
/* interface implementation */
|
||||
iface_class->ui_factory = ui_factory;
|
||||
iface_class->get_capabilities = get_capabilities;
|
||||
/* TODO: implement delete_connection to purge associated secrets */
|
||||
}
|
||||
|
||||
|
||||
G_MODULE_EXPORT NMVpnPluginUiInterface *
|
||||
nm_vpn_plugin_ui_factory (GError **error)
|
||||
{
|
||||
if (error)
|
||||
g_return_val_if_fail (*error == NULL, NULL);
|
||||
|
||||
return NM_VPN_PLUGIN_UI_INTERFACE (g_object_new (STRONGSWAN_TYPE_PLUGIN_UI, NULL));
|
||||
}
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Copyright (C) 2008 Martin Willi
|
||||
* Hochschule fuer Technik Rapperswil
|
||||
* Copyright (C) 2008 Dan Williams
|
||||
*
|
||||
* Based on NetworkManager's vpnc plugin
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*/
|
||||
|
||||
#ifndef _NM_STRONGSWAN_H_
|
||||
#define _NM_STRONGSWAN_H_
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
typedef enum
|
||||
{
|
||||
STRONGSWAN_PLUGIN_UI_ERROR_UNKNOWN = 0,
|
||||
STRONGSWAN_PLUGIN_UI_ERROR_INVALID_PROPERTY,
|
||||
STRONGSWAN_PLUGIN_UI_ERROR_MISSING_PROPERTY
|
||||
} StrongswanPluginUiError;
|
||||
|
||||
#define STRONGSWAN_TYPE_PLUGIN_UI_ERROR (strongswan_plugin_ui_error_get_type ())
|
||||
GType strongswan_plugin_ui_error_get_type (void);
|
||||
|
||||
#define STRONGSWAN_TYPE_PLUGIN_UI (strongswan_plugin_ui_get_type ())
|
||||
#define STRONGSWAN_PLUGIN_UI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STRONGSWAN_TYPE_PLUGIN_UI, StrongswanPluginUi))
|
||||
#define STRONGSWAN_PLUGIN_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STRONGSWAN_TYPE_PLUGIN_UI, StrongswanPluginUiClass))
|
||||
#define STRONGSWAN_IS_PLUGIN_UI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STRONGSWAN_TYPE_PLUGIN_UI))
|
||||
#define STRONGSWAN_IS_PLUGIN_UI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), STRONGSWAN_TYPE_PLUGIN_UI))
|
||||
#define STRONGSWAN_PLUGIN_UI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STRONGSWAN_TYPE_PLUGIN_UI, StrongswanPluginUiClass))
|
||||
|
||||
typedef struct _StrongswanPluginUi StrongswanPluginUi;
|
||||
typedef struct _StrongswanPluginUiClass StrongswanPluginUiClass;
|
||||
|
||||
struct _StrongswanPluginUi {
|
||||
GObject parent;
|
||||
};
|
||||
|
||||
struct _StrongswanPluginUiClass {
|
||||
GObjectClass parent;
|
||||
};
|
||||
|
||||
GType strongswan_plugin_ui_get_type (void);
|
||||
|
||||
|
||||
#define STRONGSWAN_TYPE_PLUGIN_UI_WIDGET (strongswan_plugin_ui_widget_get_type ())
|
||||
#define STRONGSWAN_PLUGIN_UI_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), STRONGSWAN_TYPE_PLUGIN_UI_WIDGET, StrongswanPluginUiWidget))
|
||||
#define STRONGSWAN_PLUGIN_UI_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), STRONGSWAN_TYPE_PLUGIN_UI_WIDGET, StrongswanPluginUiWidgetClass))
|
||||
#define STRONGSWAN_IS_PLUGIN_UI_WIDGET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), STRONGSWAN_TYPE_PLUGIN_UI_WIDGET))
|
||||
#define STRONGSWAN_IS_PLUGIN_UI_WIDGET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), STRONGSWAN_TYPE_PLUGIN_UI_WIDGET))
|
||||
#define STRONGSWAN_PLUGIN_UI_WIDGET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), STRONGSWAN_TYPE_PLUGIN_UI_WIDGET, StrongswanPluginUiWidgetClass))
|
||||
|
||||
typedef struct _StrongswanPluginUiWidget StrongswanPluginUiWidget;
|
||||
typedef struct _StrongswanPluginUiWidgetClass StrongswanPluginUiWidgetClass;
|
||||
|
||||
struct _StrongswanPluginUiWidget {
|
||||
GObject parent;
|
||||
};
|
||||
|
||||
struct _StrongswanPluginUiWidgetClass {
|
||||
GObjectClass parent;
|
||||
};
|
||||
|
||||
GType strongswan_plugin_ui_widget_get_type (void);
|
||||
|
||||
#endif /* _NM_STRONGSWAN_H_ */
|
||||
|
||||
Reference in New Issue
Block a user