summaryrefslogtreecommitdiffstats
path: root/libkpgp/kpgpbase5.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-02-16 20:17:18 +0000
commitf4fae92b6768541e2952173c3d4b09040f95bf7e (patch)
treed8c5d93232235cd635f3310b4d95490df181ba2d /libkpgp/kpgpbase5.cpp
parent125c0a08265b75a133644d3b55f47e37c919f45d (diff)
downloadtdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.tar.gz
tdepim-f4fae92b6768541e2952173c3d4b09040f95bf7e.zip
Moved kpilot from kdepim to applications, as the core Trinity libraries should not contain hardware-dependent software
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1221127 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkpgp/kpgpbase5.cpp')
-rw-r--r--libkpgp/kpgpbase5.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/libkpgp/kpgpbase5.cpp b/libkpgp/kpgpbase5.cpp
index 21ca1dc47..a5988a9cb 100644
--- a/libkpgp/kpgpbase5.cpp
+++ b/libkpgp/kpgpbase5.cpp
@@ -66,7 +66,7 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
const char *passphrase )
{
TQCString cmd;
- int exitStatus = 0;
+ int exiStatus = 0;
int index;
// used to work around a bug in pgp5. pgp5 treats files
// with non ascii chars (umlauts, etc...) as binary files, but
@@ -112,14 +112,14 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
if (signonly)
{
input.append("\n");
- input.replace(TQRegExp("[ \t]+\n"), "\n"); //strip trailing whitespace
+ input.tqreplace(TQRegExp("[ \t]+\n"), "\n"); //strip trailing whitespace
}
//We have to do this otherwise it's all in vain
- exitStatus = run(cmd.data(), passphrase);
+ exiStatus = run(cmd.data(), passphrase);
block.setError( error );
- if(exitStatus != 0)
+ if(exiStatus != 0)
status = ERROR;
// now parse the returned info
@@ -179,13 +179,13 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
if (input[0] == '-')
input = "- " + input;
for ( int idx = 0 ; (idx = input.find("\n-", idx)) >= 0 ; idx += 4 )
- input.replace(idx, 2, "\n- -");
+ input.tqreplace(idx, 2, "\n- -");
output = "-----BEGIN PGP SIGNED MESSAGE-----\n\n" + input + "\n" + output;
}
block.setProcessedText( output );
- block.setStatus( status );
+ block.seStatus( status );
return status;
}
@@ -193,19 +193,19 @@ Base5::encsign( Block& block, const KeyIDList& recipients,
int
Base5::decrypt( Block& block, const char *passphrase )
{
- int exitStatus = 0;
+ int exiStatus = 0;
clear();
input = block.text();
- exitStatus = run("pgpv -f +batchmode=1", passphrase);
+ exiStatus = run("pgpv -f +batchmode=1", passphrase);
if( !output.isEmpty() )
block.setProcessedText( output );
block.setError( error );
- if(exitStatus == -1) {
+ if(exiStatus == -1) {
errMsg = i18n("Error running PGP");
status = RUN_ERR;
- block.setStatus( status );
+ block.seStatus( status );
return status;
}
@@ -313,7 +313,7 @@ Base5::decrypt( Block& block, const char *passphrase )
}
//kdDebug(5100) << "status = " << status << endl;
- block.setStatus( status );
+ block.seStatus( status );
return status;
}
@@ -321,12 +321,12 @@ Base5::decrypt( Block& block, const char *passphrase )
Key*
Base5::readPublicKey( const KeyID& keyId, const bool readTrust, Key* key )
{
- int exitStatus = 0;
+ int exiStatus = 0;
status = 0;
- exitStatus = run( "pgpk -ll 0x" + keyId, 0, true );
+ exiStatus = run( "pgpk -ll 0x" + keyId, 0, true );
- if(exitStatus != 0) {
+ if(exiStatus != 0) {
status = ERROR;
return 0;
}
@@ -340,9 +340,9 @@ Base5::readPublicKey( const KeyID& keyId, const bool readTrust, Key* key )
if( readTrust )
{
- exitStatus = run( "pgpk -c 0x" + keyId, 0, true );
+ exiStatus = run( "pgpk -c 0x" + keyId, 0, true );
- if(exitStatus != 0) {
+ if(exiStatus != 0) {
status = ERROR;
return 0;
}
@@ -357,7 +357,7 @@ Base5::readPublicKey( const KeyID& keyId, const bool readTrust, Key* key )
KeyList
Base5::publicKeys( const TQStringList & patterns )
{
- int exitStatus = 0;
+ int exiStatus = 0;
TQCString cmd = "pgpk -ll";
for ( TQStringList::ConstIterator it = patterns.begin();
@@ -366,9 +366,9 @@ Base5::publicKeys( const TQStringList & patterns )
cmd += KProcess::quote( *it ).local8Bit();
}
status = 0;
- exitStatus = run( cmd, 0, true );
+ exiStatus = run( cmd, 0, true );
- if(exitStatus != 0) {
+ if(exiStatus != 0) {
status = ERROR;
return KeyList();
}
@@ -386,7 +386,7 @@ Base5::publicKeys( const TQStringList & patterns )
KeyList
Base5::secretKeys( const TQStringList & patterns )
{
- int exitStatus = 0;
+ int exiStatus = 0;
status = 0;
TQCString cmd = "pgpk -ll";
@@ -396,9 +396,9 @@ Base5::secretKeys( const TQStringList & patterns )
cmd += KProcess::quote( *it ).local8Bit();
}
status = 0;
- exitStatus = run( cmd, 0, true );
+ exiStatus = run( cmd, 0, true );
- if(exitStatus != 0) {
+ if(exiStatus != 0) {
status = ERROR;
return KeyList();
}
@@ -415,15 +415,15 @@ Base5::secretKeys( const TQStringList & patterns )
TQCString Base5::getAsciiPublicKey(const KeyID& keyID)
{
- int exitStatus = 0;
+ int exiStatus = 0;
if (keyID.isEmpty())
return TQCString();
status = 0;
- exitStatus = run( "pgpk -xa 0x" + keyID, 0, true );
+ exiStatus = run( "pgpk -xa 0x" + keyID, 0, true );
- if(exitStatus != 0) {
+ if(exiStatus != 0) {
status = ERROR;
return TQCString();
}
@@ -436,7 +436,7 @@ int
Base5::signKey(const KeyID& keyID, const char *passphrase)
{
TQCString cmd;
- int exitStatus = 0;
+ int exiStatus = 0;
if(passphrase == 0) return false;
@@ -445,9 +445,9 @@ Base5::signKey(const KeyID& keyID, const char *passphrase)
cmd += addUserId();
status = 0;
- exitStatus = run(cmd.data(), passphrase);
+ exiStatus = run(cmd.data(), passphrase);
- if (exitStatus != 0)
+ if (exiStatus != 0)
status = ERROR;
return status;
@@ -492,7 +492,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
if( !strncmp( output.data() + offset, "pub", 3 ) ||
!strncmp( output.data() + offset, "sec", 3 ) ||
!strncmp( output.data() + offset, "sub", 3 ) )
- { // line contains key data
+ { // line tqcontains key data
//kdDebug(5100)<<"Key data:\n";
int pos, pos2;
@@ -579,7 +579,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
TQDateTime dt( TQDate( year, month, day ), TQTime( 00, 00 ) );
subkey->setCreationDate( epoch.secsTo( dt ) );
// has the key already expired?
- if( TQDateTime::currentDateTime() >= dt )
+ if( TQDateTime::tqcurrentDateTime() >= dt )
{
subkey->setExpired( true );
key->setExpired( true );
@@ -647,7 +647,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
}
else if( !strncmp( output.data() + offset, "f16", 3 ) ||
!strncmp( output.data() + offset, "f20", 3 ) )
- { // line contains a fingerprint
+ { // line tqcontains a fingerprint
/* Examples:
f16 Fingerprint16 = DE 2A 77 08 78 64 7C 42 72 75 B1 A7 3E 42 3F 79
f20 Fingerprint20 = 226F 4B63 6DA2 7389 91D1 2A49 D58A 3EC1 5214 181E
@@ -657,13 +657,13 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
TQCString fingerprint = output.mid( pos, eol-pos );
// remove white space from the fingerprint
for ( int idx = 0 ; (idx = fingerprint.find(' ', idx)) >= 0 ; )
- fingerprint.replace( idx, 1, "" );
+ fingerprint.tqreplace( idx, 1, "" );
assert( subkey != 0 );
subkey->setFingerprint( fingerprint );
//kdDebug(5100)<<"Fingerprint: "<<fingerprint<<endl;
}
else if( !strncmp( output.data() + offset, "uid", 3 ) )
- { // line contains a uid
+ { // line tqcontains a uid
int pos = offset+5;
TQCString uid = output.mid( pos, eol-pos );
key->addUserID( uid );
@@ -678,7 +678,7 @@ Base5::parseKeyData( const TQCString& output, int& offset, Key* key /* = 0 */ )
else if ( !strncmp( output.data() + offset, "sig", 3 ) ||
!strncmp( output.data() + offset, "SIG", 3 ) ||
!strncmp( output.data() + offset, "ret", 3 ) )
- { // line contains a signature
+ { // line tqcontains a signature
// SIG = sig with own key; ret = sig with revoked key
// we ignore it for now
}
@@ -792,7 +792,7 @@ Base5::parseTrustDataForKey( Key* key, const TQCString& str )
break;
if( str[offset+23] != ' ' )
- { // line contains a validity value for a user ID
+ { // line tqcontains a validity value for a user ID
// determine the validity
Validity validity = KPGP_VALIDITY_UNKNOWN;