Permalink
Browse files

- Adds verbose logging for GPGController calls if verbose logging is …

…enabled on GPGMail. [#223 state:resolved]
  • Loading branch information...
1 parent 1091239 commit ffdb8c745a20dacda948ce14b47a6a3f995e53dd @lukele lukele committed Aug 5, 2011
Showing with 6 additions and 6 deletions.
  1. +1 −0 Source/GPGMailBundle.m
  2. +5 −6 Source/MimePart+GPGMail.m
View
@@ -1199,6 +1199,7 @@ - (NSSet *)loadGPGKeys {
if(!gpgMailWorks) return nil;
if(!cachedGPGKeys) {
GPGController *gpgc = [[GPGController alloc] init];
+ gpgc.verbose = (GPGMailLoggingLevel > 0);
cachedGPGKeys = [gpgc allKeys];
[cachedGPGKeys retain];
[gpgc release];
View
@@ -159,7 +159,7 @@ - (id)MADecodeApplicationPgp_EncryptedWithData:(NSData *)encryptedData context:(
__block NSArray *signatures = nil;
[[GPGMailBundle sharedInstance] addDecryptionTask:^{
GPGController *gpgc = [[GPGController alloc] init];
- //gpgc.verbose = YES;
+ gpgc.verbose = (GPGMailLoggingLevel > 0);
@try {
decryptedData = [gpgc decryptData:encryptedData];
signatures = [gpgc signatures];
@@ -265,9 +265,9 @@ - (id)MANewEncryptedPartWithData:(id)data recipients:(id)recipients encryptedDat
NSArray *normalKeyList = [[GPGMailBundle sharedInstance] publicKeyListForAddresses:normalRecipients];
NSArray *bccKeyList = [[GPGMailBundle sharedInstance] publicKeyListForAddresses:bccRecipients];
GPGController *gpgc = [[GPGController alloc] init];
+ gpgc.verbose = (GPGMailLoggingLevel > 0);
gpgc.useArmor = YES;
gpgc.useTextMode = YES;
- //gpgc.verbose = YES;
// Automatically trust keys, even though they are not specifically
// marked as such.
// Eventually add warning for this.
@@ -312,14 +312,13 @@ - (id)MANewSignedPartWithData:(id)arg1 sender:(id)arg2 signatureData:(id *)arg3
DebugLog(@"[DEBUG] %s sender: %@", __PRETTY_FUNCTION__, arg2);
NSArray *normalKeyList = [[GPGMailBundle sharedInstance] signingKeyListForAddresses:[NSArray arrayWithObject:arg2]];
GPGController *gpgc = [[GPGController alloc] init];
+ gpgc.verbose = (GPGMailLoggingLevel > 0);
gpgc.useArmor = YES;
gpgc.useTextMode = YES;
- //gpgc.verbose = YES;
// Automatically trust keys, even though they are not specifically
// marked as such.
// Eventually add warning for this.
gpgc.trustAllKeys = YES;
- // gpgc.verbose = YES; // see issue 223
// Recipients are not needed for signing. Use addSignerKey instead.
for(NSString *fingerprint in normalKeyList)
[gpgc addSignerKey:fingerprint];
@@ -401,7 +400,7 @@ - (void)MAVerifySignature {
NSData *signatureData = [signaturePart bodyData];
//DebugLog(@"[DEBUG] %s signature: %@", __PRETTY_FUNCTION__, [NSString stringWithData:signatureData encoding:[self guessedEncoding]]);
GPGController *gpgc = [[GPGController alloc] init];
- //gpgc.verbose = YES;
+ gpgc.verbose = (GPGMailLoggingLevel > 0);
NSArray *signatures;
@try {
signatures = [gpgc verifySignature:signatureData originalData:signedData];
@@ -431,7 +430,7 @@ - (void)_verifyPGPInlineSignature {
if(![signedData length] || [self rangeOfPlainPGPSignatures].location == NSNotFound)
return;
GPGController *gpgc = [[GPGController alloc] init];
- //gpgc.verbose = YES; // see issue 223
+ gpgc.verbose = (GPGMailLoggingLevel > 0);
NSArray *signatures;
@try {
signatures = [gpgc verifySignedData:signedData];

0 comments on commit ffdb8c7

Please sign in to comment.