summaryrefslogtreecommitdiffstats
path: root/src/ciscopasswddecoder.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2011-12-06 14:15:01 -0600
committerTimothy Pearson <[email protected]>2011-12-06 14:15:01 -0600
commit1b89319fd93b88313cab40f1e9de24c067b04efb (patch)
tree80132996de993c3dcab4040864d7729842875b2d /src/ciscopasswddecoder.cpp
parentd08a0ede1d2cb15bb14b0ff75eacf5c682b1fa0a (diff)
downloadkvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.tar.gz
kvpnc-1b89319fd93b88313cab40f1e9de24c067b04efb.zip
Initial TQt conversion
Diffstat (limited to 'src/ciscopasswddecoder.cpp')
-rw-r--r--src/ciscopasswddecoder.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/ciscopasswddecoder.cpp b/src/ciscopasswddecoder.cpp
index f4d98bb..3529373 100644
--- a/src/ciscopasswddecoder.cpp
+++ b/src/ciscopasswddecoder.cpp
@@ -20,12 +20,12 @@
�***************************************************************************/
#include "ciscopasswddecoder.h"
-#include <qfile.h>
-#include <qtextstream.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
#include <kmessagebox.h>
#include <klocale.h>
-CiscoPasswdDecoder::CiscoPasswdDecoder(QString& profileFile)
+CiscoPasswdDecoder::CiscoPasswdDecoder(TQString& profileFile)
{
profile = profileFile;
}
@@ -34,14 +34,14 @@ CiscoPasswdDecoder::~CiscoPasswdDecoder()
{}
/* read hex strings for "enc_GroupPwd" and "enc_UserPassword" from profile file */
-void CiscoPasswdDecoder::readProfileData(QString& profile, QString& userData, QString& groupData)
+void CiscoPasswdDecoder::readProfileData(TQString& profile, TQString& userData, TQString& groupData)
{
- QFile PcfFile(profile);
- QTextStream stream ( &PcfFile );
+ TQFile PcfFile(profile);
+ TQTextStream stream ( &PcfFile );
if ( PcfFile.open(IO_ReadOnly))
{
- QString line = "";
+ TQString line = "";
while ( !stream.atEnd() )
{
line = stream.readLine(); // line of text excluding '\n' and replace all white chars with one blank
@@ -72,13 +72,13 @@ int CiscoPasswdDecoder::hex2bin_c(unsigned int c)
return -1;
}
-int CiscoPasswdDecoder::hex2bin(QString str, QString& bin, int& len)
+int CiscoPasswdDecoder::hex2bin(TQString str, TQString& bin, int& len)
{
-QString p;
+TQString p;
int i, l;
for (i = 0; str[i] != '\0'; i++)
- if (hex2bin_c(QChar(str[i]).unicode()) == -1)
+ if (hex2bin_c(TQChar(str[i]).tqunicode()) == -1)
return EINVAL;
l = i;
@@ -87,7 +87,7 @@ QString p;
l /= 2;
for (i = 0; i < l; i++)
- p+= hex2bin_c(QChar(str[i*2]).unicode()) << 4 | hex2bin_c(QChar(str[i*2+1]).unicode());
+ p+= hex2bin_c(TQChar(str[i*2]).tqunicode()) << 4 | hex2bin_c(TQChar(str[i*2+1]).tqunicode());
bin = p;
if (len)
@@ -96,9 +96,9 @@ QString p;
return 0;
}
-int CiscoPasswdDecoder::c_decrypt(QString ct, int len, char **resp, int reslenp)
+int CiscoPasswdDecoder::c_decrypt(TQString ct, int len, char **resp, int reslenp)
{
- QString h1 = ct;
+ TQString h1 = ct;
const char *h4 = ct.ascii() + 20;
const char *enc = ct.ascii() + 40;
@@ -149,13 +149,13 @@ int CiscoPasswdDecoder::c_decrypt(QString ct, int len, char **resp, int reslenp)
return 0;
}
-bool CiscoPasswdDecoder::decodePasswords(QString& userPasswd, QString& groupPasswd)
+bool CiscoPasswdDecoder::decodePasswords(TQString& userPasswd, TQString& groupPasswd)
{
- QString encUserPasswd="";
- QString encGroupPasswd="";
+ TQString encUserPasswd="";
+ TQString encGroupPasswd="";
int i, len, ret = 0;
char *pw, *pw2;
- QString bin,bin2;
+ TQString bin,bin2;
int len2=0;
bool success=true;
@@ -182,10 +182,10 @@ bool CiscoPasswdDecoder::decodePasswords(QString& userPasswd, QString& groupPass
else
{
// printf("groupPasswd: %s\n", pw);
-// std::cout << "groupPasswd: " << QString::fromLocal8Bit(pw) << std::endl;
+// std::cout << "groupPasswd: " << TQString::fromLocal8Bit(pw) << std::endl;
- groupPasswd = QString::fromLocal8Bit(pw);
+ groupPasswd = TQString::fromLocal8Bit(pw);
//free(pw);
}
}
@@ -212,8 +212,8 @@ bool CiscoPasswdDecoder::decodePasswords(QString& userPasswd, QString& groupPass
{
// // printf("userPasswd: %s\n", pw2);
-// std::cout << "userPasswd " << QString::fromLocal8Bit(pw2) << std::endl;
- userPasswd = QString::fromLocal8Bit(pw2);
+// std::cout << "userPasswd " << TQString::fromLocal8Bit(pw2) << std::endl;
+ userPasswd = TQString::fromLocal8Bit(pw2);
//free(pw);