diff options
Diffstat (limited to 'kio/misc/kntlm')
-rw-r--r-- | kio/misc/kntlm/kntlm.cpp | 38 | ||||
-rw-r--r-- | kio/misc/kntlm/kntlm.h | 4 |
2 files changed, 21 insertions, 21 deletions
diff --git a/kio/misc/kntlm/kntlm.cpp b/kio/misc/kntlm/kntlm.cpp index db2b45b6c..9af382483 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 tqunicode ) +TQString KNTLM::getString( const TQByteArray &buf, const SecBuf &secbuf, bool unicode ) { //watch for buffer overflows TQ_UINT32 offset; @@ -45,10 +45,10 @@ TQString KNTLM::getString( const TQByteArray &buf, const SecBuf &secbuf, bool tq TQString str; const char *c = buf.data() + offset; - if ( tqunicode ) { + if ( unicode ) { str = UnicodeLE2TQString( (TQChar*) c, len >> 1 ); } else { - str = TQString::tqfromLatin1( c, len ); + str = TQString::fromLatin1( 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 tqunicode ) +void KNTLM::addString( TQByteArray &buf, SecBuf &secbuf, const TQString &str, bool unicode ) { TQByteArray tmp; - if ( tqunicode ) { + if ( unicode ) { 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 tqunicode = false; + bool unicode = false; TQString dom; //challenge structure too small if ( chsize < 32 ) return false; - tqunicode = KFromToLittleEndian(ch->flags) & Negotiate_Unicode; + unicode = KFromToLittleEndian(ch->flags) & Negotiate_Unicode; if ( domain.isEmpty() ) - dom = getString( challenge, ch->targetName, tqunicode ); + dom = getString( challenge, ch->targetName, unicode ); 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, tqunicode ); - addString( rbuf, ((Auth*) rbuf.data())->user, user, tqunicode ); + addString( rbuf, ((Auth*) rbuf.data())->domain, dom, unicode ); + addString( rbuf, ((Auth*) rbuf.data())->user, user, unicode ); if ( !workstation.isEmpty() ) - addString( rbuf, ((Auth*) rbuf.data())->workstation, workstation, tqunicode ); + addString( rbuf, ((Auth*) rbuf.data())->workstation, workstation, unicode ); 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, tqunicode; - tqunicode = QString2UnicodeLE( password ); + TQByteArray ret, unicode; + unicode = QString2UnicodeLE( password ); - KMD4 md4( tqunicode ); + KMD4 md4( unicode ); 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::tqcurrentDateTime().toTime_t(); + TQ_UINT64 now = TQDateTime::currentDateTime().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 tqunicode( target.length() * 2 ); + TQByteArray unicode( target.length() * 2 ); for ( uint i = 0; i < target.length(); i++ ) { - ((TQ_UINT16*)tqunicode.data())[ i ] = KFromToLittleEndian( target[i].tqunicode() ); + ((TQ_UINT16*)unicode.data())[ i ] = KFromToLittleEndian( target[i].unicode() ); } - return tqunicode; + return unicode; } TQString KNTLM::UnicodeLE2TQString( const TQChar* data, uint len ) { TQString ret; for ( uint i = 0; i < len; i++ ) { - ret += KFromToLittleEndian( data[ i ].tqunicode() ); + ret += KFromToLittleEndian( data[ i ].unicode() ); } return ret; } diff --git a/kio/misc/kntlm/kntlm.h b/kio/misc/kntlm/kntlm.h index 2be0a00af..462624fcd 100644 --- a/kio/misc/kntlm/kntlm.h +++ b/kio/misc/kntlm/kntlm.h @@ -212,7 +212,7 @@ public: /** * Extracts a string field from an NTLM structure. */ - static TQString getString( const TQByteArray &buf, const SecBuf &secbuf, bool tqunicode ); + static TQString getString( const TQByteArray &buf, const SecBuf &secbuf, bool unicode ); /** * Extracts a byte array from an NTLM structure. */ @@ -226,7 +226,7 @@ private: static TQString UnicodeLE2TQString( const TQChar* data, uint len ); static void addBuf( TQByteArray &buf, SecBuf &secbuf, TQByteArray &data ); - static void addString( TQByteArray &buf, SecBuf &secbuf, const TQString &str, bool tqunicode = false ); + static void addString( TQByteArray &buf, SecBuf &secbuf, const TQString &str, bool unicode = false ); static void convertKey( unsigned char *key_56, void* ks ); }; |