[SCM] ktp-common-internals packaging branch, master, updated. debian/15.12.1-2-1839-gf0635e9

Maximiliano Curia maxy at moszumanska.debian.org
Mon May 9 09:08:23 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-common-internals.git;a=commitdiff;h=94153a7

The following commit has been merged in the master branch:
commit 94153a73c67507ac8e2591ad6d2f77881215a155
Author: Marcin Ziemiński <zieminn at gmail.com>
Date:   Sun Aug 10 16:20:36 2014 +0200

    Changed spec and fixed issues with user authentication.
    
    Signed-off-by: Marcin Ziemiński <zieminn at gmail.com>
---
 otr-proxy/KTpProxy/otr-manager.cpp               | 11 +++++------
 otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp | 11 ++++++-----
 otr-proxy/KTpProxy/otr-proxy-channel-adaptee.h   |  1 +
 otr-proxy/KTpProxy/otr-session.cpp               | 21 +++++++++++----------
 otr-proxy/KTpProxy/otr-session.h                 |  6 ++++--
 otr-proxy/KTpProxy/svc-channel-proxy.cpp         |  1 +
 otr-proxy/KTpProxy/svc-channel-proxy.h           | 12 ++++++++++++
 otr-proxy/spec/ChannelProxy_Interface_OTR.xml    |  7 +++++++
 otr-proxy/test/otr-test.cpp                      |  4 ++--
 9 files changed, 49 insertions(+), 25 deletions(-)

diff --git a/otr-proxy/KTpProxy/otr-manager.cpp b/otr-proxy/KTpProxy/otr-manager.cpp
index 2aaa8ae..ab6d40a 100644
--- a/otr-proxy/KTpProxy/otr-manager.cpp
+++ b/otr-proxy/KTpProxy/otr-manager.cpp
@@ -100,17 +100,13 @@ namespace {
     void gone_secure(void *opdata, ConnContext *context)
     {
         Session *session = reinterpret_cast<Session*>(opdata);
-        session->onTrustLevelChanged(
-                OTR::utils::getTrustLevel(session->context(), session->userStateBox()->userState(), context->their_instance),
-                context);
+        session->onTrustLevelChanged(context);
     }
 
     void gone_insecure(void *opdata, ConnContext *context)
     {
         Session *session = reinterpret_cast<Session*>(opdata);
-        session->onTrustLevelChanged(
-                OTR::utils::getTrustLevel(session->context(), session->userStateBox()->userState(), context->their_instance),
-                context);
+        session->onTrustLevelChanged(context);
     }
 
     void still_secure(void *opdata, ConnContext *context, int is_reply)
@@ -222,12 +218,15 @@ namespace {
                 session->onSMPQuery(QLatin1String(question));
                 break;
             case OTRL_SMPEVENT_IN_PROGRESS:
+                session->onSMPInProgress();
                 break;
             case OTRL_SMPEVENT_SUCCESS:
                 session->onSMPFinished(true);
+                session->onTrustLevelChanged();
                 break;
             case OTRL_SMPEVENT_FAILURE:
                 session->onSMPFinished(false);
+                session->onTrustLevelChanged();
                 break;
             case OTRL_SMPEVENT_ABORT:
                 session->abortSMPAuthentiaction(context);
diff --git a/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp b/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp
index 604fbd3..5577dd6 100644
--- a/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp
+++ b/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.cpp
@@ -110,11 +110,12 @@ OtrProxyChannel::Adaptee::Adaptee(OtrProxyChannel *pc,
     connect(chan.data(), SIGNAL(invalidated(Tp::DBusProxy*,const QString&,const QString&)), SLOT(onChannelClosed()));
     connect(&otrSes, SIGNAL(trustLevelChanged(TrustLevel)), SLOT(onTrustLevelChanged(TrustLevel)));
     connect(&otrSes, SIGNAL(sessionRefreshed()), SIGNAL(sessionRefreshed()));
-    connect(&otrSes, SIGNAL(peerAuthenticationRequested(const QString&)), SIGNAL(peerAuthenticationRequested(const QString&)));
-    connect(&otrSes, SIGNAL(peerAuthenticationConcluded(bool)), SIGNAL(peerAuthenticationConcluded(bool)));
-    connect(&otrSes, SIGNAL(peerAuthenticationAborted()), SIGNAL(peerAuthenticationAborted()));
-    connect(&otrSes, SIGNAL(peerAuthenticationError()), SIGNAL(peerAuthenticationError()));
-    connect(&otrSes, SIGNAL(peerAuthenticationCheated()), SIGNAL(peerAuthenticationCheated()));
+    connect(&otrSes, SIGNAL(authenticationRequested(const QString&)), SIGNAL(peerAuthenticationRequested(const QString&)));
+    connect(&otrSes, SIGNAL(authenticationInProgress()), SIGNAL(peerAuthenticationInProgress()));
+    connect(&otrSes, SIGNAL(authenticationConcluded(bool)), SIGNAL(peerAuthenticationConcluded(bool)));
+    connect(&otrSes, SIGNAL(authenticationAborted()), SIGNAL(peerAuthenticationAborted()));
+    connect(&otrSes, SIGNAL(authenticationError()), SIGNAL(peerAuthenticationError()));
+    connect(&otrSes, SIGNAL(authenticationCheated()), SIGNAL(peerAuthenticationCheated()));
 
     sender = channel->connection()->selfHandle();
 }
diff --git a/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.h b/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.h
index 9777eb1..91ab5b1 100644
--- a/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.h
+++ b/otr-proxy/KTpProxy/otr-proxy-channel-adaptee.h
@@ -102,6 +102,7 @@ class OtrProxyChannel::Adaptee : public QObject
         void closed();
         void trustLevelChanged(uint trustLevel);
         void peerAuthenticationRequested(const QString&);
+        void peerAuthenticationInProgress();
         void peerAuthenticationConcluded(bool);
         void peerAuthenticationAborted();
         void peerAuthenticationError();
diff --git a/otr-proxy/KTpProxy/otr-session.cpp b/otr-proxy/KTpProxy/otr-session.cpp
index 8e3ac7d..e0bbe96 100644
--- a/otr-proxy/KTpProxy/otr-session.cpp
+++ b/otr-proxy/KTpProxy/otr-session.cpp
@@ -165,7 +165,7 @@ namespace OTR
                 ctx.recipientName.toLocal8Bit(),
                 instance);
 
-        onTrustLevelChanged(TrustLevel::NOT_PRIVATE, nullptr);
+        onTrustLevelChanged(nullptr);
     }
 
     CryptResult Session::encrypt(Message &message)
