SecOTRPublicDHKeyRef newKey = NULL;
const uint8_t* bytes;
size_t size;
-
+ SecOTRFullDHKeyRef myKeyForMessage = NULL;
+ SecOTRPublicDHKeyRef theirKeyForMessage = NULL;
bytes = CFDataGetBytePtr(decodedBytes);
size = CFDataGetLength(decodedBytes);
uint8_t *macKey;
uint64_t *theirCounter;
- SecOTRFullDHKeyRef myKeyForMessage = (myID == session->_keyID) ? session->_myKey : session->_myNextKey;
- SecOTRPublicDHKeyRef theirKeyForMessage = (theirID == session->_theirKeyID) ? session->_theirKey : session->_theirPreviousKey;
+ myKeyForMessage = (myID == session->_keyID) ? session->_myKey : session->_myNextKey;
+ theirKeyForMessage = (theirID == session->_theirKeyID) ? session->_theirKey : session->_theirPreviousKey;
SecOTRSFindKeysForMessage(session, myKeyForMessage, theirKeyForMessage, false,
&messageKey, &macKey, &theirCounter);
SecOTRSPrecalculateNextKeysInternal(session);
fail:
+ if(result != errSecSuccess){
+ CFDataPerformWithHexString(decodedBytes, ^(CFStringRef decodedBytesString) {
+ SecOTRPublicIdentityRef myPublicID = SecOTRPublicIdentityCopyFromPrivate(kCFAllocatorDefault, session->_me, NULL);
+ SecOTRPIPerformWithSerializationString(myPublicID, ^(CFStringRef myIDString) {
+ SecOTRPIPerformWithSerializationString(session->_them, ^(CFStringRef theirIDString) {
+ secnotice("OTR","session[%p] failed to decrypt, session: %@, mk: %@, mpk: %@, tpk: %@, tk: %@, chose tktu: %@", session, session,
+ session->_myKey, session->_myNextKey, session->_theirPreviousKey, session->_theirKey, theirKeyForMessage);
+ secnotice("OTR","session[%p] failed to decrypt, mktu: %@, mpi: %@, tpi: %@, m: %@", session, myKeyForMessage, myIDString, theirIDString, decodedBytesString);
+ });
+ });
+ CFReleaseNull(myPublicID);
+ });
+ }
CFReleaseNull(newKey);
return result;
}
SecOTRSPrecalculateNextKeysInternal(session);
fail:
-#if DEBUG
if(result != errSecSuccess){
CFDataPerformWithHexString(decodedBytes, ^(CFStringRef decodedBytesString) {
- secdebug("OTR","session[%p] failed to decrypt, session: %@, mk: %@, mpk: %@, tpk: %@, tk: %@, chose tktu: %@, mktu: %@, m: %@, tP: %@, tb: %hhx", session, session,
- session->_myKey, session->_myNextKey, session->_theirPreviousKey, session->_theirKey, theirKeyForMessage, myKeyForMessage, decodedBytesString, theirProposal, type_byte);
+ SecOTRPublicIdentityRef myPublicID = SecOTRPublicIdentityCopyFromPrivate(kCFAllocatorDefault, session->_me, NULL);
+ SecOTRPIPerformWithSerializationString(myPublicID, ^(CFStringRef myIDString) {
+ SecOTRPIPerformWithSerializationString(session->_them, ^(CFStringRef theirIDString) {
+ secnotice("OTR","session[%p] failed to decrypt, session: %@, mk: %@, mpk: %@, tpk: %@, tk: %@, chose tktu: %@", session, session,
+ session->_myKey, session->_myNextKey, session->_theirPreviousKey, session->_theirKey, theirKeyForMessage);
+ secnotice("OTR","session[%p] failed to decrypt, mktu: %@, mpi: %@, tpi: %@, m: %@, tP: %@, tb: %hhx", session, myKeyForMessage, myIDString, theirIDString, decodedBytesString, theirProposal, type_byte);
+ });
+ });
+ CFReleaseNull(myPublicID);
});
}
-#endif
CFReleaseNull(theirProposal);
return result;
}
});
return result;
}
+