diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 09:59:13 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 09:59:13 -0600 |
commit | 56160bf4dfe503631ef6373367b281f081bab2b4 (patch) | |
tree | 7fcea2ffd9c3420af999c3dcad0ed032eef93956 /kio/misc/kntlm/kntlm.cpp | |
parent | 13281e2856a2ef43bbab78c5528470309c23aa77 (diff) | |
download | tdelibs-56160bf4dfe503631ef6373367b281f081bab2b4.tar.gz tdelibs-56160bf4dfe503631ef6373367b281f081bab2b4.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit 13281e2856a2ef43bbab78c5528470309c23aa77.
Diffstat (limited to 'kio/misc/kntlm/kntlm.cpp')
-rw-r--r-- | kio/misc/kntlm/kntlm.cpp | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/kio/misc/kntlm/kntlm.cpp b/kio/misc/kntlm/kntlm.cpp index 9af382483..db2b45b6c 100644 --- a/kio/misc/kntlm/kntlm.cpp +++ b/kio/misc/kntlm/kntlm.cpp @@ -32,7 +32,7 @@ #include "des.h" #include "kntlm.h" -TQString KNTLM::getString( const TQByteArray &buf, const SecBuf &secbuf, bool unicode ) +TQString KNTLM::getString( const TQByteArray &buf, const SecBuf &secbuf, bool tqunicode ) { //watch for buffer overflows TQ_UINT32 offset; @@ -45,10 +45,10 @@ TQString KNTLM::getString( const TQByteArray &buf, const SecBuf &secbuf, bool un TQString str; const char *c = buf.data() + offset; - if ( unicode ) { + if ( tqunicode ) { str = UnicodeLE2TQString( (TQChar*) c, len >> 1 ); } else { - str = TQString::fromLatin1( c, len ); + str = TQString::tqfromLatin1( c, len ); } return str; } @@ -67,11 +67,11 @@ TQByteArray KNTLM::getBuf( const TQByteArray &buf, const SecBuf &secbuf ) return ret; } -void KNTLM::addString( TQByteArray &buf, SecBuf &secbuf, const TQString &str, bool unicode ) +void KNTLM::addString( TQByteArray &buf, SecBuf &secbuf, const TQString &str, bool tqunicode ) { TQByteArray tmp; - if ( unicode ) { + if ( tqunicode ) { tmp = QString2UnicodeLE( str ); addBuf( buf, secbuf, tmp ); } else { @@ -126,15 +126,15 @@ bool KNTLM::getAuth( TQByteArray &auth, const TQByteArray &challenge, const TQSt Challenge *ch = (Challenge *) challenge.data(); TQByteArray response; uint chsize = challenge.size(); - bool unicode = false; + bool tqunicode = false; TQString dom; //challenge structure too small if ( chsize < 32 ) return false; - unicode = KFromToLittleEndian(ch->flags) & Negotiate_Unicode; + tqunicode = KFromToLittleEndian(ch->flags) & Negotiate_Unicode; if ( domain.isEmpty() ) - dom = getString( challenge, ch->targetName, unicode ); + dom = getString( challenge, ch->targetName, tqunicode ); else dom = domain; @@ -164,10 +164,10 @@ bool KNTLM::getAuth( TQByteArray &auth, const TQByteArray &challenge, const TQSt addBuf( rbuf, ((Auth*) rbuf.data())->lmResponse, response ); // } if ( !dom.isEmpty() ) - addString( rbuf, ((Auth*) rbuf.data())->domain, dom, unicode ); - addString( rbuf, ((Auth*) rbuf.data())->user, user, unicode ); + addString( rbuf, ((Auth*) rbuf.data())->domain, dom, tqunicode ); + addString( rbuf, ((Auth*) rbuf.data())->user, user, tqunicode ); if ( !workstation.isEmpty() ) - addString( rbuf, ((Auth*) rbuf.data())->workstation, workstation, unicode ); + addString( rbuf, ((Auth*) rbuf.data())->workstation, workstation, tqunicode ); auth = rbuf; @@ -241,10 +241,10 @@ TQByteArray KNTLM::getNTLMResponse( const TQString &password, const unsigned cha TQByteArray KNTLM::ntlmHash( const TQString &password ) { KMD4::Digest digest; - TQByteArray ret, unicode; - unicode = QString2UnicodeLE( password ); + TQByteArray ret, tqunicode; + tqunicode = QString2UnicodeLE( password ); - KMD4 md4( unicode ); + KMD4 md4( tqunicode ); md4.rawDigest( digest ); ret.duplicate( (const char*) digest, sizeof( digest ) ); return ret; @@ -299,7 +299,7 @@ TQByteArray KNTLM::createBlob( const TQByteArray &targetinfo ) Blob *bl = (Blob *) blob.data(); bl->signature = KFromToBigEndian( (TQ_UINT32) 0x01010000 ); - TQ_UINT64 now = TQDateTime::currentDateTime().toTime_t(); + TQ_UINT64 now = TQDateTime::tqcurrentDateTime().toTime_t(); now += (TQ_UINT64)3600*(TQ_UINT64)24*(TQ_UINT64)134774; now *= (TQ_UINT64)10000000; bl->timestamp = KFromToLittleEndian( now ); @@ -372,18 +372,18 @@ void KNTLM::convertKey( unsigned char *key_56, void* ks ) TQByteArray KNTLM::QString2UnicodeLE( const TQString &target ) { - TQByteArray unicode( target.length() * 2 ); + TQByteArray tqunicode( target.length() * 2 ); for ( uint i = 0; i < target.length(); i++ ) { - ((TQ_UINT16*)unicode.data())[ i ] = KFromToLittleEndian( target[i].unicode() ); + ((TQ_UINT16*)tqunicode.data())[ i ] = KFromToLittleEndian( target[i].tqunicode() ); } - return unicode; + return tqunicode; } TQString KNTLM::UnicodeLE2TQString( const TQChar* data, uint len ) { TQString ret; for ( uint i = 0; i < len; i++ ) { - ret += KFromToLittleEndian( data[ i ].unicode() ); + ret += KFromToLittleEndian( data[ i ].tqunicode() ); } return ret; } |