From 68b5e38626333b0c1c0396ef8b4b9221e425465a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sat, 24 Nov 2012 16:19:37 +0100 Subject: Rename QCA to TQCA Fix FTBFS --- .../protocols/jabber/libiris/iris/include/xmpp.h | 12 +- .../protocols/jabber/libiris/iris/jabber/s5b.cpp | 8 +- .../jabber/libiris/iris/xmpp-core/Makefile.am | 2 +- .../jabber/libiris/iris/xmpp-core/connector.cpp | 4 +- .../jabber/libiris/iris/xmpp-core/hash.cpp | 20 +-- .../protocols/jabber/libiris/iris/xmpp-core/hash.h | 4 +- .../jabber/libiris/iris/xmpp-core/protocol.cpp | 6 +- .../jabber/libiris/iris/xmpp-core/qcaprovider.h | 191 --------------------- .../jabber/libiris/iris/xmpp-core/securestream.cpp | 18 +- .../jabber/libiris/iris/xmpp-core/securestream.h | 6 +- .../jabber/libiris/iris/xmpp-core/simplesasl.cpp | 38 ++-- .../jabber/libiris/iris/xmpp-core/simplesasl.h | 4 +- .../jabber/libiris/iris/xmpp-core/stream.cpp | 38 ++-- .../jabber/libiris/iris/xmpp-core/tlshandler.cpp | 36 ++-- 14 files changed, 98 insertions(+), 289 deletions(-) delete mode 100644 kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h (limited to 'kopete/protocols/jabber/libiris/iris') diff --git a/kopete/protocols/jabber/libiris/iris/include/xmpp.h b/kopete/protocols/jabber/libiris/iris/include/xmpp.h index 38006b6f..20ae2564 100644 --- a/kopete/protocols/jabber/libiris/iris/include/xmpp.h +++ b/kopete/protocols/jabber/libiris/iris/include/xmpp.h @@ -29,7 +29,7 @@ #include #include -namespace QCA +namespace TQCA { class TLS; } @@ -189,15 +189,15 @@ namespace XMPP void readyReadOutgoing(const TQByteArray &a, int plainBytes); }; - class QCATLSHandler : public TLSHandler + class TQCATLSHandler : public TLSHandler { Q_OBJECT public: - QCATLSHandler(QCA::TLS *parent); - ~QCATLSHandler(); + TQCATLSHandler(TQCA::TLS *parent); + ~TQCATLSHandler(); - QCA::TLS *tls() const; + TQCA::TLS *tls() const; int tlsError() const; void reset(); @@ -457,7 +457,7 @@ namespace XMPP }; ClientStream(Connector *conn, TLSHandler *tlsHandler=0, TQObject *parent=0); - ClientStream(const TQString &host, const TQString &defRealm, ByteStream *bs, QCA::TLS *tls=0, TQObject *parent=0); // server + ClientStream(const TQString &host, const TQString &defRealm, ByteStream *bs, TQCA::TLS *tls=0, TQObject *parent=0); // server ~ClientStream(); Jid jid() const; diff --git a/kopete/protocols/jabber/libiris/iris/jabber/s5b.cpp b/kopete/protocols/jabber/libiris/iris/jabber/s5b.cpp index 3a9adf68..9544fbb1 100644 --- a/kopete/protocols/jabber/libiris/iris/jabber/s5b.cpp +++ b/kopete/protocols/jabber/libiris/iris/jabber/s5b.cpp @@ -27,7 +27,7 @@ #include #include #include"xmpp_xmlcommon.h" -#include"hash.h" +#include "../xmpp-core/hash.h" #include"socks.h" #include"safedelete.h" @@ -49,7 +49,7 @@ namespace XMPP { static TQString makeKey(const TQString &sid, const Jid &initiator, const Jid &target) { TQString str = sid + initiator.full() + target.full(); - return QCA::SHA1::hashToString(str.utf8()); + return TQCA::SHA1::hashToString(str.utf8()); } static bool haveHost(const StreamHostList &list, const Jid &j) @@ -579,8 +579,8 @@ S5BManager::S5BManager(Client *parent) :TQObject(parent) { // S5B needs SHA1 - if(!QCA::isSupported(QCA::CAP_SHA1)) - QCA::insertProvider(createProviderHash()); + if(!TQCA::isSupported(TQCA::CAP_SHA1)) + TQCA::insertProvider(createProviderHash()); d = new Private; d->client = parent; diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/Makefile.am b/kopete/protocols/jabber/libiris/iris/xmpp-core/Makefile.am index 8e89a082..19fdc5d4 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/Makefile.am +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/Makefile.am @@ -1,6 +1,6 @@ # The only Q_OBJECT lines are in securestream.{h,cpp} and we deal with them below. # Give metasources a file with no Q_OBJECT line to stop unsermake assuming we want METASOURCES = AUTO -METASOURCES = AUTO +#METASOURCES = AUTO noinst_LTLIBRARIES = libiris_xmpp_core.la AM_CPPFLAGS = $(IDN_CFLAGS) diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp index 6e73799d..20333998 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/connector.cpp @@ -321,8 +321,8 @@ void AdvancedConnector::connectToServer(const TQString &server) if(d->proxy.type() == Proxy::HttpPoll) { // need SHA1 here - if(!QCA::isSupported(QCA::CAP_SHA1)) - QCA::insertProvider(createProviderHash()); + if(!TQCA::isSupported(TQCA::CAP_SHA1)) + TQCA::insertProvider(createProviderHash()); HttpPoll *s = new HttpPoll; d->bs = s; diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp index d4509def..f531230c 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.cpp @@ -447,7 +447,7 @@ typedef union { TQ_UINT32 l[16]; } CHAR64LONG16; -class SHA1Context : public QCA_HashContext +class SHA1Context : public TQCA_HashContext { public: SHA1_CONTEXT _context; @@ -458,7 +458,7 @@ public: reset(); } - QCA_HashContext *clone() + TQCA_HashContext *clone() { return new SHA1Context(*this); } @@ -598,7 +598,7 @@ public: } }; -class MD5Context : public QCA_HashContext +class MD5Context : public TQCA_HashContext { public: MD5Context() @@ -606,7 +606,7 @@ public: reset(); } - QCA_HashContext *clone() + TQCA_HashContext *clone() { return new MD5Context(*this); } @@ -631,7 +631,7 @@ public: md5_state_t md5; }; -class HashProvider : public QCAProvider +class HashProvider : public TQCAProvider { public: HashProvider() {} @@ -644,25 +644,25 @@ public: int qcaVersion() const { - return QCA_PLUGIN_VERSION; + return TQCA_PLUGIN_VERSION; } int capabilities() const { - return (QCA::CAP_SHA1 | QCA::CAP_MD5); + return (TQCA::CAP_SHA1 | TQCA::CAP_MD5); } void *context(int cap) { - if(cap == QCA::CAP_SHA1) + if(cap == TQCA::CAP_SHA1) return new SHA1Context; - if(cap == QCA::CAP_MD5) + if(cap == TQCA::CAP_MD5) return new MD5Context; return 0; } }; -QCAProvider *createProviderHash() +TQCAProvider *createProviderHash() { return (new HashProvider); } diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.h index 616fb314..d91767ce 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.h +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/hash.h @@ -21,11 +21,11 @@ #ifndef HASH_H #define HASH_H -#include"qcaprovider.h" +#include namespace XMPP { - QCAProvider *createProviderHash(); + TQCAProvider *createProviderHash(); } #endif diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp index f96fd795..d0e7be99 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/protocol.cpp @@ -1189,12 +1189,12 @@ bool CoreProtocol::normalStep(const TQDomElement &e) TQDomElement p; if(digest) { // need SHA1 here - if(!QCA::isSupported(QCA::CAP_SHA1)) - QCA::insertProvider(createProviderHash()); + if(!TQCA::isSupported(TQCA::CAP_SHA1)) + TQCA::insertProvider(createProviderHash()); p = doc.createElement("digest"); TQCString cs = id.utf8() + password.utf8(); - p.appendChild(doc.createTextNode(QCA::SHA1::hashToString(cs))); + p.appendChild(doc.createTextNode(TQCA::SHA1::hashToString(cs))); } else { p = doc.createElement("password"); diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h deleted file mode 100644 index 9f4fa1fb..00000000 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/qcaprovider.h +++ /dev/null @@ -1,191 +0,0 @@ -/* - * qcaprovider.h - QCA Plugin API - * Copyright (C) 2003 Justin Karneges - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef QCAPROVIDER_H -#define QCAPROVIDER_H - -#include -#include -#include -#include -#include -#include"qca.h" - -#define QCA_PLUGIN_VERSION 1 - -class QCAProvider -{ -public: - QCAProvider() {} - virtual ~QCAProvider() {} - - virtual void init()=0; - virtual int qcaVersion() const=0; - virtual int capabilities() const=0; - virtual void *context(int cap)=0; -}; - -class QCA_HashContext -{ -public: - virtual ~QCA_HashContext() {} - - virtual QCA_HashContext *clone()=0; - virtual void reset()=0; - virtual void update(const char *in, unsigned int len)=0; - virtual void final(TQByteArray *out)=0; -}; - -class QCA_CipherContext -{ -public: - virtual ~QCA_CipherContext() {} - - virtual QCA_CipherContext *clone()=0; - virtual int keySize()=0; - virtual int blockSize()=0; - virtual bool generateKey(char *out, int keysize=-1)=0; - virtual bool generateIV(char *out)=0; - - virtual bool setup(int dir, int mode, const char *key, int keysize, const char *iv, bool pad)=0; - virtual bool update(const char *in, unsigned int len)=0; - virtual bool final(TQByteArray *out)=0; -}; - -class QCA_RSAKeyContext -{ -public: - virtual ~QCA_RSAKeyContext() {} - - virtual QCA_RSAKeyContext *clone() const=0; - virtual bool isNull() const=0; - virtual bool havePublic() const=0; - virtual bool havePrivate() const=0; - virtual bool createFromDER(const char *in, unsigned int len)=0; - virtual bool createFromPEM(const char *in, unsigned int len)=0; - virtual bool createFromNative(void *in)=0; - virtual bool generate(unsigned int bits)=0; - virtual bool toDER(TQByteArray *out, bool publicOnly)=0; - virtual bool toPEM(TQByteArray *out, bool publicOnly)=0; - - virtual bool encrypt(const TQByteArray &in, TQByteArray *out, bool oaep)=0; - virtual bool decrypt(const TQByteArray &in, TQByteArray *out, bool oaep)=0; -}; - -struct QCA_CertProperty -{ - TQString var; - TQString val; -}; - -class QCA_CertContext -{ -public: - virtual ~QCA_CertContext() {} - - virtual QCA_CertContext *clone() const=0; - virtual bool isNull() const=0; - virtual bool createFromDER(const char *in, unsigned int len)=0; - virtual bool createFromPEM(const char *in, unsigned int len)=0; - virtual bool toDER(TQByteArray *out)=0; - virtual bool toPEM(TQByteArray *out)=0; - - virtual TQString serialNumber() const=0; - virtual TQString subjectString() const=0; - virtual TQString issuerString() const=0; - virtual TQValueList subject() const=0; - virtual TQValueList issuer() const=0; - virtual TQDateTime notBefore() const=0; - virtual TQDateTime notAfter() const=0; - virtual bool matchesAddress(const TQString &realHost) const=0; -}; - -class QCA_TLSContext -{ -public: - enum Result { Success, Error, Continue }; - virtual ~QCA_TLSContext() {} - - virtual void reset()=0; - virtual bool startClient(const TQPtrList &store, const QCA_CertContext &cert, const QCA_RSAKeyContext &key)=0; - virtual bool startServer(const TQPtrList &store, const QCA_CertContext &cert, const QCA_RSAKeyContext &key)=0; - - virtual int handshake(const TQByteArray &in, TQByteArray *out)=0; - virtual int shutdown(const TQByteArray &in, TQByteArray *out)=0; - virtual bool encode(const TQByteArray &plain, TQByteArray *to_net, int *encoded)=0; - virtual bool decode(const TQByteArray &from_net, TQByteArray *plain, TQByteArray *to_net)=0; - virtual bool eof() const=0; - virtual TQByteArray unprocessed()=0; - - virtual QCA_CertContext *peerCertificate() const=0; - virtual int validityResult() const=0; -}; - -struct QCA_SASLHostPort -{ - TQHostAddress addr; - TQ_UINT16 port; -}; - -struct QCA_SASLNeedParams -{ - bool user, authzid, pass, realm; -}; - -class QCA_SASLContext -{ -public: - enum Result { Success, Error, NeedParams, AuthCheck, Continue }; - virtual ~QCA_SASLContext() {} - - // common - virtual void reset()=0; - virtual void setCoreProps(const TQString &service, const TQString &host, QCA_SASLHostPort *local, QCA_SASLHostPort *remote)=0; - virtual void setSecurityProps(bool noPlain, bool noActive, bool noDict, bool noAnon, bool reqForward, bool reqCreds, bool reqMutual, int ssfMin, int ssfMax, const TQString &_ext_authid, int _ext_ssf)=0; - virtual int security() const=0; - virtual int errorCond() const=0; - - // init / first step - virtual bool clientStart(const TQStringList &mechlist)=0; - virtual int clientFirstStep(bool allowClientSendFirst)=0; - virtual bool serverStart(const TQString &realm, TQStringList *mechlist, const TQString &name)=0; - virtual int serverFirstStep(const TQString &mech, const TQByteArray *in)=0; - - // get / set params - virtual QCA_SASLNeedParams clientParamsNeeded() const=0; - virtual void setClientParams(const TQString *user, const TQString *authzid, const TQString *pass, const TQString *realm)=0; - virtual TQString username() const=0; - virtual TQString authzid() const=0; - - // continue steps - virtual int nextStep(const TQByteArray &in)=0; - virtual int tryAgain()=0; - - // results - virtual TQString mech() const=0; - virtual const TQByteArray *clientInit() const=0; - virtual TQByteArray result() const=0; - - // security layer - virtual bool encode(const TQByteArray &in, TQByteArray *out)=0; - virtual bool decode(const TQByteArray &in, TQByteArray *out)=0; -}; - -#endif diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp index 55555f04..fdcd57c1 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.cpp @@ -22,7 +22,7 @@ Note: SecureStream depends on the underlying security layers to signal plain-to-encrypted results immediately (as opposed to waiting for the event loop) so that the user cannot add/remove security layers during - this conversion moment. QCA::TLS and QCA::SASL behave as expected, + this conversion moment. TQCA::TLS and TQCA::SASL behave as expected, but future layers might not. */ @@ -117,8 +117,8 @@ public: enum { TLS, SASL, TLSH }; int type; union { - QCA::TLS *tls; - QCA::SASL *sasl; + TQCA::TLS *tls; + TQCA::SASL *sasl; #ifdef USE_TLSHANDLER XMPP::TLSHandler *tlsHandler; #endif @@ -127,7 +127,7 @@ public: bool tls_done; int prebytes; - SecureLayer(QCA::TLS *t) + SecureLayer(TQCA::TLS *t) { type = TLS; p.tls = t; @@ -139,7 +139,7 @@ public: connect(p.tls, TQT_SIGNAL(error(int)), TQT_SLOT(tls_error(int))); } - SecureLayer(QCA::SASL *s) + SecureLayer(TQCA::SASL *s) { type = SASL; p.sasl = s; @@ -381,7 +381,7 @@ int SecureStream::calcPrebytes() const return (d->pending - x); } -void SecureStream::startTLSClient(QCA::TLS *t, const TQByteArray &spare) +void SecureStream::startTLSClient(TQCA::TLS *t, const TQByteArray &spare) { if(!d->active || d->topInProgress || d->haveTLS()) return; @@ -395,7 +395,7 @@ void SecureStream::startTLSClient(QCA::TLS *t, const TQByteArray &spare) insertData(spare); } -void SecureStream::startTLSServer(QCA::TLS *t, const TQByteArray &spare) +void SecureStream::startTLSServer(TQCA::TLS *t, const TQByteArray &spare) { if(!d->active || d->topInProgress || d->haveTLS()) return; @@ -409,7 +409,7 @@ void SecureStream::startTLSServer(QCA::TLS *t, const TQByteArray &spare) insertData(spare); } -void SecureStream::setLayerSASL(QCA::SASL *sasl, const TQByteArray &spare) +void SecureStream::setLayerSASL(TQCA::SASL *sasl, const TQByteArray &spare) { if(!d->active || d->topInProgress || d->haveSASL()) return; @@ -434,7 +434,7 @@ void SecureStream::startTLSClient(XMPP::TLSHandler *t, const TQString &server, c d->layers.append(s); d->topInProgress = true; - // unlike QCA::TLS, XMPP::TLSHandler has no return value + // unlike TQCA::TLS, XMPP::TLSHandler has no return value s->p.tlsHandler->startClient(server); insertData(spare); diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h index 69826343..79f877ad 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/securestream.h @@ -42,9 +42,9 @@ public: SecureStream(ByteStream *s); ~SecureStream(); - void startTLSClient(QCA::TLS *t, const TQByteArray &spare=TQByteArray()); - void startTLSServer(QCA::TLS *t, const TQByteArray &spare=TQByteArray()); - void setLayerSASL(QCA::SASL *s, const TQByteArray &spare=TQByteArray()); + void startTLSClient(TQCA::TLS *t, const TQByteArray &spare=TQByteArray()); + void startTLSServer(TQCA::TLS *t, const TQByteArray &spare=TQByteArray()); + void setLayerSASL(TQCA::SASL *s, const TQByteArray &spare=TQByteArray()); #ifdef USE_TLSHANDLER void startTLSClient(XMPP::TLSHandler *t, const TQString &server, const TQByteArray &spare=TQByteArray()); #endif diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp index c825a2ca..b33048d1 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.cpp @@ -143,7 +143,7 @@ public: } }; -class SimpleSASLContext : public QCA_SASLContext +class SimpleSASLContext : public TQCA_SASLContext { public: // core props @@ -157,8 +157,8 @@ public: bool capable; int err; - QCA_SASLNeedParams need; - QCA_SASLNeedParams have; + TQCA_SASLNeedParams need; + TQCA_SASLNeedParams have; TQString user, authz, pass, realm; SimpleSASLContext() @@ -201,7 +201,7 @@ public: realm = TQString(); } - void setCoreProps(const TQString &_service, const TQString &_host, QCA_SASLHostPort *, QCA_SASLHostPort *) + void setCoreProps(const TQString &_service, const TQString &_host, TQCA_SASLHostPort *, TQCA_SASLHostPort *) { service = _service; host = _host; @@ -235,7 +235,7 @@ public: } } if(!capable || !haveMech) { - err = QCA::SASL::NoMech; + err = TQCA::SASL::NoMech; return false; } @@ -259,7 +259,7 @@ public: return Error; } - QCA_SASLNeedParams clientParamsNeeded() const + TQCA_SASLNeedParams clientParamsNeeded() const { return need; } @@ -352,7 +352,7 @@ public: TQCString cs(in_buf.data(), in_buf.size()+1); PropList in; if(!in.fromString(cs)) { - err = QCA::SASL::BadProto; + err = TQCA::SASL::BadProto; return Error; } @@ -371,16 +371,16 @@ public: // build 'response' TQCString X = user.utf8() + ':' + realm.utf8() + ':' + pass.utf8(); - TQByteArray Y = QCA::MD5::hash(X); + TQByteArray Y = TQCA::MD5::hash(X); TQCString tmp = TQCString(":") + nonce + ':' + cnonce + ':' + authz.utf8(); TQByteArray A1(Y.size() + tmp.length()); memcpy(A1.data(), Y.data(), Y.size()); memcpy(A1.data() + Y.size(), tmp.data(), tmp.length()); TQCString A2 = "AUTHENTICATE:" + uri; - TQCString HA1 = QCA::MD5::hashToString(A1).latin1(); - TQCString HA2 = QCA::MD5::hashToString(A2).latin1(); + TQCString HA1 = TQCA::MD5::hashToString(A1).latin1(); + TQCString HA2 = TQCA::MD5::hashToString(A2).latin1(); TQCString KD = HA1 + ':' + nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + HA2; - TQCString Z = QCA::MD5::hashToString(KD).latin1(); + TQCString Z = TQCA::MD5::hashToString(KD).latin1(); // build output PropList out; @@ -423,11 +423,11 @@ public: } }; -class QCASimpleSASL : public QCAProvider +class TQCASimpleSASL : public TQCAProvider { public: - QCASimpleSASL() {} - ~QCASimpleSASL() {} + TQCASimpleSASL() {} + ~TQCASimpleSASL() {} void init() { @@ -435,25 +435,25 @@ public: int qcaVersion() const { - return QCA_PLUGIN_VERSION; + return TQCA_PLUGIN_VERSION; } int capabilities() const { - return QCA::CAP_SASL; + return TQCA::CAP_SASL; } void *context(int cap) { - if(cap == QCA::CAP_SASL) + if(cap == TQCA::CAP_SASL) return new SimpleSASLContext; return 0; } }; -QCAProvider *createProviderSimpleSASL() +TQCAProvider *createProviderSimpleSASL() { - return (new QCASimpleSASL); + return (new TQCASimpleSASL); } } diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.h b/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.h index 9e5c8c51..3c888362 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.h +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/simplesasl.h @@ -21,11 +21,11 @@ #ifndef SIMPLESASL_H #define SIMPLESASL_H -#include"qcaprovider.h" +#include namespace XMPP { - QCAProvider *createProviderSimpleSASL(); + TQCAProvider *createProviderSimpleSASL(); } #endif diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp index 51041c1d..69b91a86 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/stream.cpp @@ -81,10 +81,10 @@ static TQByteArray randomArray(int size) static TQString genId() { // need SHA1 here - if(!QCA::isSupported(QCA::CAP_SHA1)) - QCA::insertProvider(createProviderHash()); + if(!TQCA::isSupported(TQCA::CAP_SHA1)) + TQCA::insertProvider(createProviderHash()); - return QCA::SHA1::hashToString(randomArray(128)); + return TQCA::SHA1::hashToString(randomArray(128)); } //---------------------------------------------------------------------------- @@ -584,8 +584,8 @@ public: Connector *conn; ByteStream *bs; TLSHandler *tlsHandler; - QCA::TLS *tls; - QCA::SASL *sasl; + TQCA::TLS *tls; + TQCA::SASL *sasl; SecureStream *ss; CoreProtocol client; CoreProtocol srv; @@ -627,7 +627,7 @@ ClientStream::ClientStream(Connector *conn, TLSHandler *tlsHandler, TQObject *pa d->tlsHandler = tlsHandler; } -ClientStream::ClientStream(const TQString &host, const TQString &defRealm, ByteStream *bs, QCA::TLS *tls, TQObject *parent) +ClientStream::ClientStream(const TQString &host, const TQString &defRealm, ByteStream *bs, TQCA::TLS *tls, TQObject *parent) :Stream(parent) { d = new Private; @@ -1162,7 +1162,7 @@ void ClientStream::srvProcessNext() } else if(need == CoreProtocol::NSASLMechs) { if(!d->sasl) { - d->sasl = new QCA::SASL; + d->sasl = new TQCA::SASL; connect(d->sasl, TQT_SIGNAL(authCheck(const TQString &, const TQString &)), TQT_SLOT(sasl_authCheck(const TQString &, const TQString &))); connect(d->sasl, TQT_SIGNAL(nextStep(const TQByteArray &)), TQT_SLOT(sasl_nextStep(const TQByteArray &))); connect(d->sasl, TQT_SIGNAL(authenticated()), TQT_SLOT(sasl_authenticated())); @@ -1241,9 +1241,9 @@ void ClientStream::srvProcessNext() printf("Break (RecvOpen)\n"); // calculate key - TQCString str = QCA::SHA1::hashToString(TQCString("secret")).utf8(); - str = QCA::SHA1::hashToString(str + "im.pyxa.org").utf8(); - str = QCA::SHA1::hashToString(str + d->srv.id.utf8()).utf8(); + TQCString str = TQCA::SHA1::hashToString(TQCString("secret")).utf8(); + str = TQCA::SHA1::hashToString(str + "im.pyxa.org").utf8(); + str = TQCA::SHA1::hashToString(str + d->srv.id.utf8()).utf8(); d->srv.setDialbackKey(str); //d->srv.setDialbackKey("3c5d721ea2fcc45b163a11420e4e358f87e3142a"); @@ -1472,14 +1472,14 @@ bool ClientStream::handleNeed() printf("Need SASL First Step\n"); #endif // no SASL plugin? fall back to Simple SASL - if(!QCA::isSupported(QCA::CAP_SASL)) { + if(!TQCA::isSupported(TQCA::CAP_SASL)) { // Simple SASL needs MD5. do we have that either? - if(!QCA::isSupported(QCA::CAP_MD5)) - QCA::insertProvider(createProviderHash()); - QCA::insertProvider(createProviderSimpleSASL()); + if(!TQCA::isSupported(TQCA::CAP_MD5)) + TQCA::insertProvider(createProviderHash()); + TQCA::insertProvider(createProviderSimpleSASL()); } - d->sasl = new QCA::SASL; + d->sasl = new TQCA::SASL; connect(d->sasl, TQT_SIGNAL(clientFirstStep(const TQString &, const TQByteArray *)), TQT_SLOT(sasl_clientFirstStep(const TQString &, const TQByteArray *))); connect(d->sasl, TQT_SIGNAL(nextStep(const TQByteArray &)), TQT_SLOT(sasl_nextStep(const TQByteArray &))); connect(d->sasl, TQT_SIGNAL(needParams(bool, bool, bool, bool)), TQT_SLOT(sasl_needParams(bool, bool, bool, bool))); @@ -1557,13 +1557,13 @@ bool ClientStream::handleNeed() int ClientStream::convertedSASLCond() const { int x = d->sasl->errorCondition(); - if(x == QCA::SASL::NoMech) + if(x == TQCA::SASL::NoMech) return NoMech; - else if(x == QCA::SASL::BadProto) + else if(x == TQCA::SASL::BadProto) return BadProto; - else if(x == QCA::SASL::BadServ) + else if(x == TQCA::SASL::BadServ) return BadServ; - else if(x == QCA::SASL::TooWeak) + else if(x == TQCA::SASL::TooWeak) return MechTooWeak; else return GenericAuthError; diff --git a/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp b/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp index 313c6b6a..d00f50dc 100644 --- a/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp +++ b/kopete/protocols/jabber/libiris/iris/xmpp-core/tlshandler.cpp @@ -21,7 +21,7 @@ #include"xmpp.h" #include -#include"qca.h" +#include using namespace XMPP; @@ -39,16 +39,16 @@ TLSHandler::~TLSHandler() //---------------------------------------------------------------------------- -// QCATLSHandler +// TQCATLSHandler //---------------------------------------------------------------------------- -class QCATLSHandler::Private +class TQCATLSHandler::Private { public: - QCA::TLS *tls; + TQCA::TLS *tls; int state, err; }; -QCATLSHandler::QCATLSHandler(QCA::TLS *parent) +TQCATLSHandler::TQCATLSHandler(TQCA::TLS *parent) :TLSHandler(parent) { d = new Private; @@ -62,28 +62,28 @@ QCATLSHandler::QCATLSHandler(QCA::TLS *parent) d->err = -1; } -QCATLSHandler::~QCATLSHandler() +TQCATLSHandler::~TQCATLSHandler() { delete d; } -QCA::TLS *QCATLSHandler::tls() const +TQCA::TLS *TQCATLSHandler::tls() const { return d->tls; } -int QCATLSHandler::tlsError() const +int TQCATLSHandler::tlsError() const { return d->err; } -void QCATLSHandler::reset() +void TQCATLSHandler::reset() { d->tls->reset(); d->state = 0; } -void QCATLSHandler::startClient(const TQString &host) +void TQCATLSHandler::startClient(const TQString &host) { d->state = 0; d->err = -1; @@ -91,17 +91,17 @@ void QCATLSHandler::startClient(const TQString &host) TQTimer::singleShot(0, this, TQT_SIGNAL(fail())); } -void QCATLSHandler::write(const TQByteArray &a) +void TQCATLSHandler::write(const TQByteArray &a) { d->tls->write(a); } -void QCATLSHandler::writeIncoming(const TQByteArray &a) +void TQCATLSHandler::writeIncoming(const TQByteArray &a) { d->tls->writeIncoming(a); } -void QCATLSHandler::continueAfterHandshake() +void TQCATLSHandler::continueAfterHandshake() { if(d->state == 2) { success(); @@ -109,28 +109,28 @@ void QCATLSHandler::continueAfterHandshake() } } -void QCATLSHandler::tls_handshaken() +void TQCATLSHandler::tls_handshaken() { d->state = 2; tlsHandshaken(); } -void QCATLSHandler::tls_readyRead() +void TQCATLSHandler::tls_readyRead() { readyRead(d->tls->read()); } -void QCATLSHandler::tls_readyReadOutgoing(int plainBytes) +void TQCATLSHandler::tls_readyReadOutgoing(int plainBytes) { readyReadOutgoing(d->tls->readOutgoing(), plainBytes); } -void QCATLSHandler::tls_closed() +void TQCATLSHandler::tls_closed() { closed(); } -void QCATLSHandler::tls_error(int x) +void TQCATLSHandler::tls_error(int x) { d->err = x; d->state = 0; -- cgit v1.2.1