summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/groupwise/libgroupwise/qca/src/qca.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/groupwise/libgroupwise/qca/src/qca.cpp')
-rw-r--r--kopete/protocols/groupwise/libgroupwise/qca/src/qca.cpp298
1 files changed, 149 insertions, 149 deletions
diff --git a/kopete/protocols/groupwise/libgroupwise/qca/src/qca.cpp b/kopete/protocols/groupwise/libgroupwise/qca/src/qca.cpp
index e660ef42..10cae6b8 100644
--- a/kopete/protocols/groupwise/libgroupwise/qca/src/qca.cpp
+++ b/kopete/protocols/groupwise/libgroupwise/qca/src/qca.cpp
@@ -20,15 +20,15 @@
#include"qca.h"
-#include<qptrlist.h>
-#include<qdir.h>
-#include<qfileinfo.h>
-#include<qstringlist.h>
-#include<qlibrary.h>
-#include<qtimer.h>
-#include<qhostaddress.h>
-#include<qapplication.h>
-#include<qguardedptr.h>
+#include<tqptrlist.h>
+#include<tqdir.h>
+#include<tqfileinfo.h>
+#include<tqstringlist.h>
+#include<tqlibrary.h>
+#include<tqtimer.h>
+#include<tqhostaddress.h>
+#include<tqapplication.h>
+#include<tqguardedptr.h>
#include<stdlib.h>
#include"qcaprovider.h"
@@ -46,11 +46,11 @@ class ProviderItem
{
public:
QCAProvider *p;
- QString fname;
+ TQString fname;
- static ProviderItem *load(const QString &fname)
+ static ProviderItem *load(const TQString &fname)
{
- QLibrary *lib = new QLibrary(fname);
+ TQLibrary *lib = new TQLibrary(fname);
if(!lib->load()) {
delete lib;
return 0;
@@ -92,10 +92,10 @@ public:
}
private:
- QLibrary *lib;
+ TQLibrary *lib;
bool init_done;
- ProviderItem(QLibrary *_lib, QCAProvider *_p)
+ ProviderItem(TQLibrary *_lib, QCAProvider *_p)
{
lib = _lib;
p = _p;
@@ -103,12 +103,12 @@ private:
}
};
-static QPtrList<ProviderItem> providerList;
+static TQPtrList<ProviderItem> providerList;
static bool qca_init = false;
-static bool plugin_have(const QString &fname)
+static bool plugin_have(const TQString &fname)
{
- QPtrListIterator<ProviderItem> it(providerList);
+ TQPtrListIterator<ProviderItem> it(providerList);
for(ProviderItem *i; (i = it.current()); ++it) {
if(i->fname == fname)
return true;
@@ -118,21 +118,21 @@ static bool plugin_have(const QString &fname)
static void plugin_scan()
{
- QStringList dirs = QApplication::libraryPaths();
- for(QStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
- QDir libpath(*it);
- QDir dir(libpath.filePath("crypto"));
+ TQStringList dirs = TQApplication::libraryPaths();
+ for(TQStringList::ConstIterator it = dirs.begin(); it != dirs.end(); ++it) {
+ TQDir libpath(*it);
+ TQDir dir(libpath.filePath("crypto"));
if(!dir.exists())
continue;
- QStringList list = dir.entryList();
- for(QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
- QFileInfo fi(dir.filePath(*it));
+ TQStringList list = dir.entryList();
+ for(TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) {
+ TQFileInfo fi(dir.filePath(*it));
if(fi.isDir())
continue;
if(fi.extension() != PLUGIN_EXT)
continue;
- QString fname = fi.filePath();
+ TQString fname = fi.filePath();
// don't load the same plugin again!
if(plugin_have(fname))
@@ -166,26 +166,26 @@ static void plugin_unloadall()
static int plugin_caps()
{
int caps = 0;
- QPtrListIterator<ProviderItem> it(providerList);
+ TQPtrListIterator<ProviderItem> it(providerList);
for(ProviderItem *i; (i = it.current()); ++it)
caps |= i->p->capabilities();
return caps;
}
-QString QCA::arrayToHex(const QByteArray &a)
+TQString QCA::arrayToHex(const TQByteArray &a)
{
- QString out;
+ TQString out;
for(int n = 0; n < (int)a.size(); ++n) {
- QString str;
+ TQString str;
str.sprintf("%02x", (uchar)a[n]);
out.append(str);
}
return out;
}
-QByteArray QCA::hexToArray(const QString &str)
+TQByteArray QCA::hexToArray(const TQString &str)
{
- QByteArray out(str.length() / 2);
+ TQByteArray out(str.length() / 2);
int at = 0;
for(int n = 0; n + 1 < (int)str.length(); n += 2) {
uchar a = str[n];
@@ -239,7 +239,7 @@ static void *getContext(int cap)
if(!QCA::isSupported(cap))
return 0;
- QPtrListIterator<ProviderItem> it(providerList);
+ TQPtrListIterator<ProviderItem> it(providerList);
for(ProviderItem *i; (i = it.current()); ++it) {
if(i->p->capabilities() & cap) {
i->ensureInit();
@@ -303,14 +303,14 @@ void Hash::clear()
d->reset();
}
-void Hash::update(const QByteArray &a)
+void Hash::update(const TQByteArray &a)
{
d->c->update(a.data(), a.size());
}
-QByteArray Hash::final()
+TQByteArray Hash::final()
{
- QByteArray buf;
+ TQByteArray buf;
d->c->final(&buf);
return buf;
}
@@ -343,11 +343,11 @@ public:
QCA_CipherContext *c;
int dir;
int mode;
- QByteArray key, iv;
+ TQByteArray key, iv;
bool err;
};
-Cipher::Cipher(QCA_CipherContext *c, int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad)
+Cipher::Cipher(QCA_CipherContext *c, int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad)
{
d = new Private;
d->c = c;
@@ -377,27 +377,27 @@ Cipher::~Cipher()
delete d;
}
-QByteArray Cipher::dyn_generateKey(int size) const
+TQByteArray Cipher::dyn_generateKey(int size) const
{
- QByteArray buf;
+ TQByteArray buf;
if(size != -1)
buf.resize(size);
else
buf.resize(d->c->keySize());
if(!d->c->generateKey(buf.data(), size))
- return QByteArray();
+ return TQByteArray();
return buf;
}
-QByteArray Cipher::dyn_generateIV() const
+TQByteArray Cipher::dyn_generateIV() const
{
- QByteArray buf(d->c->blockSize());
+ TQByteArray buf(d->c->blockSize());
if(!d->c->generateIV(buf.data()))
- return QByteArray();
+ return TQByteArray();
return buf;
}
-void Cipher::reset(int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad)
+void Cipher::reset(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad)
{
d->reset();
@@ -411,7 +411,7 @@ void Cipher::reset(int dir, int mode, const QByteArray &key, const QByteArray &i
}
}
-bool Cipher::update(const QByteArray &a)
+bool Cipher::update(const TQByteArray &a)
{
if(d->err)
return false;
@@ -425,17 +425,17 @@ bool Cipher::update(const QByteArray &a)
return true;
}
-QByteArray Cipher::final(bool *ok)
+TQByteArray Cipher::final(bool *ok)
{
if(ok)
*ok = false;
if(d->err)
- return QByteArray();
+ return TQByteArray();
- QByteArray out;
+ TQByteArray out;
if(!d->c->final(&out)) {
d->err = true;
- return QByteArray();
+ return TQByteArray();
}
if(ok)
*ok = true;
@@ -473,7 +473,7 @@ MD5::MD5()
//----------------------------------------------------------------------------
// BlowFish
//----------------------------------------------------------------------------
-BlowFish::BlowFish(int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad)
+BlowFish::BlowFish(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad)
:Cipher((QCA_CipherContext *)getContext(CAP_BlowFish), dir, mode, key, iv, pad)
{
}
@@ -482,7 +482,7 @@ BlowFish::BlowFish(int dir, int mode, const QByteArray &key, const QByteArray &i
//----------------------------------------------------------------------------
// TripleDES
//----------------------------------------------------------------------------
-TripleDES::TripleDES(int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad)
+TripleDES::TripleDES(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad)
:Cipher((QCA_CipherContext *)getContext(CAP_TripleDES), dir, mode, key, iv, pad)
{
}
@@ -491,7 +491,7 @@ TripleDES::TripleDES(int dir, int mode, const QByteArray &key, const QByteArray
//----------------------------------------------------------------------------
// AES128
//----------------------------------------------------------------------------
-AES128::AES128(int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad)
+AES128::AES128(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad)
:Cipher((QCA_CipherContext *)getContext(CAP_AES128), dir, mode, key, iv, pad)
{
}
@@ -500,7 +500,7 @@ AES128::AES128(int dir, int mode, const QByteArray &key, const QByteArray &iv, b
//----------------------------------------------------------------------------
// AES256
//----------------------------------------------------------------------------
-AES256::AES256(int dir, int mode, const QByteArray &key, const QByteArray &iv, bool pad)
+AES256::AES256(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad)
:Cipher((QCA_CipherContext *)getContext(CAP_AES256), dir, mode, key, iv, pad)
{
}
@@ -564,35 +564,35 @@ bool RSAKey::havePrivate() const
return d->c->havePrivate();
}
-QByteArray RSAKey::toDER(bool publicOnly) const
+TQByteArray RSAKey::toDER(bool publicOnly) const
{
- QByteArray out;
+ TQByteArray out;
if(!d->c->toDER(&out, publicOnly))
- return QByteArray();
+ return TQByteArray();
return out;
}
-bool RSAKey::fromDER(const QByteArray &a)
+bool RSAKey::fromDER(const TQByteArray &a)
{
return d->c->createFromDER(a.data(), a.size());
}
-QString RSAKey::toPEM(bool publicOnly) const
+TQString RSAKey::toPEM(bool publicOnly) const
{
- QByteArray out;
+ TQByteArray out;
if(!d->c->toPEM(&out, publicOnly))
- return QByteArray();
+ return TQByteArray();
- QCString cs;
+ TQCString cs;
cs.resize(out.size()+1);
memcpy(cs.data(), out.data(), out.size());
- return QString::fromLatin1(cs);
+ return TQString::fromLatin1(cs);
}
-bool RSAKey::fromPEM(const QString &str)
+bool RSAKey::fromPEM(const TQString &str)
{
- QCString cs = str.latin1();
- QByteArray a(cs.length());
+ TQCString cs = str.latin1();
+ TQByteArray a(cs.length());
memcpy(a.data(), cs.data(), a.size());
return d->c->createFromPEM(a.data(), a.size());
}
@@ -602,18 +602,18 @@ bool RSAKey::fromNative(void *p)
return d->c->createFromNative(p);
}
-bool RSAKey::encrypt(const QByteArray &a, QByteArray *b, bool oaep) const
+bool RSAKey::encrypt(const TQByteArray &a, TQByteArray *b, bool oaep) const
{
- QByteArray out;
+ TQByteArray out;
if(!d->c->encrypt(a, &out, oaep))
return false;
*b = out;
return true;
}
-bool RSAKey::decrypt(const QByteArray &a, QByteArray *b, bool oaep) const
+bool RSAKey::decrypt(const TQByteArray &a, TQByteArray *b, bool oaep) const
{
- QByteArray out;
+ TQByteArray out;
if(!d->c->decrypt(a, &out, oaep))
return false;
*b = out;
@@ -647,14 +647,14 @@ void RSA::setKey(const RSAKey &k)
v_key = k;
}
-bool RSA::encrypt(const QByteArray &a, QByteArray *b, bool oaep) const
+bool RSA::encrypt(const TQByteArray &a, TQByteArray *b, bool oaep) const
{
if(v_key.isNull())
return false;
return v_key.encrypt(a, b, oaep);
}
-bool RSA::decrypt(const QByteArray &a, QByteArray *b, bool oaep) const
+bool RSA::decrypt(const TQByteArray &a, TQByteArray *b, bool oaep) const
{
if(v_key.isNull())
return false;
@@ -727,84 +727,84 @@ bool Cert::isNull() const
return d->c->isNull();
}
-QString Cert::commonName() const
+TQString Cert::commonName() const
{
CertProperties props = subject();
return props["CN"];
}
-QString Cert::serialNumber() const
+TQString Cert::serialNumber() const
{
return d->c->serialNumber();
}
-QString Cert::subjectString() const
+TQString Cert::subjectString() const
{
return d->c->subjectString();
}
-QString Cert::issuerString() const
+TQString Cert::issuerString() const
{
return d->c->issuerString();
}
CertProperties Cert::subject() const
{
- QValueList<QCA_CertProperty> list = d->c->subject();
+ TQValueList<QCA_CertProperty> list = d->c->subject();
CertProperties props;
- for(QValueList<QCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for(TQValueList<QCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it)
props[(*it).var] = (*it).val;
return props;
}
CertProperties Cert::issuer() const
{
- QValueList<QCA_CertProperty> list = d->c->issuer();
+ TQValueList<QCA_CertProperty> list = d->c->issuer();
CertProperties props;
- for(QValueList<QCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it)
+ for(TQValueList<QCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it)
props[(*it).var] = (*it).val;
return props;
}
-QDateTime Cert::notBefore() const
+TQDateTime Cert::notBefore() const
{
return d->c->notBefore();
}
-QDateTime Cert::notAfter() const
+TQDateTime Cert::notAfter() const
{
return d->c->notAfter();
}
-QByteArray Cert::toDER() const
+TQByteArray Cert::toDER() const
{
- QByteArray out;
+ TQByteArray out;
if(!d->c->toDER(&out))
- return QByteArray();
+ return TQByteArray();
return out;
}
-bool Cert::fromDER(const QByteArray &a)
+bool Cert::fromDER(const TQByteArray &a)
{
return d->c->createFromDER(a.data(), a.size());
}
-QString Cert::toPEM() const
+TQString Cert::toPEM() const
{
- QByteArray out;
+ TQByteArray out;
if(!d->c->toPEM(&out))
- return QByteArray();
+ return TQByteArray();
- QCString cs;
+ TQCString cs;
cs.resize(out.size()+1);
memcpy(cs.data(), out.data(), out.size());
- return QString::fromLatin1(cs);
+ return TQString::fromLatin1(cs);
}
-bool Cert::fromPEM(const QString &str)
+bool Cert::fromPEM(const TQString &str)
{
- QCString cs = str.latin1();
- QByteArray a(cs.length());
+ TQCString cs = str.latin1();
+ TQByteArray a(cs.length());
memcpy(a.data(), cs.data(), a.size());
return d->c->createFromPEM(a.data(), a.size());
}
@@ -842,7 +842,7 @@ public:
tryMore = false;
}
- void appendArray(QByteArray *a, const QByteArray &b)
+ void appendArray(TQByteArray *a, const TQByteArray &b)
{
int oldsize = a->size();
a->resize(oldsize + b.size());
@@ -851,21 +851,21 @@ public:
Cert cert;
QCA_TLSContext *c;
- QByteArray in, out, to_net, from_net;
+ TQByteArray in, out, to_net, from_net;
int bytesEncoded;
bool tryMore;
bool handshaken;
- QString host;
+ TQString host;
bool hostMismatch;
bool closing;
Cert ourCert;
RSAKey ourKey;
- QPtrList<QCA_CertContext> store;
+ TQPtrList<QCA_CertContext> store;
};
-TLS::TLS(QObject *parent)
-:QObject(parent)
+TLS::TLS(TQObject *parent)
+:TQObject(parent)
{
d = new Private;
}
@@ -881,11 +881,11 @@ void TLS::setCertificate(const Cert &cert, const RSAKey &key)
d->ourKey = key;
}
-void TLS::setCertificateStore(const QPtrList<Cert> &store)
+void TLS::setCertificateStore(const TQPtrList<Cert> &store)
{
// convert the cert list into a context list
d->store.clear();
- QPtrListIterator<Cert> it(store);
+ TQPtrListIterator<Cert> it(store);
for(Cert *cert; (cert = it.current()); ++it)
d->store.append(cert->d->c);
}
@@ -895,14 +895,14 @@ void TLS::reset()
d->reset();
}
-bool TLS::startClient(const QString &host)
+bool TLS::startClient(const TQString &host)
{
d->reset();
d->host = host;
if(!d->c->startClient(d->store, *d->ourCert.d->c, *d->ourKey.d->c))
return false;
- QTimer::singleShot(0, this, SLOT(update()));
+ TQTimer::singleShot(0, this, TQT_SLOT(update()));
return true;
}
@@ -912,7 +912,7 @@ bool TLS::startServer()
if(!d->c->startServer(d->store, *d->ourCert.d->c, *d->ourKey.d->c))
return false;
- QTimer::singleShot(0, this, SLOT(update()));
+ TQTimer::singleShot(0, this, TQT_SLOT(update()));
return true;
}
@@ -922,7 +922,7 @@ void TLS::close()
return;
d->closing = true;
- QTimer::singleShot(0, this, SLOT(update()));
+ TQTimer::singleShot(0, this, TQT_SLOT(update()));
}
bool TLS::isHandshaken() const
@@ -930,35 +930,35 @@ bool TLS::isHandshaken() const
return d->handshaken;
}
-void TLS::write(const QByteArray &a)
+void TLS::write(const TQByteArray &a)
{
d->appendArray(&d->out, a);
update();
}
-QByteArray TLS::read()
+TQByteArray TLS::read()
{
- QByteArray a = d->in.copy();
+ TQByteArray a = d->in.copy();
d->in.resize(0);
return a;
}
-void TLS::writeIncoming(const QByteArray &a)
+void TLS::writeIncoming(const TQByteArray &a)
{
d->appendArray(&d->from_net, a);
update();
}
-QByteArray TLS::readOutgoing()
+TQByteArray TLS::readOutgoing()
{
- QByteArray a = d->to_net.copy();
+ TQByteArray a = d->to_net.copy();
d->to_net.resize(0);
return a;
}
-QByteArray TLS::readUnprocessed()
+TQByteArray TLS::readUnprocessed()
{
- QByteArray a = d->from_net.copy();
+ TQByteArray a = d->from_net.copy();
d->from_net.resize(0);
return a;
}
@@ -981,10 +981,10 @@ void TLS::update()
bool force_read = false;
bool eof = false;
bool done = false;
- QGuardedPtr<TLS> self = this;
+ TQGuardedPtr<TLS> self = this;
if(d->closing) {
- QByteArray a;
+ TQByteArray a;
int r = d->c->shutdown(d->from_net, &a);
d->from_net.resize(0);
if(r == QCA_TLSContext::Error) {
@@ -1000,7 +1000,7 @@ void TLS::update()
}
else {
if(!d->handshaken) {
- QByteArray a;
+ TQByteArray a;
int r = d->c->handshake(d->from_net, &a);
d->from_net.resize(0);
if(r == QCA_TLSContext::Error) {
@@ -1029,7 +1029,7 @@ void TLS::update()
if(d->handshaken) {
if(!d->out.isEmpty() || d->tryMore) {
d->tryMore = false;
- QByteArray a;
+ TQByteArray a;
int enc;
bool more = false;
bool ok = d->c->encode(d->out, &a, &enc);
@@ -1050,7 +1050,7 @@ void TLS::update()
}
}
if(!d->from_net.isEmpty() || force_read) {
- QByteArray a, b;
+ TQByteArray a, b;
bool ok = d->c->decode(d->from_net, &a, &b);
eof = d->c->eof();
d->from_net.resize(0);
@@ -1096,7 +1096,7 @@ void TLS::update()
//----------------------------------------------------------------------------
// SASL
//----------------------------------------------------------------------------
-QString saslappname = "qca";
+TQString saslappname = "qca";
class SASL::Private
{
public:
@@ -1118,22 +1118,22 @@ public:
// security opts
bool noPlain, noActive, noDict, noAnon, reqForward, reqCreds, reqMutual;
int ssfmin, ssfmax;
- QString ext_authid;
+ TQString ext_authid;
int ext_ssf;
bool tried;
QCA_SASLContext *c;
- QHostAddress localAddr, remoteAddr;
+ TQHostAddress localAddr, remoteAddr;
int localPort, remotePort;
- QByteArray stepData;
+ TQByteArray stepData;
bool allowCSF;
bool first, server;
- QByteArray inbuf, outbuf;
+ TQByteArray inbuf, outbuf;
};
-SASL::SASL(QObject *parent)
-:QObject(parent)
+SASL::SASL(TQObject *parent)
+:TQObject(parent)
{
d = new Private;
reset();
@@ -1144,7 +1144,7 @@ SASL::~SASL()
delete d;
}
-void SASL::setAppName(const QString &name)
+void SASL::setAppName(const TQString &name)
{
saslappname = name;
}
@@ -1222,7 +1222,7 @@ void SASL::setMaximumSSF(int x)
d->ssfmax = x;
}
-void SASL::setExternalAuthID(const QString &authid)
+void SASL::setExternalAuthID(const TQString &authid)
{
d->ext_authid = authid;
}
@@ -1232,19 +1232,19 @@ void SASL::setExternalSSF(int x)
d->ext_ssf = x;
}
-void SASL::setLocalAddr(const QHostAddress &addr, Q_UINT16 port)
+void SASL::setLocalAddr(const TQHostAddress &addr, Q_UINT16 port)
{
d->localAddr = addr;
d->localPort = port;
}
-void SASL::setRemoteAddr(const QHostAddress &addr, Q_UINT16 port)
+void SASL::setRemoteAddr(const TQHostAddress &addr, Q_UINT16 port)
{
d->remoteAddr = addr;
d->remotePort = port;
}
-bool SASL::startClient(const QString &service, const QString &host, const QStringList &mechlist, bool allowClientSendFirst)
+bool SASL::startClient(const TQString &service, const TQString &host, const TQStringList &mechlist, bool allowClientSendFirst)
{
QCA_SASLHostPort la, ra;
if(d->localPort != -1) {
@@ -1265,11 +1265,11 @@ bool SASL::startClient(const QString &service, const QString &host, const QStrin
d->first = true;
d->server = false;
d->tried = false;
- QTimer::singleShot(0, this, SLOT(tryAgain()));
+ TQTimer::singleShot(0, this, TQT_SLOT(tryAgain()));
return true;
}
-bool SASL::startServer(const QString &service, const QString &host, const QString &realm, QStringList *mechlist)
+bool SASL::startServer(const TQString &service, const TQString &host, const TQString &realm, TQStringList *mechlist)
{
QCA_SASLHostPort la, ra;
if(d->localPort != -1) {
@@ -1292,13 +1292,13 @@ bool SASL::startServer(const QString &service, const QString &host, const QStrin
return true;
}
-void SASL::putServerFirstStep(const QString &mech)
+void SASL::putServerFirstStep(const TQString &mech)
{
int r = d->c->serverFirstStep(mech, 0);
handleServerFirstStep(r);
}
-void SASL::putServerFirstStep(const QString &mech, const QByteArray &clientInit)
+void SASL::putServerFirstStep(const TQString &mech, const TQByteArray &clientInit)
{
int r = d->c->serverFirstStep(mech, &clientInit);
handleServerFirstStep(r);
@@ -1316,28 +1316,28 @@ void SASL::handleServerFirstStep(int r)
error(ErrAuth);
}
-void SASL::putStep(const QByteArray &stepData)
+void SASL::putStep(const TQByteArray &stepData)
{
d->stepData = stepData.copy();
tryAgain();
}
-void SASL::setUsername(const QString &user)
+void SASL::setUsername(const TQString &user)
{
d->c->setClientParams(&user, 0, 0, 0);
}
-void SASL::setAuthzid(const QString &authzid)
+void SASL::setAuthzid(const TQString &authzid)
{
d->c->setClientParams(0, &authzid, 0, 0);
}
-void SASL::setPassword(const QString &pass)
+void SASL::setPassword(const TQString &pass)
{
d->c->setClientParams(0, 0, &pass, 0);
}
-void SASL::setRealm(const QString &realm)
+void SASL::setRealm(const TQString &realm)
{
d->c->setClientParams(0, 0, 0, &realm);
}
@@ -1399,8 +1399,8 @@ void SASL::tryAgain()
return;
}
- QString mech = d->c->mech();
- const QByteArray *clientInit = d->c->clientInit();
+ TQString mech = d->c->mech();
+ const TQByteArray *clientInit = d->c->clientInit();
d->first = false;
d->tried = false;
@@ -1443,9 +1443,9 @@ int SASL::ssf() const
return d->c->security();
}
-void SASL::write(const QByteArray &a)
+void SASL::write(const TQByteArray &a)
{
- QByteArray b;
+ TQByteArray b;
if(!d->c->encode(a, &b)) {
error(ErrCrypt);
return;
@@ -1456,16 +1456,16 @@ void SASL::write(const QByteArray &a)
readyReadOutgoing(a.size());
}
-QByteArray SASL::read()
+TQByteArray SASL::read()
{
- QByteArray a = d->inbuf.copy();
+ TQByteArray a = d->inbuf.copy();
d->inbuf.resize(0);
return a;
}
-void SASL::writeIncoming(const QByteArray &a)
+void SASL::writeIncoming(const TQByteArray &a)
{
- QByteArray b;
+ TQByteArray b;
if(!d->c->decode(a, &b)) {
error(ErrCrypt);
return;
@@ -1476,9 +1476,9 @@ void SASL::writeIncoming(const QByteArray &a)
readyRead();
}
-QByteArray SASL::readOutgoing()
+TQByteArray SASL::readOutgoing()
{
- QByteArray a = d->outbuf.copy();
+ TQByteArray a = d->outbuf.copy();
d->outbuf.resize(0);
return a;
}