[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [ktp-auth-handler/kde-telepathy-0.6] /: Correctly search to see if we support the certificate type
From:       David Edmundson <kde () davidedmundson ! co ! uk>
Date:       2013-07-19 12:39:40
Message-ID: E1V09yG-0005bu-RU () scm ! kde ! org
[Download RAW message or body]

Git commit 048ae61e33d4026b24d6da474dba37f4c5868c8b by David Edmundson.
Committed on 15/07/2013 at 13:05.
Pushed by davidedmundson into branch 'kde-telepathy-0.6'.

Correctly search to see if we support the certificate type

BUG: 318729
FIXED-IN: 0.6.3
REVIEWED-BY: Daniele Domenichelli

M  +5    -2    tls-cert-verifier-op.cpp

http://commits.kde.org/telepathy-auth-handler/048ae61e33d4026b24d6da474dba37f4c5868c8b

diff --git a/tls-cert-verifier-op.cpp b/tls-cert-verifier-op.cpp
index a27d70e..ecf6917 100644
--- a/tls-cert-verifier-op.cpp
+++ b/tls-cert-verifier-op.cpp
@@ -78,12 +78,15 @@ void TlsCertVerifierOp::gotProperties(Tp::PendingOperation *op)
     m_certType = qdbus_cast<QString>(props.value(QLatin1String("CertificateType")));
     m_certData = qdbus_cast<CertificateDataList>(props.value(QLatin1String("CertificateChainData")));
 
-    if(m_certType.compare(QLatin1String("\"x509\""), Qt::CaseInsensitive)) {
+    //compare returns 0 on match. We run this if cert type does not match x509 or "x509"
+    //we also seem to need to check for "x509" and x509.
+    if (m_certType.compare(QLatin1String("\"x509\""), Qt::CaseInsensitive) != 0 &&
+        m_certType.compare(QLatin1String("x509"), Qt::CaseInsensitive) != 0) {
         Tp::TLSCertificateRejectionList rejections;
         m_authTLSCertificateIface->Reject(rejections);
         m_channel->requestClose();
         setFinishedWithError(QLatin1String("Cert.Unknown"),
-                             QLatin1String("Invalid certificate type"));
+                             QString::fromLatin1("Invalid certificate type %1").arg(m_certType));
         return;
     }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic