Hello community,

here is the log from the commit of package plasma-nm for openSUSE:Factory 
checked in at 2014-12-06 13:45:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/plasma-nm (Old)
 and      /work/SRC/openSUSE:Factory/.plasma-nm.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "plasma-nm"

Changes:
--------
--- /work/SRC/openSUSE:Factory/plasma-nm/plasma-nm.changes      2014-08-11 
10:09:46.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.plasma-nm.new/plasma-nm.changes 2014-12-06 
13:45:31.000000000 +0100
@@ -1,0 +2,11 @@
+Fri Dec  5 20:54:55 UTC 2014 - tittiatc...@gmail.com
+
+- Added openconnect-7-support.patch to support newer openconnect
+  versions
+
+-------------------------------------------------------------------
+Tue Oct  7 19:40:05 UTC 2014 - hrvoje.sen...@gmail.com
+
+- Added 0001-Add-IPv6-tab-for-OpenVPN-connections.patch (kde#339652)
+
+-------------------------------------------------------------------

New:
----
  0001-Add-IPv6-tab-for-OpenVPN-connections.patch
  openconnect-7-support.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ plasma-nm.spec ++++++
--- /var/tmp/diff_new_pack.NzbVWk/_old  2014-12-06 13:45:33.000000000 +0100
+++ /var/tmp/diff_new_pack.NzbVWk/_new  2014-12-06 13:45:33.000000000 +0100
@@ -26,6 +26,10 @@
 Source:         
http://download.kde.org/stable/%{name}/%{name}-%{version}.tar.xz
 Source1:        icon.tar.bz2
 Source2:        01-plasma-nm.js
+# PATCH-FIX-UPSTREAM 0001-Add-IPv6-tab-for-OpenVPN-connections.patch
+Patch0:         0001-Add-IPv6-tab-for-OpenVPN-connections.patch
+# PATCH-FIX-UPSTREAM openconnect-7-support.patch
+Patch1:         openconnect-7-support.patch
 BuildRequires:  NetworkManager-devel >= 0.9.8.0
 BuildRequires:  fdupes
 BuildRequires:  libModemManagerQt-devel >= 0.7.990
@@ -156,6 +160,8 @@
 
 %prep
 %setup -qn %{name}-%{version} -a 1
+%patch0 -p1
+%patch1 -p1
 
 %build
   %cmake_kde4 -d build

++++++ 0001-Add-IPv6-tab-for-OpenVPN-connections.patch ++++++
>From 26c1f5fa03491298fcee2a21e53522c2f3a01ea3 Mon Sep 17 00:00:00 2001
From: Jan Grulich <jgrul...@redhat.com>
Date: Mon, 6 Oct 2014 09:29:14 +0200
Subject: [PATCH 1/4] Add IPv6 tab for OpenVPN connections

BUG:339652
---
 libs/editor/connectiondetaileditor.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libs/editor/connectiondetaileditor.cpp 
b/libs/editor/connectiondetaileditor.cpp
index 066fccc..f626ec3 100644
--- a/libs/editor/connectiondetaileditor.cpp
+++ b/libs/editor/connectiondetaileditor.cpp
@@ -40,6 +40,7 @@
 #include "settings/vlanwidget.h"
 #include "settings/wimaxwidget.h"
 #include "vpnuiplugin.h"
+#include "vpn/openvpn/nm-openvpn-service.h"
 
 #include <QDebug>
 
@@ -269,6 +270,7 @@ void ConnectionDetailEditor::initTabs()
     const NetworkManager::ConnectionSettings::ConnectionType type = 
m_connection->connectionType();
 
     // setup the widget tabs
+    QString serviceType;
     if (type == NetworkManager::ConnectionSettings::Wired) {
         WiredConnectionWidget * wiredWidget = new 
WiredConnectionWidget(m_connection->setting(NetworkManager::Setting::Wired), 
this);
         m_ui->tabWidget->addTab(wiredWidget, i18n("Wired"));
@@ -325,7 +327,6 @@ void ConnectionDetailEditor::initTabs()
         if (!vpnSetting) {
             qDebug() << "Missing VPN setting!";
         } else {
-            QString serviceType;
             if (m_new && !m_vpnType.isEmpty()) {
                 serviceType = m_vpnType;
                 vpnSetting->setServiceType(serviceType);
@@ -366,7 +367,8 @@ void ConnectionDetailEditor::initTabs()
          || type == ConnectionSettings::Wimax
          || type == ConnectionSettings::Bond
          || type == ConnectionSettings::Bridge
-         || type == ConnectionSettings::Vlan) && !isSlave()) {
+         || type == ConnectionSettings::Vlan
+         || (type == ConnectionSettings::Vpn && serviceType == 
QLatin1String(NM_DBUS_SERVICE_OPENVPN))) && !isSlave()) {
         IPv6Widget * ipv6Widget = new 
IPv6Widget(m_connection->setting(NetworkManager::Setting::Ipv6), this);
         m_ui->tabWidget->addTab(ipv6Widget, i18n("IPv6"));
     }
-- 
2.1.1

++++++ openconnect-7-support.patch ++++++
commit 3e6585fa4dd2fb3d9b59c7704bd3d7ae5b2c4167
Author: David Woodhouse <david.woodho...@intel.com>
Date:   Wed Dec 3 15:10:44 2014 +0100

    Update OpenConnect support for library version 5
    
    String ownership rules are now very simple: the library never takes 
ownership
    of a string it's passed. It always takes its *own* copy and is responsible
    for freeing that. Mostly driven by Windows DLL Hell where it's painful to
    allocate in one library and free in another because they might actually be
    using different heaps.
    
    Also adapt to the changes in server certificate hash handling. We are no
    longer supposed to just compare strings, and must call the relevant function
    to check a hash against the server's certificate. This gives better matching
    and allows libopenconnect to upgrade the hash in future when it becomes
    necessary.

diff --git a/vpn/openconnect/CMakeLists.txt b/vpn/openconnect/CMakeLists.txt
index d59d13d..23096ee 100644
--- a/vpn/openconnect/CMakeLists.txt
+++ b/vpn/openconnect/CMakeLists.txt
@@ -16,6 +16,8 @@ if (OPENCONNECT_FOUND)
     if (${OPENCONNECT_VERSION} VERSION_GREATER 
${MINIMUM_OPENCONNECT_VERSION_REQUIRED} OR
         ${OPENCONNECT_VERSION} VERSION_EQUAL 
${MINIMUM_OPENCONNECT_VERSION_REQUIRED})
 
+        include_directories(${OPENCONNECT_INCLUDE_DIRS})
+
         set(openconnect_SRCS
         openconnectui.cpp
         openconnectwidget.cpp
diff --git a/vpn/openconnect/openconnectauth.cpp 
b/vpn/openconnect/openconnectauth.cpp
index 40cb82d..ead9511 100644
--- a/vpn/openconnect/openconnectauth.cpp
+++ b/vpn/openconnect/openconnectauth.cpp
@@ -161,7 +161,7 @@ void OpenconnectAuthWidget::readConfig()
     }
     if (!dataMap[NM_OPENCONNECT_KEY_CACERT].isEmpty()) {
         const QByteArray crt = 
QFile::encodeName(dataMap[NM_OPENCONNECT_KEY_CACERT]);
-        openconnect_set_cafile(d->vpninfo, strdup(crt.data()));
+        openconnect_set_cafile(d->vpninfo, OC3DUP(crt.data()));
     }
     if (dataMap[NM_OPENCONNECT_KEY_CSD_ENABLE] == "yes") {
         char *wrapper;
@@ -174,12 +174,12 @@ void OpenconnectAuthWidget::readConfig()
     }
     if (!dataMap[NM_OPENCONNECT_KEY_PROXY].isEmpty()) {
         const QByteArray proxy = 
QFile::encodeName(dataMap[NM_OPENCONNECT_KEY_PROXY]);
-        openconnect_set_http_proxy(d->vpninfo, strdup(proxy.data()));
+        openconnect_set_http_proxy(d->vpninfo, OC3DUP(proxy.data()));
     }
     if (!dataMap[NM_OPENCONNECT_KEY_USERCERT].isEmpty()) {
         const QByteArray crt = 
QFile::encodeName(dataMap[NM_OPENCONNECT_KEY_USERCERT]);
         const QByteArray key = 
QFile::encodeName(dataMap[NM_OPENCONNECT_KEY_PRIVKEY]);
-        openconnect_set_client_cert (d->vpninfo, strdup(crt.data()), 
strdup(key.data()));
+        openconnect_set_client_cert (d->vpninfo, OC3DUP(crt.data()), 
OC3DUP(key.data()));
 
         if (!crt.isEmpty() && dataMap[NM_OPENCONNECT_KEY_PEM_PASSPHRASE_FSID] 
== "yes") {
             openconnect_passphrase_from_fsid(d->vpninfo);
@@ -276,10 +276,10 @@ void OpenconnectAuthWidget::connectHost()
     const VPNHost &host = d->hosts.at(i);
     if (openconnect_parse_url(d->vpninfo, host.address.toAscii().data())) {
         kWarning() << "Failed to parse server URL" << host.address;
-        openconnect_set_hostname(d->vpninfo, 
strdup(host.address.toAscii().data()));
+        openconnect_set_hostname(d->vpninfo, 
OC3DUP(host.address.toAscii().data()));
     }
     if (!openconnect_get_urlpath(d->vpninfo) && !host.group.isEmpty())
-        openconnect_set_urlpath(d->vpninfo, 
strdup(host.group.toAscii().data()));
+        openconnect_set_urlpath(d->vpninfo, 
OC3DUP(host.group.toAscii().data()));
     d->secrets["lasthost"] = host.name;
     addFormInfo(QLatin1String("dialog-information"), i18n("Contacting host, 
please wait..."));
     d->worker->start();
@@ -301,9 +301,13 @@ QVariantMap OpenconnectAuthWidget::setting(bool 
agentOwned) const
     secrets.insert(QLatin1String(NM_OPENCONNECT_KEY_COOKIE), 
QLatin1String(openconnect_get_cookie(d->vpninfo)));
     openconnect_clear_cookie(d->vpninfo);
 
+#if OPENCONNECT_CHECK_VER(5,0)
+    const char *fingerprint = openconnect_get_peer_cert_hash(d->vpninfo);
+#else
     OPENCONNECT_X509 *cert = openconnect_get_peer_cert(d->vpninfo);
     char fingerprint[41];
     openconnect_get_cert_sha1(d->vpninfo, cert, fingerprint);
+#endif
     secrets.insert(QLatin1String(NM_OPENCONNECT_KEY_GWCERT), 
QLatin1String(fingerprint));
     secrets.insert(QLatin1String("certsigs"), 
d->certificateFingerprints.join("\t"));
     secrets.insert(QLatin1String("autoconnect"), 
d->ui.chkAutoconnect->isChecked() ? "yes" : "no");
@@ -578,14 +582,14 @@ void OpenconnectAuthWidget::formLoginClicked()
             if (opt->type == OC_FORM_OPT_PASSWORD || opt->type == 
OC_FORM_OPT_TEXT) {
                 KLineEdit *le = qobject_cast<KLineEdit*>(widget);
                 QByteArray text = le->text().toUtf8();
-                opt->value = strdup(text.data());
+                openconnect_set_option_value(opt, text.data());
                 if (opt->type == OC_FORM_OPT_TEXT) {
                     d->secrets.insert(key,le->text());
                 }
             } else if (opt->type == OC_FORM_OPT_SELECT) {
                 KComboBox *cbo = qobject_cast<KComboBox*>(widget);
                 QByteArray text = 
cbo->itemData(cbo->currentIndex()).toString().toAscii();
-                opt->value = strdup(text.data());
+                openconnect_set_option_value(opt, text.data());
                 
d->secrets.insert(key,cbo->itemData(cbo->currentIndex()).toString());
             }
         }
diff --git a/vpn/openconnect/openconnectauthworkerthread.cpp 
b/vpn/openconnect/openconnectauthworkerthread.cpp
index cf130da..63ff237 100644
--- a/vpn/openconnect/openconnectauthworkerthread.cpp
+++ b/vpn/openconnect/openconnectauthworkerthread.cpp
@@ -43,6 +43,20 @@ extern "C"
 class OpenconnectAuthStaticWrapper
 {
 public:
+#if OPENCONNECT_CHECK_VER(5,0)
+    static int writeNewConfig(void *obj, const char *str, int num)
+    {
+        if (obj)
+            return 
static_cast<OpenconnectAuthWorkerThread*>(obj)->writeNewConfig(str, num);
+        return -1;
+    }
+    static int validatePeerCert(void *obj, const char *str)
+    {
+        if (obj)
+            return 
static_cast<OpenconnectAuthWorkerThread*>(obj)->validatePeerCert(NULL, str);
+        return -1;
+    }
+#else
     static int writeNewConfig(void *obj, char *str, int num)
     {
         if (obj)
@@ -55,7 +69,8 @@ public:
             return 
static_cast<OpenconnectAuthWorkerThread*>(obj)->validatePeerCert(cert, str);
         return -1;
     }
-    static int processAuthForm(void *obj, struct oc_auth_form *form)
+#endif
+       static int processAuthForm(void *obj, struct oc_auth_form *form)
     {
         if (obj)
             return 
static_cast<OpenconnectAuthWorkerThread*>(obj)->processAuthFormP(form);
@@ -108,7 +123,7 @@ struct openconnect_info* 
OpenconnectAuthWorkerThread::getOpenconnectInfo()
     return m_openconnectInfo;
 }
 
-int OpenconnectAuthWorkerThread::writeNewConfig(char *buf, int buflen)
+int OpenconnectAuthWorkerThread::writeNewConfig(const char *buf, int buflen)
 {
     Q_UNUSED(buflen)
     if (*m_userDecidedToQuit)
@@ -139,10 +154,16 @@ static char *openconnect_get_cert_details(struct 
openconnect_info *vpninfo,
 }
 #endif
 
-int OpenconnectAuthWorkerThread::validatePeerCert(OPENCONNECT_X509 *cert, 
const char *reason)
+int OpenconnectAuthWorkerThread::validatePeerCert(void *cert, const char 
*reason)
 {
     if (*m_userDecidedToQuit)
         return -EINVAL;
+
+#if OPENCONNECT_CHECK_VER(5,0)
+    (void)cert;
+    const char *fingerprint = 
openconnect_get_peer_cert_hash(m_openconnectInfo);
+    char *details = openconnect_get_peer_cert_details(m_openconnectInfo);
+#else
     char fingerprint[41];
     int ret = 0;
 
@@ -151,7 +172,7 @@ int 
OpenconnectAuthWorkerThread::validatePeerCert(OPENCONNECT_X509 *cert, const
         return ret;
 
     char *details = openconnect_get_cert_details(m_openconnectInfo, cert);
-
+#endif
     bool accepted = false;
     m_mutex->lock();
     QString qFingerprint(fingerprint);
@@ -160,7 +181,7 @@ int 
OpenconnectAuthWorkerThread::validatePeerCert(OPENCONNECT_X509 *cert, const
     emit validatePeerCert(qFingerprint, qCertinfo, qReason, &accepted);
     m_waitForUserInput->wait(m_mutex);
     m_mutex->unlock();
-    ::free(details);
+    openconnect_free_cert_info(m_openconnectInfo, details);
     if (*m_userDecidedToQuit)
         return -EINVAL;
 
diff --git a/vpn/openconnect/openconnectauthworkerthread.h 
b/vpn/openconnect/openconnectauthworkerthread.h
index 282d8ce..cfe3681 100644
--- a/vpn/openconnect/openconnectauthworkerthread.h
+++ b/vpn/openconnect/openconnectauthworkerthread.h
@@ -59,6 +59,17 @@ struct x509_st;
 #define OC_FORM_RESULT_NEWGROUP        2
 #endif
 
+#if OPENCONNECT_CHECK_VER(4,0)
+#define OC3DUP(x)                      (x)
+#else
+#define openconnect_set_option_value(opt, val) do { \
+               struct oc_form_opt *_o = (opt);                         \
+               free(_o->value); _o->value = strdup(val);               \
+       } while (0)
+#define openconnect_free_cert_info(v, x) ::free(x)
+#define OC3DUP(x)                      strdup(x)
+#endif
+
 #include <QThread>
 
 class QMutex;
@@ -85,8 +96,8 @@ protected:
     void run();
 
 private:
-    int writeNewConfig(char *, int);
-    int validatePeerCert(OPENCONNECT_X509 *, const char *);
+    int writeNewConfig(const char *, int);
+    int validatePeerCert(void *, const char *);
     int processAuthFormP(struct oc_auth_form *);
     void writeProgress(int level, const char *, va_list);
 
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to