adium 5865:84b301e1cef6: Make sure details_for_context succeeded...

commits at adium.im commits at adium.im
Fri May 2 10:30:00 UTC 2014


details:	http://hg.adium.im/adium/rev/84b301e1cef6
revision:	5865:84b301e1cef6
branch:		adium-1.5.10
author:		Thijs Alkemade <me at thijsalkema.de>
date:		Fri May 02 12:29:24 2014 +0200

Make sure details_for_context succeeded before prompting the user to verify an unknown OTR fingerprint. This should fix situations where it prompts to verify a fingerprint of "(null)" for "(null)", etc.

I think this can only occur when go_encrypted calls edata->ops->new_fingerprint, but then errors out before assigning edata->context->active_fingerprint (which could be otrl_dh_session failing due to a badly formed DH key). I therefore think it's safe to assume there is no active OTR session, so we should ignore the unknown fingerprint.

diffs (19 lines):

diff -r 730f3ac03eaf -r 84b301e1cef6 Source/AdiumOTREncryption.m
--- a/Source/AdiumOTREncryption.m	Thu Apr 24 16:31:31 2014 +0200
+++ b/Source/AdiumOTREncryption.m	Fri May 02 12:29:24 2014 +0200
@@ -1114,7 +1114,14 @@
 	
 	responseInfo = details_for_context([contextValue pointerValue]);
 	
-	[ESOTRUnknownFingerprintController showUnknownFingerprintPromptWithResponseInfo:responseInfo];
+	if (responseInfo) {
+		[ESOTRUnknownFingerprintController showUnknownFingerprintPromptWithResponseInfo:responseInfo];
+	} else {
+		/* This means either context, context->active_fingerprint, context->active_fingerprint-fingerprint
+		 * or context->active_fingerprint->context was NULL.
+		 */
+		AILogWithSignature(@"Got a nil details_for_context for %p", [contextValue pointerValue]);
+	}
 }
 
 /*!




More information about the commits mailing list