diff options
Diffstat (limited to 'src/crypto.cpp')
-rw-r--r-- | src/crypto.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/crypto.cpp b/src/crypto.cpp index a47e19d..cd38be1 100644 --- a/src/crypto.cpp +++ b/src/crypto.cpp @@ -79,7 +79,7 @@ #define ADD_ENTROPY 32 -typedef QMap<QString, QString> servermap; +typedef TQMap<TQString, TQString> servermap; servermap serverTofp_identity; servermap fp_identityToServer; @@ -99,19 +99,19 @@ void clearServers() fp_identityToServer.clear(); } -QString fp_identity(const QString &server) +TQString fp_identity(const TQString &server) { return serverTofp_identity[server]; } -QString server(const QString &fp_identity) +TQString server(const TQString &fp_identity) { return fp_identityToServer[fp_identity]; } -void storeServer(const QString &server,const QString &fp_identity) +void storeServer(const TQString &server,const TQString &fp_identity) { serverTofp_identity[server] = fp_identity; @@ -121,11 +121,11 @@ void storeServer(const QString &server,const QString &fp_identity) -QString getFPDigestFromFP(const QString &fp) +TQString getFPDigestFromFP(const TQString &fp) { char identity64[BASE64_DIGEST_LEN+1]; char digest[DIGEST_LEN]; - QString FP = fp; + TQString FP = fp; FP.replace("$",""); base16_decode(digest, DIGEST_LEN, FP, strlen(FP)); @@ -133,38 +133,38 @@ QString getFPDigestFromFP(const QString &fp) return identity64; } -QString getNickNameFromFPDigest(const QString &fpdigest) +TQString getNickNameFromFPDigest(const TQString &fpdigest) { return fp_identityToServer[fpdigest]; } -QString getNickNameFromFP(const QString &fp) +TQString getNickNameFromFP(const TQString &fp) { - QString fpdigest = getFPDigestFromFP(fp); + TQString fpdigest = getFPDigestFromFP(fp); return fp_identityToServer[fpdigest]; } -QString getFPFromNickName(const QString &nickname) +TQString getFPFromNickName(const TQString &nickname) { char buf[256]; char hexdigest[HEX_DIGEST_LEN+1]; - QString fp = serverTofp_identity[nickname]; + TQString fp = serverTofp_identity[nickname]; if (fp.isEmpty()) - return QString(); + return TQString(); if (!digest_from_base64(buf, fp)) base16_encode(hexdigest, HEX_DIGEST_LEN+1, buf, DIGEST_LEN); return hexdigest; } -QString getFPFromFPDigest(const QString &fp) +TQString getFPFromFPDigest(const TQString &fp) { char buf[256]; char hexdigest[HEX_DIGEST_LEN+1]; @@ -254,14 +254,14 @@ crypto_rand_int(unsigned int max) /** Generates a pseudorandom string of length <b>len</b> containing printable * ASCII characters from the range '!' (0x21) to '~' (0x7e). */ -QString +TQString crypto_rand_string(int len) { - QString str; + TQString str; Q_ASSERT(len >= 0); for (int i = 0; i < len; i++) - str += QChar('!' + crypto_rand_int('~'-'!'+1)); + str += TQChar('!' + crypto_rand_int('~'-'!'+1)); return str; } @@ -605,7 +605,7 @@ secret_to_key(char *key_out, size_t key_out_len, const char *secret, /** Entry point for password hashing: take the desired password from * the command line, and print its salted hash to stdout. **/ -QString hashPassword(const char* secret) +TQString hashPassword(const char* secret) { char output[256]; |