@@ -256,7 +256,7 @@ namespace OTR
         }
 
         if(isFinished) {
-            onTrustLevelChanged(TrustLevel::FINISHED, nullptr);
+            onTrustLevelChanged(nullptr);
         }
 
         return result;
@@ -308,11 +308,7 @@ namespace OTR
 
             TrustFpResult res = pr->trustFingerprint(ctx, fp, trust);
             if(res == TrustFpResult::OK && trustLevel() != TrustLevel::FINISHED) {
-                if(trust) {
-                    onTrustLevelChanged(TrustLevel::VERIFIED, nullptr);
-                } else {
-                    onTrustLevelChanged(TrustLevel::UNVERIFIED, nullptr);
-                }
+                    onTrustLevelChanged(nullptr);
             }
             return res;
         } else {
@@ -321,12 +317,12 @@ namespace OTR
         }
     }
 
-    void Session::onTrustLevelChanged(TrustLevel trustLevel, const ConnContext *context)
+    void Session::onTrustLevelChanged(const ConnContext *context)
     {
         if(context != nullptr) {
             instance = context->their_instance;
         }
-        Q_EMIT trustLevelChanged(trustLevel);
+        Q_EMIT trustLevelChanged(trustLevel());
     }
 
     void Session::onSessionRefreshed()
@@ -341,7 +337,12 @@ namespace OTR
 
     void Session::onSMPFinished(bool success)
     {
-        Q_EMIT authenticationFinished(success);
+        Q_EMIT authenticationConcluded(success);
+    }
+
+    void Session::onSMPInProgress()
+    {
+        Q_EMIT authenticationInProgress();
     }
 
     void Session::onSMPError()
