|
Lines 40-51
Link Here
|
| 40 |
#define PLUGIN_EXT "so" |
40 |
#define PLUGIN_EXT "so" |
| 41 |
#endif |
41 |
#endif |
| 42 |
|
42 |
|
| 43 |
using namespace QCA; |
43 |
using namespace TQCA; |
| 44 |
|
44 |
|
| 45 |
class ProviderItem |
45 |
class ProviderItem |
| 46 |
{ |
46 |
{ |
| 47 |
public: |
47 |
public: |
| 48 |
QCAProvider *p; |
48 |
TQCAProvider *p; |
| 49 |
TQString fname; |
49 |
TQString fname; |
| 50 |
|
50 |
|
| 51 |
static ProviderItem *load(const TQString &fname) |
51 |
static ProviderItem *load(const TQString &fname) |
|
Lines 60-67
Link Here
|
| 60 |
delete lib; |
60 |
delete lib; |
| 61 |
return 0; |
61 |
return 0; |
| 62 |
} |
62 |
} |
| 63 |
QCAProvider *(*createProvider)() = (QCAProvider *(*)())s; |
63 |
TQCAProvider *(*createProvider)() = (TQCAProvider *(*)())s; |
| 64 |
QCAProvider *p = createProvider(); |
64 |
TQCAProvider *p = createProvider(); |
| 65 |
if(!p) { |
65 |
if(!p) { |
| 66 |
delete lib; |
66 |
delete lib; |
| 67 |
return 0; |
67 |
return 0; |
|
Lines 71-77
Link Here
|
| 71 |
return i; |
71 |
return i; |
| 72 |
} |
72 |
} |
| 73 |
|
73 |
|
| 74 |
static ProviderItem *fromClass(QCAProvider *p) |
74 |
static ProviderItem *fromClass(TQCAProvider *p) |
| 75 |
{ |
75 |
{ |
| 76 |
ProviderItem *i = new ProviderItem(0, p); |
76 |
ProviderItem *i = new ProviderItem(0, p); |
| 77 |
return i; |
77 |
return i; |
|
Lines 95-101
Link Here
|
| 95 |
TQLibrary *lib; |
95 |
TQLibrary *lib; |
| 96 |
bool init_done; |
96 |
bool init_done; |
| 97 |
|
97 |
|
| 98 |
ProviderItem(TQLibrary *_lib, QCAProvider *_p) |
98 |
ProviderItem(TQLibrary *_lib, TQCAProvider *_p) |
| 99 |
{ |
99 |
{ |
| 100 |
lib = _lib; |
100 |
lib = _lib; |
| 101 |
p = _p; |
101 |
p = _p; |
|
Lines 142-148
Link Here
|
| 142 |
ProviderItem *i = ProviderItem::load(fname); |
142 |
ProviderItem *i = ProviderItem::load(fname); |
| 143 |
if(!i) |
143 |
if(!i) |
| 144 |
continue; |
144 |
continue; |
| 145 |
if(i->p->qcaVersion() != QCA_PLUGIN_VERSION) { |
145 |
if(i->p->qcaVersion() != TQCA_PLUGIN_VERSION) { |
| 146 |
delete i; |
146 |
delete i; |
| 147 |
continue; |
147 |
continue; |
| 148 |
} |
148 |
} |
|
Lines 152-158
Link Here
|
| 152 |
} |
152 |
} |
| 153 |
} |
153 |
} |
| 154 |
|
154 |
|
| 155 |
static void plugin_addClass(QCAProvider *p) |
155 |
static void plugin_addClass(TQCAProvider *p) |
| 156 |
{ |
156 |
{ |
| 157 |
ProviderItem *i = ProviderItem::fromClass(p); |
157 |
ProviderItem *i = ProviderItem::fromClass(p); |
| 158 |
providerList.prepend(i); |
158 |
providerList.prepend(i); |
|
Lines 172-178
Link Here
|
| 172 |
return caps; |
172 |
return caps; |
| 173 |
} |
173 |
} |
| 174 |
|
174 |
|
| 175 |
TQString QCA::arrayToHex(const TQByteArray &a) |
175 |
TQString TQCA::arrayToHex(const TQByteArray &a) |
| 176 |
{ |
176 |
{ |
| 177 |
TQString out; |
177 |
TQString out; |
| 178 |
for(int n = 0; n < (int)a.size(); ++n) { |
178 |
for(int n = 0; n < (int)a.size(); ++n) { |
|
Lines 183-189
Link Here
|
| 183 |
return out; |
183 |
return out; |
| 184 |
} |
184 |
} |
| 185 |
|
185 |
|
| 186 |
TQByteArray QCA::hexToArray(const TQString &str) |
186 |
TQByteArray TQCA::hexToArray(const TQString &str) |
| 187 |
{ |
187 |
{ |
| 188 |
TQByteArray out(str.length() / 2); |
188 |
TQByteArray out(str.length() / 2); |
| 189 |
int at = 0; |
189 |
int at = 0; |
|
Lines 196-202
Link Here
|
| 196 |
return out; |
196 |
return out; |
| 197 |
} |
197 |
} |
| 198 |
|
198 |
|
| 199 |
void QCA::init() |
199 |
void TQCA::init() |
| 200 |
{ |
200 |
{ |
| 201 |
if(qca_init) |
201 |
if(qca_init) |
| 202 |
return; |
202 |
return; |
|
Lines 204-210
Link Here
|
| 204 |
providerList.setAutoDelete(true); |
204 |
providerList.setAutoDelete(true); |
| 205 |
} |
205 |
} |
| 206 |
|
206 |
|
| 207 |
bool QCA::isSupported(int capabilities) |
207 |
bool TQCA::isSupported(int capabilities) |
| 208 |
{ |
208 |
{ |
| 209 |
init(); |
209 |
init(); |
| 210 |
|
210 |
|
|
Lines 221-232
Link Here
|
| 221 |
return false; |
221 |
return false; |
| 222 |
} |
222 |
} |
| 223 |
|
223 |
|
| 224 |
void QCA::insertProvider(QCAProvider *p) |
224 |
void TQCA::insertProvider(TQCAProvider *p) |
| 225 |
{ |
225 |
{ |
| 226 |
plugin_addClass(p); |
226 |
plugin_addClass(p); |
| 227 |
} |
227 |
} |
| 228 |
|
228 |
|
| 229 |
void QCA::unloadAllPlugins() |
229 |
void TQCA::unloadAllPlugins() |
| 230 |
{ |
230 |
{ |
| 231 |
plugin_unloadall(); |
231 |
plugin_unloadall(); |
| 232 |
} |
232 |
} |
|
Lines 236-242
Link Here
|
| 236 |
init(); |
236 |
init(); |
| 237 |
|
237 |
|
| 238 |
// this call will also trip a scan for new plugins if needed |
238 |
// this call will also trip a scan for new plugins if needed |
| 239 |
if(!QCA::isSupported(cap)) |
239 |
if(!TQCA::isSupported(cap)) |
| 240 |
return 0; |
240 |
return 0; |
| 241 |
|
241 |
|
| 242 |
TQPtrListIterator<ProviderItem> it(providerList); |
242 |
TQPtrListIterator<ProviderItem> it(providerList); |
|
Lines 271-280
Link Here
|
| 271 |
c->reset(); |
271 |
c->reset(); |
| 272 |
} |
272 |
} |
| 273 |
|
273 |
|
| 274 |
QCA_HashContext *c; |
274 |
TQCA_HashContext *c; |
| 275 |
}; |
275 |
}; |
| 276 |
|
276 |
|
| 277 |
Hash::Hash(QCA_HashContext *c) |
277 |
Hash::Hash(TQCA_HashContext *c) |
| 278 |
{ |
278 |
{ |
| 279 |
d = new Private; |
279 |
d = new Private; |
| 280 |
d->c = c; |
280 |
d->c = c; |
|
Lines 340-353
Link Here
|
| 340 |
err = false; |
340 |
err = false; |
| 341 |
} |
341 |
} |
| 342 |
|
342 |
|
| 343 |
QCA_CipherContext *c; |
343 |
TQCA_CipherContext *c; |
| 344 |
int dir; |
344 |
int dir; |
| 345 |
int mode; |
345 |
int mode; |
| 346 |
TQByteArray key, iv; |
346 |
TQByteArray key, iv; |
| 347 |
bool err; |
347 |
bool err; |
| 348 |
}; |
348 |
}; |
| 349 |
|
349 |
|
| 350 |
Cipher::Cipher(QCA_CipherContext *c, int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
350 |
Cipher::Cipher(TQCA_CipherContext *c, int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
| 351 |
{ |
351 |
{ |
| 352 |
d = new Private; |
352 |
d = new Private; |
| 353 |
d->c = c; |
353 |
d->c = c; |
|
Lines 447-453
Link Here
|
| 447 |
// SHA1 |
447 |
// SHA1 |
| 448 |
//---------------------------------------------------------------------------- |
448 |
//---------------------------------------------------------------------------- |
| 449 |
SHA1::SHA1() |
449 |
SHA1::SHA1() |
| 450 |
:Hash((QCA_HashContext *)getContext(CAP_SHA1)) |
450 |
:Hash((TQCA_HashContext *)getContext(CAP_SHA1)) |
| 451 |
{ |
451 |
{ |
| 452 |
} |
452 |
} |
| 453 |
|
453 |
|
|
Lines 456-462
Link Here
|
| 456 |
// SHA256 |
456 |
// SHA256 |
| 457 |
//---------------------------------------------------------------------------- |
457 |
//---------------------------------------------------------------------------- |
| 458 |
SHA256::SHA256() |
458 |
SHA256::SHA256() |
| 459 |
:Hash((QCA_HashContext *)getContext(CAP_SHA256)) |
459 |
:Hash((TQCA_HashContext *)getContext(CAP_SHA256)) |
| 460 |
{ |
460 |
{ |
| 461 |
} |
461 |
} |
| 462 |
|
462 |
|
|
Lines 465-471
Link Here
|
| 465 |
// MD5 |
465 |
// MD5 |
| 466 |
//---------------------------------------------------------------------------- |
466 |
//---------------------------------------------------------------------------- |
| 467 |
MD5::MD5() |
467 |
MD5::MD5() |
| 468 |
:Hash((QCA_HashContext *)getContext(CAP_MD5)) |
468 |
:Hash((TQCA_HashContext *)getContext(CAP_MD5)) |
| 469 |
{ |
469 |
{ |
| 470 |
} |
470 |
} |
| 471 |
|
471 |
|
|
Lines 474-480
Link Here
|
| 474 |
// BlowFish |
474 |
// BlowFish |
| 475 |
//---------------------------------------------------------------------------- |
475 |
//---------------------------------------------------------------------------- |
| 476 |
BlowFish::BlowFish(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
476 |
BlowFish::BlowFish(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
| 477 |
:Cipher((QCA_CipherContext *)getContext(CAP_BlowFish), dir, mode, key, iv, pad) |
477 |
:Cipher((TQCA_CipherContext *)getContext(CAP_BlowFish), dir, mode, key, iv, pad) |
| 478 |
{ |
478 |
{ |
| 479 |
} |
479 |
} |
| 480 |
|
480 |
|
|
Lines 483-489
Link Here
|
| 483 |
// TripleDES |
483 |
// TripleDES |
| 484 |
//---------------------------------------------------------------------------- |
484 |
//---------------------------------------------------------------------------- |
| 485 |
TripleDES::TripleDES(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
485 |
TripleDES::TripleDES(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
| 486 |
:Cipher((QCA_CipherContext *)getContext(CAP_TripleDES), dir, mode, key, iv, pad) |
486 |
:Cipher((TQCA_CipherContext *)getContext(CAP_TripleDES), dir, mode, key, iv, pad) |
| 487 |
{ |
487 |
{ |
| 488 |
} |
488 |
} |
| 489 |
|
489 |
|
|
Lines 492-498
Link Here
|
| 492 |
// AES128 |
492 |
// AES128 |
| 493 |
//---------------------------------------------------------------------------- |
493 |
//---------------------------------------------------------------------------- |
| 494 |
AES128::AES128(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
494 |
AES128::AES128(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
| 495 |
:Cipher((QCA_CipherContext *)getContext(CAP_AES128), dir, mode, key, iv, pad) |
495 |
:Cipher((TQCA_CipherContext *)getContext(CAP_AES128), dir, mode, key, iv, pad) |
| 496 |
{ |
496 |
{ |
| 497 |
} |
497 |
} |
| 498 |
|
498 |
|
|
Lines 501-507
Link Here
|
| 501 |
// AES256 |
501 |
// AES256 |
| 502 |
//---------------------------------------------------------------------------- |
502 |
//---------------------------------------------------------------------------- |
| 503 |
AES256::AES256(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
503 |
AES256::AES256(int dir, int mode, const TQByteArray &key, const TQByteArray &iv, bool pad) |
| 504 |
:Cipher((QCA_CipherContext *)getContext(CAP_AES256), dir, mode, key, iv, pad) |
504 |
:Cipher((TQCA_CipherContext *)getContext(CAP_AES256), dir, mode, key, iv, pad) |
| 505 |
{ |
505 |
{ |
| 506 |
} |
506 |
} |
| 507 |
|
507 |
|
|
Lines 522-534
Link Here
|
| 522 |
delete c; |
522 |
delete c; |
| 523 |
} |
523 |
} |
| 524 |
|
524 |
|
| 525 |
QCA_RSAKeyContext *c; |
525 |
TQCA_RSAKeyContext *c; |
| 526 |
}; |
526 |
}; |
| 527 |
|
527 |
|
| 528 |
RSAKey::RSAKey() |
528 |
RSAKey::RSAKey() |
| 529 |
{ |
529 |
{ |
| 530 |
d = new Private; |
530 |
d = new Private; |
| 531 |
d->c = (QCA_RSAKeyContext *)getContext(CAP_RSA); |
531 |
d->c = (TQCA_RSAKeyContext *)getContext(CAP_RSA); |
| 532 |
} |
532 |
} |
| 533 |
|
533 |
|
| 534 |
RSAKey::RSAKey(const RSAKey &from) |
534 |
RSAKey::RSAKey(const RSAKey &from) |
|
Lines 685-698
Link Here
|
| 685 |
delete c; |
685 |
delete c; |
| 686 |
} |
686 |
} |
| 687 |
|
687 |
|
| 688 |
QCA_CertContext *c; |
688 |
TQCA_CertContext *c; |
| 689 |
}; |
689 |
}; |
| 690 |
|
690 |
|
| 691 |
Cert::Cert() |
691 |
Cert::Cert() |
| 692 |
{ |
692 |
{ |
| 693 |
d = new Private; |
693 |
d = new Private; |
| 694 |
// crash because this is returning 0 |
694 |
// crash because this is returning 0 |
| 695 |
d->c = (QCA_CertContext *)getContext(CAP_X509); |
695 |
d->c = (TQCA_CertContext *)getContext(CAP_X509); |
| 696 |
} |
696 |
} |
| 697 |
|
697 |
|
| 698 |
Cert::Cert(const Cert &from) |
698 |
Cert::Cert(const Cert &from) |
|
Lines 716-722
Link Here
|
| 716 |
delete d; |
716 |
delete d; |
| 717 |
} |
717 |
} |
| 718 |
|
718 |
|
| 719 |
void Cert::fromContext(QCA_CertContext *ctx) |
719 |
void Cert::fromContext(TQCA_CertContext *ctx) |
| 720 |
{ |
720 |
{ |
| 721 |
delete d->c; |
721 |
delete d->c; |
| 722 |
d->c = ctx; |
722 |
d->c = ctx; |
|
Lines 750-767
Link Here
|
| 750 |
|
750 |
|
| 751 |
CertProperties Cert::subject() const |
751 |
CertProperties Cert::subject() const |
| 752 |
{ |
752 |
{ |
| 753 |
TQValueList<QCA_CertProperty> list = d->c->subject(); |
753 |
TQValueList<TQCA_CertProperty> list = d->c->subject(); |
| 754 |
CertProperties props; |
754 |
CertProperties props; |
| 755 |
for(TQValueList<QCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it) |
755 |
for(TQValueList<TQCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it) |
| 756 |
props[(*it).var] = (*it).val; |
756 |
props[(*it).var] = (*it).val; |
| 757 |
return props; |
757 |
return props; |
| 758 |
} |
758 |
} |
| 759 |
|
759 |
|
| 760 |
CertProperties Cert::issuer() const |
760 |
CertProperties Cert::issuer() const |
| 761 |
{ |
761 |
{ |
| 762 |
TQValueList<QCA_CertProperty> list = d->c->issuer(); |
762 |
TQValueList<TQCA_CertProperty> list = d->c->issuer(); |
| 763 |
CertProperties props; |
763 |
CertProperties props; |
| 764 |
for(TQValueList<QCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it) |
764 |
for(TQValueList<TQCA_CertProperty>::ConstIterator it = list.begin(); it != list.end(); ++it) |
| 765 |
props[(*it).var] = (*it).val; |
765 |
props[(*it).var] = (*it).val; |
| 766 |
return props; |
766 |
return props; |
| 767 |
} |
767 |
} |
|
Lines 818-824
Link Here
|
| 818 |
public: |
818 |
public: |
| 819 |
Private() |
819 |
Private() |
| 820 |
{ |
820 |
{ |
| 821 |
c = (QCA_TLSContext *)getContext(CAP_TLS); |
821 |
c = (TQCA_TLSContext *)getContext(CAP_TLS); |
| 822 |
} |
822 |
} |
| 823 |
|
823 |
|
| 824 |
~Private() |
824 |
~Private() |
|
Lines 850-856
Link Here
|
| 850 |
} |
850 |
} |
| 851 |
|
851 |
|
| 852 |
Cert cert; |
852 |
Cert cert; |
| 853 |
QCA_TLSContext *c; |
853 |
TQCA_TLSContext *c; |
| 854 |
TQByteArray in, out, to_net, from_net; |
854 |
TQByteArray in, out, to_net, from_net; |
| 855 |
int bytesEncoded; |
855 |
int bytesEncoded; |
| 856 |
bool tryMore; |
856 |
bool tryMore; |
|
Lines 861-867
Link Here
|
| 861 |
|
861 |
|
| 862 |
Cert ourCert; |
862 |
Cert ourCert; |
| 863 |
RSAKey ourKey; |
863 |
RSAKey ourKey; |
| 864 |
TQPtrList<QCA_CertContext> store; |
864 |
TQPtrList<TQCA_CertContext> store; |
| 865 |
}; |
865 |
}; |
| 866 |
|
866 |
|
| 867 |
TLS::TLS(TQObject *parent) |
867 |
TLS::TLS(TQObject *parent) |
|
Lines 971-977
Link Here
|
| 971 |
int TLS::certificateValidityResult() const |
971 |
int TLS::certificateValidityResult() const |
| 972 |
{ |
972 |
{ |
| 973 |
if(d->hostMismatch) |
973 |
if(d->hostMismatch) |
| 974 |
return QCA::TLS::HostMismatch; |
974 |
return TQCA::TLS::HostMismatch; |
| 975 |
else |
975 |
else |
| 976 |
return d->c->validityResult(); |
976 |
return d->c->validityResult(); |
| 977 |
} |
977 |
} |
|
Lines 987-998
Link Here
|
| 987 |
TQByteArray a; |
987 |
TQByteArray a; |
| 988 |
int r = d->c->shutdown(d->from_net, &a); |
988 |
int r = d->c->shutdown(d->from_net, &a); |
| 989 |
d->from_net.resize(0); |
989 |
d->from_net.resize(0); |
| 990 |
if(r == QCA_TLSContext::Error) { |
990 |
if(r == TQCA_TLSContext::Error) { |
| 991 |
reset(); |
991 |
reset(); |
| 992 |
error(ErrHandshake); |
992 |
error(ErrHandshake); |
| 993 |
return; |
993 |
return; |
| 994 |
} |
994 |
} |
| 995 |
if(r == QCA_TLSContext::Success) { |
995 |
if(r == TQCA_TLSContext::Success) { |
| 996 |
d->from_net = d->c->unprocessed().copy(); |
996 |
d->from_net = d->c->unprocessed().copy(); |
| 997 |
done = true; |
997 |
done = true; |
| 998 |
} |
998 |
} |
|
Lines 1003-1017
Link Here
|
| 1003 |
TQByteArray a; |
1003 |
TQByteArray a; |
| 1004 |
int r = d->c->handshake(d->from_net, &a); |
1004 |
int r = d->c->handshake(d->from_net, &a); |
| 1005 |
d->from_net.resize(0); |
1005 |
d->from_net.resize(0); |
| 1006 |
if(r == QCA_TLSContext::Error) { |
1006 |
if(r == TQCA_TLSContext::Error) { |
| 1007 |
reset(); |
1007 |
reset(); |
| 1008 |
error(ErrHandshake); |
1008 |
error(ErrHandshake); |
| 1009 |
return; |
1009 |
return; |
| 1010 |
} |
1010 |
} |
| 1011 |
d->appendArray(&d->to_net, a); |
1011 |
d->appendArray(&d->to_net, a); |
| 1012 |
if(r == QCA_TLSContext::Success) { |
1012 |
if(r == TQCA_TLSContext::Success) { |
| 1013 |
QCA_CertContext *cc = d->c->peerCertificate(); |
1013 |
TQCA_CertContext *cc = d->c->peerCertificate(); |
| 1014 |
if(cc && !d->host.isEmpty() && d->c->validityResult() == QCA::TLS::Valid) { |
1014 |
if(cc && !d->host.isEmpty() && d->c->validityResult() == TQCA::TLS::Valid) { |
| 1015 |
if(!cc->matchesAddress(d->host)) |
1015 |
if(!cc->matchesAddress(d->host)) |
| 1016 |
d->hostMismatch = true; |
1016 |
d->hostMismatch = true; |
| 1017 |
} |
1017 |
} |
|
Lines 1102-1108
Link Here
|
| 1102 |
public: |
1102 |
public: |
| 1103 |
Private() |
1103 |
Private() |
| 1104 |
{ |
1104 |
{ |
| 1105 |
c = (QCA_SASLContext *)getContext(CAP_SASL); |
1105 |
c = (TQCA_SASLContext *)getContext(CAP_SASL); |
| 1106 |
} |
1106 |
} |
| 1107 |
|
1107 |
|
| 1108 |
~Private() |
1108 |
~Private() |
|
Lines 1122-1128
Link Here
|
| 1122 |
int ext_ssf; |
1122 |
int ext_ssf; |
| 1123 |
|
1123 |
|
| 1124 |
bool tried; |
1124 |
bool tried; |
| 1125 |
QCA_SASLContext *c; |
1125 |
TQCA_SASLContext *c; |
| 1126 |
TQHostAddress localAddr, remoteAddr; |
1126 |
TQHostAddress localAddr, remoteAddr; |
| 1127 |
int localPort, remotePort; |
1127 |
int localPort, remotePort; |
| 1128 |
TQByteArray stepData; |
1128 |
TQByteArray stepData; |
|
Lines 1246-1252
Link Here
|
| 1246 |
|
1246 |
|
| 1247 |
bool SASL::startClient(const TQString &service, const TQString &host, const TQStringList &mechlist, bool allowClientSendFirst) |
1247 |
bool SASL::startClient(const TQString &service, const TQString &host, const TQStringList &mechlist, bool allowClientSendFirst) |
| 1248 |
{ |
1248 |
{ |
| 1249 |
QCA_SASLHostPort la, ra; |
1249 |
TQCA_SASLHostPort la, ra; |
| 1250 |
if(d->localPort != -1) { |
1250 |
if(d->localPort != -1) { |
| 1251 |
la.addr = d->localAddr; |
1251 |
la.addr = d->localAddr; |
| 1252 |
la.port = d->localPort; |
1252 |
la.port = d->localPort; |
|
Lines 1271-1277
Link Here
|
| 1271 |
|
1271 |
|
| 1272 |
bool SASL::startServer(const TQString &service, const TQString &host, const TQString &realm, TQStringList *mechlist) |
1272 |
bool SASL::startServer(const TQString &service, const TQString &host, const TQString &realm, TQStringList *mechlist) |
| 1273 |
{ |
1273 |
{ |
| 1274 |
QCA_SASLHostPort la, ra; |
1274 |
TQCA_SASLHostPort la, ra; |
| 1275 |
if(d->localPort != -1) { |
1275 |
if(d->localPort != -1) { |
| 1276 |
la.addr = d->localAddr; |
1276 |
la.addr = d->localAddr; |
| 1277 |
la.port = d->localPort; |
1277 |
la.port = d->localPort; |
|
Lines 1306-1316
Link Here
|
| 1306 |
|
1306 |
|
| 1307 |
void SASL::handleServerFirstStep(int r) |
1307 |
void SASL::handleServerFirstStep(int r) |
| 1308 |
{ |
1308 |
{ |
| 1309 |
if(r == QCA_SASLContext::Success) |
1309 |
if(r == TQCA_SASLContext::Success) |
| 1310 |
authenticated(); |
1310 |
authenticated(); |
| 1311 |
else if(r == QCA_SASLContext::Continue) |
1311 |
else if(r == TQCA_SASLContext::Continue) |
| 1312 |
nextStep(d->c->result()); |
1312 |
nextStep(d->c->result()); |
| 1313 |
else if(r == QCA_SASLContext::AuthCheck) |
1313 |
else if(r == TQCA_SASLContext::AuthCheck) |
| 1314 |
tryAgain(); |
1314 |
tryAgain(); |
| 1315 |
else |
1315 |
else |
| 1316 |
error(ErrAuth); |
1316 |
error(ErrAuth); |
|
Lines 1365-1380
Link Here
|
| 1365 |
r = d->c->tryAgain(); |
1365 |
r = d->c->tryAgain(); |
| 1366 |
} |
1366 |
} |
| 1367 |
|
1367 |
|
| 1368 |
if(r == QCA_SASLContext::Error) { |
1368 |
if(r == TQCA_SASLContext::Error) { |
| 1369 |
error(ErrAuth); |
1369 |
error(ErrAuth); |
| 1370 |
return; |
1370 |
return; |
| 1371 |
} |
1371 |
} |
| 1372 |
else if(r == QCA_SASLContext::Continue) { |
1372 |
else if(r == TQCA_SASLContext::Continue) { |
| 1373 |
d->tried = false; |
1373 |
d->tried = false; |
| 1374 |
nextStep(d->c->result()); |
1374 |
nextStep(d->c->result()); |
| 1375 |
return; |
1375 |
return; |
| 1376 |
} |
1376 |
} |
| 1377 |
else if(r == QCA_SASLContext::AuthCheck) { |
1377 |
else if(r == TQCA_SASLContext::AuthCheck) { |
| 1378 |
authCheck(d->c->username(), d->c->authzid()); |
1378 |
authCheck(d->c->username(), d->c->authzid()); |
| 1379 |
return; |
1379 |
return; |
| 1380 |
} |
1380 |
} |
|
Lines 1388-1400
Link Here
|
| 1388 |
else |
1388 |
else |
| 1389 |
r = d->c->tryAgain(); |
1389 |
r = d->c->tryAgain(); |
| 1390 |
|
1390 |
|
| 1391 |
if(r == QCA_SASLContext::Error) { |
1391 |
if(r == TQCA_SASLContext::Error) { |
| 1392 |
error(ErrAuth); |
1392 |
error(ErrAuth); |
| 1393 |
return; |
1393 |
return; |
| 1394 |
} |
1394 |
} |
| 1395 |
else if(r == QCA_SASLContext::NeedParams) { |
1395 |
else if(r == TQCA_SASLContext::NeedParams) { |
| 1396 |
//d->tried = false; |
1396 |
//d->tried = false; |
| 1397 |
QCA_SASLNeedParams np = d->c->clientParamsNeeded(); |
1397 |
TQCA_SASLNeedParams np = d->c->clientParamsNeeded(); |
| 1398 |
needParams(np.user, np.authzid, np.pass, np.realm); |
1398 |
needParams(np.user, np.authzid, np.pass, np.realm); |
| 1399 |
return; |
1399 |
return; |
| 1400 |
} |
1400 |
} |
|
Lines 1414-1440
Link Here
|
| 1414 |
else |
1414 |
else |
| 1415 |
r = d->c->tryAgain(); |
1415 |
r = d->c->tryAgain(); |
| 1416 |
|
1416 |
|
| 1417 |
if(r == QCA_SASLContext::Error) { |
1417 |
if(r == TQCA_SASLContext::Error) { |
| 1418 |
error(ErrAuth); |
1418 |
error(ErrAuth); |
| 1419 |
return; |
1419 |
return; |
| 1420 |
} |
1420 |
} |
| 1421 |
else if(r == QCA_SASLContext::NeedParams) { |
1421 |
else if(r == TQCA_SASLContext::NeedParams) { |
| 1422 |
//d->tried = false; |
1422 |
//d->tried = false; |
| 1423 |
QCA_SASLNeedParams np = d->c->clientParamsNeeded(); |
1423 |
TQCA_SASLNeedParams np = d->c->clientParamsNeeded(); |
| 1424 |
needParams(np.user, np.authzid, np.pass, np.realm); |
1424 |
needParams(np.user, np.authzid, np.pass, np.realm); |
| 1425 |
return; |
1425 |
return; |
| 1426 |
} |
1426 |
} |
| 1427 |
d->tried = false; |
1427 |
d->tried = false; |
| 1428 |
//else if(r == QCA_SASLContext::Continue) { |
1428 |
//else if(r == TQCA_SASLContext::Continue) { |
| 1429 |
nextStep(d->c->result()); |
1429 |
nextStep(d->c->result()); |
| 1430 |
// return; |
1430 |
// return; |
| 1431 |
//} |
1431 |
//} |
| 1432 |
} |
1432 |
} |
| 1433 |
} |
1433 |
} |
| 1434 |
|
1434 |
|
| 1435 |
if(r == QCA_SASLContext::Success) |
1435 |
if(r == TQCA_SASLContext::Success) |
| 1436 |
authenticated(); |
1436 |
authenticated(); |
| 1437 |
else if(r == QCA_SASLContext::Error) |
1437 |
else if(r == TQCA_SASLContext::Error) |
| 1438 |
error(ErrAuth); |
1438 |
error(ErrAuth); |
| 1439 |
} |
1439 |
} |
| 1440 |
|
1440 |
|