diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2018-11-29 19:52:17 +0100 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2018-11-29 21:48:23 +0100 |
commit | 2e5de46030e2354b851ba731f6c76ac30a2e8a3b (patch) | |
tree | e48732e76e7d0ceb4e01caab16c1aa2a119c1ad0 | |
parent | 2f0c49e8523a4d26b6bb9c7c8a05d68cb023a568 (diff) | |
download | tdepim-2e5de46030e2354b851ba731f6c76ac30a2e8a3b.tar.gz tdepim-2e5de46030e2354b851ba731f6c76ac30a2e8a3b.zip |
Adapted to new KPasswordEdit::password() signature.
This relates to bug 2961.
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
-rw-r--r-- | certmanager/lib/backends/qgpgme/qgpgmejob.cpp | 2 | ||||
-rw-r--r-- | certmanager/lib/ui/passphrasedialog.cpp | 5 | ||||
-rw-r--r-- | certmanager/lib/ui/passphrasedialog.h | 4 | ||||
-rw-r--r-- | libkpgp/kpgp.cpp | 40 | ||||
-rw-r--r-- | libkpgp/kpgp.h | 5 | ||||
-rw-r--r-- | libkpgp/kpgpbase.cpp | 22 | ||||
-rw-r--r-- | libkpgp/kpgpbase.h | 38 | ||||
-rw-r--r-- | libkpgp/kpgpbase2.cpp | 18 | ||||
-rw-r--r-- | libkpgp/kpgpbase5.cpp | 18 | ||||
-rw-r--r-- | libkpgp/kpgpbase6.cpp | 2 | ||||
-rw-r--r-- | libkpgp/kpgpbaseG.cpp | 18 | ||||
-rw-r--r-- | libkpgp/kpgpui.cpp | 2 | ||||
-rw-r--r-- | libkpgp/kpgpui.h | 2 | ||||
-rw-r--r-- | tderesources/caldav/resource.cpp | 16 | ||||
-rw-r--r-- | tderesources/carddav/resource.cpp | 8 |
15 files changed, 90 insertions, 110 deletions
diff --git a/certmanager/lib/backends/qgpgme/qgpgmejob.cpp b/certmanager/lib/backends/qgpgme/qgpgmejob.cpp index 7f08aa29b..947a52587 100644 --- a/certmanager/lib/backends/qgpgme/qgpgmejob.cpp +++ b/certmanager/lib/backends/qgpgme/qgpgmejob.cpp @@ -301,5 +301,5 @@ char * Kleo::QGpgMEJob::getPassphrase( const char * useridHint, const char * /*d } canceled = false; // gpgme++ free()s it, and we need to copy as long as dlg isn't deleted :o - return strdup( dlg.passphrase() ); + return strdup( dlg.passphrase().utf8() ); } diff --git a/certmanager/lib/ui/passphrasedialog.cpp b/certmanager/lib/ui/passphrasedialog.cpp index a2d0e7c36..e9f1e3e98 100644 --- a/certmanager/lib/ui/passphrasedialog.cpp +++ b/certmanager/lib/ui/passphrasedialog.cpp @@ -100,13 +100,12 @@ Kleo::PassphraseDialog::~PassphraseDialog() { delete d; d = 0; } -const char * Kleo::PassphraseDialog::passphrase() const { +const TQString Kleo::PassphraseDialog::passphrase() const { return d->lineedit->password(); } void Kleo::PassphraseDialog::slotOk() { - const char * pass = passphrase(); - emit finished( pass ? pass : "" ); + emit finished( passphrase() ); KDialogBase::slotOk(); } diff --git a/certmanager/lib/ui/passphrasedialog.h b/certmanager/lib/ui/passphrasedialog.h index e83eca422..2416f811b 100644 --- a/certmanager/lib/ui/passphrasedialog.h +++ b/certmanager/lib/ui/passphrasedialog.h @@ -63,13 +63,13 @@ namespace Kleo { bool modal=true ); ~PassphraseDialog(); - const char * passphrase() const; + const TQString passphrase() const; signals: /** emitted when the user clicks Ok. \a pass is never NULL. \c pass only valid inside slots connected to this signal. */ - void finished( const char * pass ); + void finished( const TQString pass ); /** emitted when the user clicks Cancel. */ void canceled(); diff --git a/libkpgp/kpgp.cpp b/libkpgp/kpgp.cpp index 293b36811..a42429573 100644 --- a/libkpgp/kpgp.cpp +++ b/libkpgp/kpgp.cpp @@ -55,7 +55,7 @@ Module::Module() mPublicKeysCached(false), mSecretKeys(), mSecretKeysCached(false), - passphrase(0), passphrase_buffer_len(0), havePassPhrase(false) + passphrase(0), havePassPhrase(false) { if (!kpgpObject) { kdDebug(5100) << "creating new pgp object" << endl; @@ -209,7 +209,7 @@ Module::prepare( bool needPassPhrase, Block* block ) TQApplication::restoreOverrideCursor(); if (passdlgResult == TQDialog::Accepted) { if (!setPassPhrase(passdlg.passphrase())) { - if (strlen(passdlg.passphrase()) >= 1024) + if (passdlg.passphrase().length() >= 1024) errMsg = i18n("Passphrase is too long, it must contain fewer than 1024 characters."); else errMsg = i18n("Out of memory."); @@ -227,18 +227,11 @@ Module::prepare( bool needPassPhrase, Block* block ) void Module::wipePassPhrase(bool freeMem) { - if ( passphrase ) { - if ( passphrase_buffer_len ) - memset( passphrase, 0x00, passphrase_buffer_len ); - else { - kdDebug(5100) << "wipePassPhrase: passphrase && !passphrase_buffer_len ???" << endl; - passphrase = 0; - } + if (!passphrase.isEmpty()) { + passphrase.fill(' '); } - if ( freeMem && passphrase ) { - free( passphrase ); - passphrase = 0; - passphrase_buffer_len = 0; + if (freeMem && !passphrase.isNull()) { + passphrase = TQString(); } havePassPhrase = false; } @@ -837,34 +830,21 @@ Module::getAsciiPublicKey(const KeyID& keyID) } -bool Module::setPassPhrase(const char * aPass) +bool Module::setPassPhrase(const TQString& aPass) { // null out old buffer before we touch the new string. So in case // aPass isn't properly null-terminated, we don't leak secret data. wipePassPhrase(); - if (aPass) + if (!aPass.isNull()) { - size_t newlen = strlen( aPass ); - if ( newlen >= 1024 ) { + if (aPass.length() >= 1024) { // rediculously long passphrase. // Maybe someone wants to trick us in malloc()'ing // huge buffers... return false; } - if ( passphrase_buffer_len < newlen + 1 ) { - // too little space in current buffer: - // allocate a larger one. - if ( passphrase ) - free( passphrase ); - passphrase_buffer_len = (newlen + 1 + 15) & ~0xF; // make it a multiple of 16. - passphrase = (char*)malloc( passphrase_buffer_len ); - if (!passphrase) { - passphrase_buffer_len = 0; - return false; - } - } - memcpy( passphrase, aPass, newlen + 1 ); + passphrase = aPass; havePassPhrase = true; } return true; diff --git a/libkpgp/kpgp.h b/libkpgp/kpgp.h index 6628f41e5..1ea49664e 100644 --- a/libkpgp/kpgp.h +++ b/libkpgp/kpgp.h @@ -332,7 +332,7 @@ private: KeyIDList getEncryptionKeys( const TQString& person ); /** Set pass phrase */ - bool setPassPhrase(const char* pass); + bool setPassPhrase(const TQString& pass); /** test if the PGP executable is found and if there is a passphrase set or given. Returns: @@ -431,8 +431,7 @@ private: bool mSecretKeysCached : 1; // did we already read the secret keys? bool storePass : 1; - char * passphrase; - size_t passphrase_buffer_len; + TQString passphrase; TQString errMsg; diff --git a/libkpgp/kpgpbase.cpp b/libkpgp/kpgpbase.cpp index c8efdfa4a..5b28bd540 100644 --- a/libkpgp/kpgpbase.cpp +++ b/libkpgp/kpgpbase.cpp @@ -59,7 +59,7 @@ Base::clear() int -Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) +Base::run( const char *cmd, const TQString& passphrase, bool onlyReadFromPGP ) { /* the pipe ppass is used for to pass the password to * pgp. passing the password together with the normal input through @@ -74,7 +74,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) struct pollfd pollin, pollout, pollerr; int pollstatus; - if(passphrase) + if (!passphrase.isNull()) { if (pipe(ppass) < 0) { // An error occurred @@ -83,7 +83,8 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) } pass = fdopen(ppass[1], "w"); - fwrite(passphrase, sizeof(char), strlen(passphrase), pass); + TQCString pass2 = passphrase.local8Bit(); + fwrite(pass2, sizeof(char), pass2.length(), pass); fwrite("\n", sizeof(char), 1, pass); fclose(pass); close(ppass[1]); @@ -368,7 +369,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) close(perr[0]); unsetenv("PGPPASSFD"); - if(passphrase) + if (!passphrase.isNull()) close(ppass[0]); // Did the child exit normally? @@ -397,7 +398,7 @@ Base::run( const char *cmd, const char *passphrase, bool onlyReadFromPGP ) int -Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) +Base::runGpg( const char *cmd, const TQString& passphrase, bool onlyReadFromGnuPG ) { /* the pipe ppass is used for to pass the password to * pgp. passing the password together with the normal input through @@ -417,7 +418,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) const int STD_IN = 2; int pollstatus; - if(passphrase) + if (!passphrase.isNull()) { if (pipe(ppass) < 0) { // An error occurred @@ -426,7 +427,8 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) } pass = fdopen(ppass[1], "w"); - fwrite(passphrase, sizeof(char), strlen(passphrase), pass); + TQCString pass2 = passphrase.local8Bit(); + fwrite(pass2, sizeof(char), pass2.length(), pass); fwrite("\n", sizeof(char), 1, pass); fclose(pass); close(ppass[1]); @@ -459,7 +461,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) printf("Something went wrong in libkpgp/kpgpbase.cpp\n"); } - if( passphrase ) { + if (!passphrase.isNull()) { if( mVersion >= "1.0.7" ) { // GnuPG >= 1.0.7 supports the gpg-agent, so we look for it. if( 0 == getenv("GPG_AGENT_INFO") ) { @@ -504,7 +506,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) //#warning FIXME: there has to be a better way to do this /* this is nasty nasty nasty (but it works) */ - if( passphrase ) { + if (!passphrase.isNull()) { if( mVersion >= "1.0.7" ) { // GnuPG >= 1.0.7 supports the gpg-agent, so we look for it. if( 0 == getenv("GPG_AGENT_INFO") ) { @@ -682,7 +684,7 @@ Base::runGpg( const char *cmd, const char *passphrase, bool onlyReadFromGnuPG ) close(pout[0]); close(perr[0]); - if(passphrase) + if (!passphrase.isNull()) close(ppass[0]); // Did the child exit normally? diff --git a/libkpgp/kpgpbase.h b/libkpgp/kpgpbase.h index 14f849cc8..3f99073a4 100644 --- a/libkpgp/kpgpbase.h +++ b/libkpgp/kpgpbase.h @@ -41,14 +41,14 @@ public: virtual int encrypt( Block& , const KeyIDList& ) { return OK; } /** Clearsigns the message with the currently set key. */ - virtual int clearsign( Block& , const char *) { return OK; } + virtual int clearsign( Block& , const TQString& ) { return OK; } /** Encrypts and signs the message with the given keys. */ virtual int encsign( Block& , const KeyIDList& , - const char * = 0) { return OK; } + const TQString& = 0) { return OK; } /** Decrypts the message. */ - virtual int decrypt( Block& , const char * = 0) { return OK; } + virtual int decrypt( Block& , const TQString& = 0) { return OK; } /** Verifies the message. */ virtual int verify( Block& block ) { return decrypt( block, 0 ); } @@ -77,7 +77,7 @@ public: /** Signs the given key with the currently set user key. This is currently not implemented. */ - virtual int signKey(const KeyID& , const char *) { return OK; } + virtual int signKey(const KeyID& , const TQString& ) { return OK; } /** Returns an error message if an error occurred during the last @@ -86,9 +86,9 @@ public: protected: - virtual int run( const char *cmd, const char *passphrase = 0, + virtual int run( const char *cmd, const TQString& passphrase = 0, bool onlyReadFromPGP = false ); - virtual int runGpg( const char *cmd, const char *passphrase = 0, + virtual int runGpg( const char *cmd, const TQString& passphrase = 0, bool onlyReadFromGnuPG = false ); virtual void clear(); @@ -115,10 +115,10 @@ public: virtual ~Base2(); virtual int encrypt( Block& block, const KeyIDList& recipients ); - virtual int clearsign( Block& block, const char *passphrase ); + virtual int clearsign( Block& block, const TQString& passphrase ); virtual int encsign( Block& block, const KeyIDList& recipients, - const char *passphrase = 0 ); - virtual int decrypt( Block& block, const char *passphrase = 0 ); + const TQString& passphrase = 0 ); + virtual int decrypt( Block& block, const TQString& passphrase = 0 ); virtual int verify( Block& block ) { return decrypt( block, 0 ); } virtual Key* readPublicKey( const KeyID& keyID, @@ -127,7 +127,7 @@ public: virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() ); virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() ); virtual TQCString getAsciiPublicKey( const KeyID& keyID ); - virtual int signKey( const KeyID& keyID, const char *passphrase ); + virtual int signKey( const KeyID& keyID, const TQString& passphrase ); protected: KeyList doGetPublicKeys( const TQCString & cmd, @@ -147,10 +147,10 @@ public: virtual ~BaseG(); virtual int encrypt( Block& block, const KeyIDList& recipients ); - virtual int clearsign( Block& block, const char *passphrase ); + virtual int clearsign( Block& block, const TQString& passphrase ); virtual int encsign( Block& block, const KeyIDList& recipients, - const char *passphrase = 0 ); - virtual int decrypt( Block& block, const char *passphrase = 0 ); + const TQString& passphrase = 0 ); + virtual int decrypt( Block& block, const TQString& passphrase = 0 ); virtual int verify( Block& block ) { return decrypt( block, 0 ); } virtual Key* readPublicKey( const KeyID& keyID, @@ -159,7 +159,7 @@ public: virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() ); virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() ); virtual TQCString getAsciiPublicKey( const KeyID& keyID ); - virtual int signKey( const KeyID& keyID, const char *passphrase ); + virtual int signKey( const KeyID& keyID, const TQString& passphrase ); private: Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 ); @@ -175,10 +175,10 @@ public: virtual ~Base5(); virtual int encrypt( Block& block, const KeyIDList& recipients ); - virtual int clearsign( Block& block, const char *passphrase ); + virtual int clearsign( Block& block, const TQString& passphrase ); virtual int encsign( Block& block, const KeyIDList& recipients, - const char *passphrase = 0 ); - virtual int decrypt( Block& block, const char *passphrase = 0 ); + const TQString& passphrase = 0 ); + virtual int decrypt( Block& block, const TQString& passphrase = 0 ); virtual int verify( Block& block ) { return decrypt( block, 0 ); } virtual Key* readPublicKey( const KeyID& keyID, @@ -187,7 +187,7 @@ public: virtual KeyList publicKeys( const TQStringList & patterns = TQStringList() ); virtual KeyList secretKeys( const TQStringList & patterns = TQStringList() ); virtual TQCString getAsciiPublicKey( const KeyID& keyID ); - virtual int signKey( const KeyID& keyID, const char *passphrase ); + virtual int signKey( const KeyID& keyID, const TQString& passphrase ); private: Key* parseKeyData( const TQCString& output, int& offset, Key* key = 0 ); @@ -204,7 +204,7 @@ public: Base6(); virtual ~Base6(); - virtual int decrypt( Block& block, const char *passphrase = 0 ); + virtual int decrypt( Block& block, const TQString& passphrase = 0 ); virtual int verify( Block& block ) { return decrypt( block, 0 ); } virtual Key* readPublicKey( const KeyID& keyID, diff --git a/libkpgp/kpgpbase2.cpp b/libkpgp/kpgpbase2.cpp index 2d16951c4..d0d08a0ff 100644 --- a/libkpgp/kpgpbase2.cpp +++ b/libkpgp/kpgpbase2.cpp @@ -55,7 +55,7 @@ Base2::encrypt( Block& block, const KeyIDList& recipients ) int -Base2::clearsign( Block& block, const char *passphrase ) +Base2::clearsign( Block& block, const TQString& passphrase ) { return encsign( block, KeyIDList(), passphrase ); } @@ -63,16 +63,16 @@ Base2::clearsign( Block& block, const char *passphrase ) int Base2::encsign( Block& block, const KeyIDList& recipients, - const char *passphrase ) + const TQString& passphrase ) { TQCString cmd; int exitStatus = 0; - if(!recipients.isEmpty() && passphrase != 0) + if (!recipients.isEmpty() && !passphrase.isNull()) cmd = PGP2 " +batchmode +language=en +verbose=1 -seat"; else if(!recipients.isEmpty()) cmd = PGP2 " +batchmode +language=en +verbose=1 -eat"; - else if(passphrase != 0) + else if (!passphrase.isNull()) cmd = PGP2 " +batchmode +language=en +verbose=1 -sat"; else { @@ -80,7 +80,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients, return OK; } - if(passphrase != 0) + if (!passphrase.isNull()) cmd += addUserId(); if(!recipients.isEmpty()) { @@ -185,7 +185,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients, } } #endif - if(passphrase != 0) + if (!passphrase.isNull()) { if(error.find("Pass phrase is good") != -1) { @@ -224,7 +224,7 @@ Base2::encsign( Block& block, const KeyIDList& recipients, int -Base2::decrypt( Block& block, const char *passphrase ) +Base2::decrypt( Block& block, const TQString& passphrase ) { int index, index2; int exitStatus = 0; @@ -294,7 +294,7 @@ Base2::decrypt( Block& block, const char *passphrase ) block.setRequiredUserId( error.mid(index, index2 - index) ); //kdDebug(5100) << "Base: key needed is \"" << block.requiredUserId() << "\"!\n"; - if((passphrase != 0) && (error.find("Bad pass phrase") != -1)) + if ((!passphrase.isNull()) && (error.find("Bad pass phrase") != -1)) { errMsg = i18n("Bad passphrase; could not decrypt."); kdDebug(5100) << "Base: passphrase is bad" << endl; @@ -573,7 +573,7 @@ Base2::secretKeys( const TQStringList & patterns ) int -Base2::signKey(const KeyID& keyID, const char *passphrase) +Base2::signKey(const KeyID& keyID, const TQString& passphrase) { TQCString cmd; int exitStatus = 0; diff --git a/libkpgp/kpgpbase5.cpp b/libkpgp/kpgpbase5.cpp index 7f8e405a6..dad10b3fd 100644 --- a/libkpgp/kpgpbase5.cpp +++ b/libkpgp/kpgpbase5.cpp @@ -55,7 +55,7 @@ Base5::encrypt( Block& block, const KeyIDList& recipients ) int -Base5::clearsign( Block& block, const char *passphrase ) +Base5::clearsign( Block& block, const TQString& passphrase ) { return encsign( block, KeyIDList(), passphrase ); } @@ -63,7 +63,7 @@ Base5::clearsign( Block& block, const char *passphrase ) int Base5::encsign( Block& block, const KeyIDList& recipients, - const char *passphrase ) + const TQString& passphrase ) { TQCString cmd; int exitStatus = 0; @@ -73,11 +73,11 @@ Base5::encsign( Block& block, const KeyIDList& recipients, // we want a clear signature bool signonly = false; - if(!recipients.isEmpty() && passphrase != 0) + if (!recipients.isEmpty() && !passphrase.isNull()) cmd = "pgpe +batchmode -afts "; else if(!recipients.isEmpty()) cmd = "pgpe +batchmode -aft "; - else if(passphrase != 0) + else if (!passphrase.isNull()) { cmd = "pgps +batchmode -abft "; signonly = true; @@ -88,7 +88,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, return OK; } - if(passphrase != 0) + if (!passphrase.isNull()) cmd += addUserId(); if(!recipients.isEmpty()) @@ -191,7 +191,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients, int -Base5::decrypt( Block& block, const char *passphrase ) +Base5::decrypt( Block& block, const TQString& passphrase ) { int exitStatus = 0; @@ -222,7 +222,7 @@ Base5::decrypt( Block& block, const char *passphrase ) // or do we not have the secret key? if(error.find("Need a pass phrase") != -1) { - if(passphrase != 0) + if (!passphrase.isNull()) { errMsg = i18n("Bad passphrase; could not decrypt."); kdDebug(5100) << "Base: passphrase is bad" << endl; @@ -433,12 +433,12 @@ TQCString Base5::getAsciiPublicKey(const KeyID& keyID) int -Base5::signKey(const KeyID& keyID, const char *passphrase) +Base5::signKey(const KeyID& keyID, const TQString& passphrase) { TQCString cmd; int exitStatus = 0; - if(passphrase == 0) return false; + if (passphrase.isNull()) return false; cmd = "pgpk -s -f +batchmode=1 0x"; cmd += keyID; diff --git a/libkpgp/kpgpbase6.cpp b/libkpgp/kpgpbase6.cpp index 40bef7abc..4d00441f9 100644 --- a/libkpgp/kpgpbase6.cpp +++ b/libkpgp/kpgpbase6.cpp @@ -46,7 +46,7 @@ Base6::~Base6() int -Base6::decrypt( Block& block, const char *passphrase ) +Base6::decrypt( Block& block, const TQString& passphrase ) { int index, index2; int exitStatus = 0; diff --git a/libkpgp/kpgpbaseG.cpp b/libkpgp/kpgpbaseG.cpp index cd6eaf41c..e63c30153 100644 --- a/libkpgp/kpgpbaseG.cpp +++ b/libkpgp/kpgpbaseG.cpp @@ -62,7 +62,7 @@ BaseG::encrypt( Block& block, const KeyIDList& recipients ) int -BaseG::clearsign( Block& block, const char *passphrase ) +BaseG::clearsign( Block& block, const TQString& passphrase ) { return encsign( block, KeyIDList(), passphrase ); } @@ -70,16 +70,16 @@ BaseG::clearsign( Block& block, const char *passphrase ) int BaseG::encsign( Block& block, const KeyIDList& recipients, - const char *passphrase ) + const TQString& passphrase ) { TQCString cmd; int exitStatus = 0; - if(!recipients.isEmpty() && passphrase != 0) + if (!recipients.isEmpty() && !passphrase.isNull()) cmd = "--batch --armor --sign --encrypt --textmode"; else if(!recipients.isEmpty()) cmd = "--batch --armor --encrypt --textmode"; - else if(passphrase != 0) + else if (!passphrase.isNull()) cmd = "--batch --escape-from --clearsign"; else { @@ -87,7 +87,7 @@ BaseG::encsign( Block& block, const KeyIDList& recipients, return OK; } - if(passphrase != 0) + if (!passphrase.isNull()) cmd += addUserId(); if(!recipients.isEmpty()) @@ -164,7 +164,7 @@ BaseG::encsign( Block& block, const KeyIDList& recipients, } } #endif - if( passphrase != 0 ) + if (!passphrase.isNull()) { // Example 1 (bad passphrase, clearsign only): // gpg: skipped `0x12345678': bad passphrase @@ -205,7 +205,7 @@ BaseG::encsign( Block& block, const KeyIDList& recipients, int -BaseG::decrypt( Block& block, const char *passphrase ) +BaseG::decrypt( Block& block, const TQString& passphrase ) { int index, index2; int exitStatus = 0; @@ -252,7 +252,7 @@ BaseG::decrypt( Block& block, const char *passphrase ) { if( ( index = error.find( "bad passphrase" ) ) != -1 ) { - if( passphrase != 0 ) + if (!passphrase.isNull()) { errMsg = i18n( "Bad passphrase; could not decrypt." ); kdDebug(5100) << "Base: passphrase is bad" << endl; @@ -483,7 +483,7 @@ BaseG::secretKeys( const TQStringList & patterns ) int -BaseG::signKey(const KeyID& keyID, const char *passphrase) +BaseG::signKey(const KeyID& keyID, const TQString& passphrase) { TQCString cmd; int exitStatus = 0; diff --git a/libkpgp/kpgpui.cpp b/libkpgp/kpgpui.cpp index f4b40a708..3c099d6bc 100644 --- a/libkpgp/kpgpui.cpp +++ b/libkpgp/kpgpui.cpp @@ -95,7 +95,7 @@ PassphraseDialog::~PassphraseDialog() { } -const char * PassphraseDialog::passphrase() +const TQString PassphraseDialog::passphrase() { return lineedit->password(); } diff --git a/libkpgp/kpgpui.h b/libkpgp/kpgpui.h index 57c13fbaf..bf2b4213e 100644 --- a/libkpgp/kpgpui.h +++ b/libkpgp/kpgpui.h @@ -62,7 +62,7 @@ class KDE_EXPORT PassphraseDialog : public KDialogBase bool modal=true, const TQString &keyID=TQString()); virtual ~PassphraseDialog(); - const char * passphrase(); + const TQString passphrase(); private: KPasswordEdit *lineedit; diff --git a/tderesources/caldav/resource.cpp b/tderesources/caldav/resource.cpp index dff7ed961..8fae5c984 100644 --- a/tderesources/caldav/resource.cpp +++ b/tderesources/caldav/resource.cpp @@ -376,14 +376,14 @@ void ResourceCalDav::loadFinished() { if (loader->error()) { if (loader->errorNumber() == -401) { if (NULL != mPrefs) { - TQCString newpass; + TQString newpass; if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { log("load error: " + loader->errorString() ); loadError(TQString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); } else { // Set new password and try again - mPrefs->setPassword(TQString(newpass)); + mPrefs->setPassword(newpass); startLoading(mPrefs->getFullUrl(), mPrefs->getFullTasksUrl(), mPrefs->getFullJournalsUrl()); } } @@ -424,14 +424,14 @@ void ResourceCalDav::loadFinished() { if (loader->tasksError()) { if (loader->tasksErrorNumber() == -401) { if (NULL != mPrefs) { -// TQCString newpass; +// TQString newpass; // if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { // log("load error: " + loader->tasksErrorString() ); // loadError(TQString("[%1] ").arg(abs(loader->tasksErrorNumber())) + loader->tasksErrorString()); // } // else { // // Set new password and try again -// mPrefs->setPassword(TQString(newpass)); +// mPrefs->setPassword(newpass); // startLoading(mPrefs->getFullUrl(), mPrefs->getFullTasksUrl(), mPrefs->getFullJournalsUrl()); // } } @@ -472,14 +472,14 @@ void ResourceCalDav::loadFinished() { if (loader->journalsError()) { if (loader->journalsErrorNumber() == -401) { if (NULL != mPrefs) { -// TQCString newpass; +// TQString newpass; // if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { // log("load error: " + loader->journalsErrorString() ); // loadError(TQString("[%1] ").arg(abs(loader->journalsErrorNumber())) + loader->journalsErrorString()); // } // else { // // Set new password and try again -// mPrefs->setPassword(TQString(newpass)); +// mPrefs->setPassword(newpass); // startLoading(mPrefs->getFullUrl(), mPrefs->getFullTasksUrl(), mPrefs->getFullJournalsUrl()); // } } @@ -969,14 +969,14 @@ void ResourceCalDav::writingFinished() { if (mWriter->error() && (abs(mWriter->errorNumber()) != 207)) { if (mWriter->errorNumber() == -401) { if (NULL != mPrefs) { - TQCString newpass; + TQString newpass; if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { log("write error: " + mWriter->errorString()); saveError(TQString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); } else { // Set new password and try again - mPrefs->setPassword(TQString(newpass)); + mPrefs->setPassword(newpass); startWriting(mPrefs->getFullUrl(), mPrefs->getFullTasksUrl(), mPrefs->getFullJournalsUrl()); } } diff --git a/tderesources/carddav/resource.cpp b/tderesources/carddav/resource.cpp index 3da63e4b3..69eb98e4a 100644 --- a/tderesources/carddav/resource.cpp +++ b/tderesources/carddav/resource.cpp @@ -372,14 +372,14 @@ void ResourceCardDav::loadFinished() { if (loader->error()) { if (loader->errorNumber() == -401) { if (NULL != mPrefs) { - TQCString newpass; + TQString newpass; if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { log("load error: " + loader->errorString() ); if (addressBook() != NULL) addressBook()->error(TQString("[%1] ").arg(abs(loader->errorNumber())) + loader->errorString()); } else { // Set new password and try again - mPrefs->setPassword(TQString(newpass)); + mPrefs->setPassword(newpass); startLoading(mPrefs->getFullUrl()); } } @@ -641,14 +641,14 @@ void ResourceCardDav::writingFinished() { if (mWriter->error() && (abs(mWriter->errorNumber()) != 207)) { if (mWriter->errorNumber() == -401) { if (NULL != mPrefs) { - TQCString newpass; + TQString newpass; if (KPasswordDialog::getPassword (newpass, TQString("<b>") + i18n("Remote authorization required") + TQString("</b><p>") + i18n("Please input the password for") + TQString(" ") + mPrefs->getusername(), NULL) != 1) { log("write error: " + mWriter->errorString()); if (addressBook() != NULL) addressBook()->error(TQString("[%1] ").arg(abs(mWriter->errorNumber())) + mWriter->errorString()); } else { // Set new password and try again - mPrefs->setPassword(TQString(newpass)); + mPrefs->setPassword(newpass); startWriting(mPrefs->getFullUrl()); } } |