diff --git a/otr-proxy/KTpProxy/otr-session.h b/otr-proxy/KTpProxy/otr-session.h
index eb1a5b7..1e99954 100644
--- a/otr-proxy/KTpProxy/otr-session.h
+++ b/otr-proxy/KTpProxy/otr-session.h
@@ -92,11 +92,12 @@ namespace OTR
             virtual int recipientStatus() const = 0;
             virtual unsigned int maxMessageSize() const = 0;
 
-            void onTrustLevelChanged(TrustLevel trustLevel, const ConnContext *context);
+            void onTrustLevelChanged(const ConnContext *context = nullptr);
             void onSessionRefreshed();
             void onNewFingerprintReceived(const QString &fingeprint);
 
             void onSMPFinished(bool success);
+            void onSMPInProgress();
             void onSMPError();
             void onSMPAborted();
             void onSMPCheated();
@@ -111,12 +112,13 @@ namespace OTR
             void sessionRefreshed();
             void newFingerprintReceived(const QString &fingeprint);
 
-            void authenticationFinished(bool success);
+            void authenticationConcluded(bool success);
             void authenticationError();
             void authenticationAborted();
             void authenticationCheated();
             /** empty string if secret */
             void authenticationRequested(const QString &question);
+            void authenticationInProgress();
 
         private:
             otrl_instag_t instance;
diff --git a/otr-proxy/KTpProxy/svc-channel-proxy.cpp b/otr-proxy/KTpProxy/svc-channel-proxy.cpp
index a424648..db5d474 100644
--- a/otr-proxy/KTpProxy/svc-channel-proxy.cpp
+++ b/otr-proxy/KTpProxy/svc-channel-proxy.cpp
@@ -16,6 +16,7 @@ ChannelProxyInterfaceOTRAdaptor::ChannelProxyInterfaceOTRAdaptor(const QDBusConn
     connect(adaptee, SIGNAL(pendingMessagesRemoved(const Tp::UIntList&)), SIGNAL(PendingMessagesRemoved(const Tp::UIntList&)));
     connect(adaptee, SIGNAL(peerAuthenticationRequested(const QString&)), SIGNAL(PeerAuthenticationRequested(const QString&)));
     connect(adaptee, SIGNAL(peerAuthenticationConcluded(bool)), SIGNAL(PeerAuthenticationConcluded(bool)));
+    connect(adaptee, SIGNAL(peerAuthenticationInProgress()), SIGNAL(PeerAuthenticationInProgress()));
     connect(adaptee, SIGNAL(peerAuthenticationAborted()), SIGNAL(PeerAuthenticationAborted()));
     connect(adaptee, SIGNAL(peerAuthenticationError()), SIGNAL(PeerAuthenticationError()));
     connect(adaptee, SIGNAL(peerAuthenticationCheated()), SIGNAL(PeerAuthenticationCheated()));
diff --git a/otr-proxy/KTpProxy/svc-channel-proxy.h b/otr-proxy/KTpProxy/svc-channel-proxy.h
index 31f8a21..49dd19d 100644
--- a/otr-proxy/KTpProxy/svc-channel-proxy.h
+++ b/otr-proxy/KTpProxy/svc-channel-proxy.h
@@ -88,6 +88,7 @@ class TP_QT_EXPORT ChannelProxyInterfaceOTRAdaptor : public Tp::AbstractAdaptor
 "    <signal name=\"PeerAuthenticationConcluded\">
"
 "      <arg type=\"b\" name=\"authenticated\"/>
"
 "    </signal>
"
+"    <signal name=\"PeerAuthenticationInProgress\"/>
"
 "    <signal name=\"PeerAuthenticationAborted\"/>
"
 "    <signal name=\"PeerAuthenticationError\"/>
"
 "    <signal name=\"PeerAuthenticationCheated\"/>
"
@@ -461,6 +462,16 @@ Q_SIGNALS: // SIGNALS
      */
     void PeerAuthenticationConcluded(bool authenticated);
     /**
+     * Represents the exported D-Bus signal 
-- 
ktp-common-internals packaging



More information about the pkg-kde-commits mailing list