Skip to content

Commit

Permalink
Merge pull request #413 from matrix-org/e2e_key_sharing
Browse files Browse the repository at this point in the history
Crypto: Room key sharing (element-hq/riot-meta#113)
  • Loading branch information
manuroe committed Nov 15, 2017
2 parents ae3d139 + 0f16c59 commit 28d11bf
Show file tree
Hide file tree
Showing 48 changed files with 2,643 additions and 238 deletions.
56 changes: 56 additions & 0 deletions MatrixSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@
32A1515B1DB525DA00400192 /* NSObject+sortedKeys.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A151591DB525DA00400192 /* NSObject+sortedKeys.h */; };
32A1515C1DB525DA00400192 /* NSObject+sortedKeys.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A1515A1DB525DA00400192 /* NSObject+sortedKeys.m */; };
32A27D1F19EC335300BAFADE /* MXRoomTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A27D1E19EC335300BAFADE /* MXRoomTests.m */; };
32A30B181FB4813400C8309E /* MXIncomingRoomKeyRequestManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A30B161FB4813400C8309E /* MXIncomingRoomKeyRequestManager.h */; };
32A30B191FB4813400C8309E /* MXIncomingRoomKeyRequestManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A30B171FB4813400C8309E /* MXIncomingRoomKeyRequestManager.m */; };
32A9E8241EF4026E0081358A /* MXBackgroundModeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A9E8211EF4026E0081358A /* MXBackgroundModeHandler.h */; };
32A9E8251EF4026E0081358A /* MXUIKitBackgroundModeHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 32A9E8221EF4026E0081358A /* MXUIKitBackgroundModeHandler.h */; };
32A9E8261EF4026E0081358A /* MXUIKitBackgroundModeHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 32A9E8231EF4026E0081358A /* MXUIKitBackgroundModeHandler.m */; };
Expand Down Expand Up @@ -208,8 +210,16 @@
32E226A61D06AC9F00E6CA54 /* MXPeekingRoom.h in Headers */ = {isa = PBXBuildFile; fileRef = 32E226A41D06AC9F00E6CA54 /* MXPeekingRoom.h */; settings = {ATTRIBUTES = (Public, ); }; };
32E226A71D06AC9F00E6CA54 /* MXPeekingRoom.m in Sources */ = {isa = PBXBuildFile; fileRef = 32E226A51D06AC9F00E6CA54 /* MXPeekingRoom.m */; };
32E226A91D081CE200E6CA54 /* MXPeekingRoomTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 32E226A81D081CE200E6CA54 /* MXPeekingRoomTests.m */; };
32F945F51FAB83D900622468 /* MXIncomingRoomKeyRequestCancellation.m in Sources */ = {isa = PBXBuildFile; fileRef = 32F945F11FAB83D800622468 /* MXIncomingRoomKeyRequestCancellation.m */; };
32F945F61FAB83D900622468 /* MXIncomingRoomKeyRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 32F945F21FAB83D900622468 /* MXIncomingRoomKeyRequest.h */; settings = {ATTRIBUTES = (Public, ); }; };
32F945F71FAB83D900622468 /* MXIncomingRoomKeyRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 32F945F31FAB83D900622468 /* MXIncomingRoomKeyRequest.m */; };
32F945F81FAB83D900622468 /* MXIncomingRoomKeyRequestCancellation.h in Headers */ = {isa = PBXBuildFile; fileRef = 32F945F41FAB83D900622468 /* MXIncomingRoomKeyRequestCancellation.h */; settings = {ATTRIBUTES = (Public, ); }; };
32F9FA7D1DBA0CF0009D98A6 /* MXDecryptionResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 32F9FA7B1DBA0CF0009D98A6 /* MXDecryptionResult.h */; };
32F9FA7E1DBA0CF0009D98A6 /* MXDecryptionResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 32F9FA7C1DBA0CF0009D98A6 /* MXDecryptionResult.m */; };
32FA10C11FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 32FA10BF1FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.h */; };
32FA10C21FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 32FA10C01FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.m */; };
32FA10CE1FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 32FA10C81FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.h */; };
32FA10CF1FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 32FA10C91FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.m */; };
32FCAB4D19E578860049C555 /* MXRestClientTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 32FCAB4C19E578860049C555 /* MXRestClientTests.m */; };
32FE41361D0AB7070060835E /* MXEnumConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 32FE41341D0AB7070060835E /* MXEnumConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
32FE41371D0AB7070060835E /* MXEnumConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 32FE41351D0AB7070060835E /* MXEnumConstants.m */; };
Expand Down Expand Up @@ -461,6 +471,8 @@
32A151591DB525DA00400192 /* NSObject+sortedKeys.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSObject+sortedKeys.h"; path = "Lib/NSObject+sortedKeys.h"; sourceTree = "<group>"; };
32A1515A1DB525DA00400192 /* NSObject+sortedKeys.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSObject+sortedKeys.m"; path = "Lib/NSObject+sortedKeys.m"; sourceTree = "<group>"; };
32A27D1E19EC335300BAFADE /* MXRoomTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MXRoomTests.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
32A30B161FB4813400C8309E /* MXIncomingRoomKeyRequestManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MXIncomingRoomKeyRequestManager.h; sourceTree = "<group>"; };
32A30B171FB4813400C8309E /* MXIncomingRoomKeyRequestManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MXIncomingRoomKeyRequestManager.m; sourceTree = "<group>"; };
32A9E8211EF4026E0081358A /* MXBackgroundModeHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXBackgroundModeHandler.h; sourceTree = "<group>"; };
32A9E8221EF4026E0081358A /* MXUIKitBackgroundModeHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXUIKitBackgroundModeHandler.h; sourceTree = "<group>"; };
32A9E8231EF4026E0081358A /* MXUIKitBackgroundModeHandler.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXUIKitBackgroundModeHandler.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -495,8 +507,16 @@
32E226A51D06AC9F00E6CA54 /* MXPeekingRoom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXPeekingRoom.m; sourceTree = "<group>"; };
32E226A81D081CE200E6CA54 /* MXPeekingRoomTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXPeekingRoomTests.m; sourceTree = "<group>"; };
32F1FE9AF82A426C2EAED587 /* Pods-MatrixSDK.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MatrixSDK.release.xcconfig"; path = "Pods/Target Support Files/Pods-MatrixSDK/Pods-MatrixSDK.release.xcconfig"; sourceTree = "<group>"; };
32F945F11FAB83D800622468 /* MXIncomingRoomKeyRequestCancellation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXIncomingRoomKeyRequestCancellation.m; sourceTree = "<group>"; };
32F945F21FAB83D900622468 /* MXIncomingRoomKeyRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXIncomingRoomKeyRequest.h; sourceTree = "<group>"; };
32F945F31FAB83D900622468 /* MXIncomingRoomKeyRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXIncomingRoomKeyRequest.m; sourceTree = "<group>"; };
32F945F41FAB83D900622468 /* MXIncomingRoomKeyRequestCancellation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXIncomingRoomKeyRequestCancellation.h; sourceTree = "<group>"; };
32F9FA7B1DBA0CF0009D98A6 /* MXDecryptionResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXDecryptionResult.h; sourceTree = "<group>"; };
32F9FA7C1DBA0CF0009D98A6 /* MXDecryptionResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXDecryptionResult.m; sourceTree = "<group>"; };
32FA10BF1FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MXOutgoingRoomKeyRequestManager.h; sourceTree = "<group>"; };
32FA10C01FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MXOutgoingRoomKeyRequestManager.m; sourceTree = "<group>"; };
32FA10C81FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXOutgoingRoomKeyRequest.h; sourceTree = "<group>"; };
32FA10C91FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXOutgoingRoomKeyRequest.m; sourceTree = "<group>"; };
32FCAB4C19E578860049C555 /* MXRestClientTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = MXRestClientTests.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
32FE41341D0AB7070060835E /* MXEnumConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MXEnumConstants.h; sourceTree = "<group>"; };
32FE41351D0AB7070060835E /* MXEnumConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MXEnumConstants.m; sourceTree = "<group>"; };
Expand Down Expand Up @@ -692,6 +712,7 @@
324BE4651E3FADB1008D99D4 /* Utils */,
322A51C01D9AC8FE00C8536D /* Algorithms */,
32A1513B1DAF768D00400192 /* Data */,
32FA10B21FA1C28100E54233 /* KeySharing */,
322A51B41D9AB15900C8536D /* MXCrypto.h */,
322A51B51D9AB15900C8536D /* MXCrypto.m */,
325D1C251DFECE0D0070B8BF /* MXCrypto_Private.h */,
Expand Down Expand Up @@ -1059,6 +1080,31 @@
path = Checker;
sourceTree = "<group>";
};
32FA10B21FA1C28100E54233 /* KeySharing */ = {
isa = PBXGroup;
children = (
32FA10C31FA1C9F700E54233 /* Data */,
32FA10BF1FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.h */,
32FA10C01FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.m */,
32A30B161FB4813400C8309E /* MXIncomingRoomKeyRequestManager.h */,
32A30B171FB4813400C8309E /* MXIncomingRoomKeyRequestManager.m */,
);
path = KeySharing;
sourceTree = "<group>";
};
32FA10C31FA1C9F700E54233 /* Data */ = {
isa = PBXGroup;
children = (
32F945F21FAB83D900622468 /* MXIncomingRoomKeyRequest.h */,
32F945F31FAB83D900622468 /* MXIncomingRoomKeyRequest.m */,
32F945F41FAB83D900622468 /* MXIncomingRoomKeyRequestCancellation.h */,
32F945F11FAB83D800622468 /* MXIncomingRoomKeyRequestCancellation.m */,
32FA10C81FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.h */,
32FA10C91FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.m */,
);
path = Data;
sourceTree = "<group>";
};
9274AFE51EE580240009BEB6 /* CallKit */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1167,6 +1213,7 @@
322691361E5EFF8700966A6E /* MXDeviceListOperationsPool.h in Headers */,
3281E8B719E42DFE00976E1A /* MXJSONModel.h in Headers */,
3284A5A01DB7C00600A09972 /* MXCryptoStore.h in Headers */,
32FA10CE1FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.h in Headers */,
32A1514A1DAF7C0C00400192 /* MXUsersDevicesMap.h in Headers */,
323E0C5B1A306D7A00A31D73 /* MXEvent.h in Headers */,
327F8DB21C6112BA00581CA3 /* MXRoomThirdPartyInvite.h in Headers */,
Expand Down Expand Up @@ -1206,6 +1253,7 @@
32A9E8251EF4026E0081358A /* MXUIKitBackgroundModeHandler.h in Headers */,
325D1C261DFECE0D0070B8BF /* MXCrypto_Private.h in Headers */,
32A151521DAF8A7200400192 /* MXQueuedEncryption.h in Headers */,
32A30B181FB4813400C8309E /* MXIncomingRoomKeyRequestManager.h in Headers */,
323B2AFE1BCE9B6700B11F34 /* MXCoreDataEvent+CoreDataProperties.h in Headers */,
F03EF5081DF071D5009DF592 /* MXEncryptedAttachments.h in Headers */,
320BBF421D6C81550079890E /* MXEventsByTypesEnumeratorOnArray.h in Headers */,
Expand All @@ -1217,6 +1265,7 @@
C61A4CC41E5F38CB00442158 /* SwiftMatrixSDK.h in Headers */,
324BE4681E3FADB1008D99D4 /* MXMegolmExportEncryption.h in Headers */,
32CAB10B1A925B41008C5BB9 /* MXHTTPOperation.h in Headers */,
32F945F81FAB83D900622468 /* MXIncomingRoomKeyRequestCancellation.h in Headers */,
3240969D1F9F751600DBA607 /* MXPushRuleSenderNotificationPermissionConditionChecker.h in Headers */,
322A51C71D9BBD3C00C8536D /* MXOlmDevice.h in Headers */,
320DFDE419DD99B60068622A /* MXRestClient.h in Headers */,
Expand All @@ -1241,9 +1290,11 @@
F082946D1DB66C3D00CEAB63 /* MXInvite3PID.h in Headers */,
3233606F1A403A0D0071A488 /* MXFileStore.h in Headers */,
32A1513E1DAF768D00400192 /* MXOlmInboundGroupSession.h in Headers */,
32FA10C11FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.h in Headers */,
326056851C76FDF2009D44AD /* MXEventTimeline.h in Headers */,
322A51C31D9AC8FE00C8536D /* MXCryptoAlgorithms.h in Headers */,
329B2AC11D3FB01D002D546F /* MXJingleCallStackCall.h in Headers */,
32F945F61FAB83D900622468 /* MXIncomingRoomKeyRequest.h in Headers */,
327137271A24D50A00DB6757 /* MXMyUser.h in Headers */,
3220093819EFA4C9008DE41D /* MXEventListener.h in Headers */,
32C235721F827F3800E38FC5 /* MXRoomOperation.h in Headers */,
Expand Down Expand Up @@ -1475,6 +1526,7 @@
3256E3821DCB91EB003C9718 /* MXCryptoConstants.m in Sources */,
326056861C76FDF2009D44AD /* MXEventTimeline.m in Sources */,
32A1513A1DAD292400400192 /* MXMegolmEncryption.m in Sources */,
32F945F71FAB83D900622468 /* MXIncomingRoomKeyRequest.m in Sources */,
323B2B011BCE9B6700B11F34 /* MXCoreDataEvent.m in Sources */,
92634B831EF2E3C400DB9F60 /* MXCallKitConfiguration.m in Sources */,
3265CB391A14C43E00E24B2F /* MXRoomState.m in Sources */,
Expand All @@ -1483,6 +1535,7 @@
32A1514B1DAF7C0C00400192 /* MXUsersDevicesMap.m in Sources */,
C6B40F521F2A35BE00C42C72 /* MXRoomState.swift in Sources */,
3264E2A31BDF8D1500F89A86 /* MXCoreDataRoomState.m in Sources */,
32F945F51FAB83D900622468 /* MXIncomingRoomKeyRequestCancellation.m in Sources */,
32D776821A27877300FC4AA2 /* MXMemoryRoomStore.m in Sources */,
C602B58C1F2268F700B67D87 /* MXRoom.swift in Sources */,
32A151271DABB0CB00400192 /* MXMegolmDecryption.m in Sources */,
Expand Down Expand Up @@ -1514,8 +1567,10 @@
32A151471DAF7C0C00400192 /* MXDeviceInfo.m in Sources */,
32A1515C1DB525DA00400192 /* NSObject+sortedKeys.m in Sources */,
F03EF5091DF071D5009DF592 /* MXEncryptedAttachments.m in Sources */,
32FA10CF1FA1C9F700E54233 /* MXOutgoingRoomKeyRequest.m in Sources */,
32322A4C1E575F65005DD155 /* MXAllowedCertificates.m in Sources */,
F03EF5051DF01596009DF592 /* MXLRUCache.m in Sources */,
32A30B191FB4813400C8309E /* MXIncomingRoomKeyRequestManager.m in Sources */,
3240969E1F9F751600DBA607 /* MXPushRuleSenderNotificationPermissionConditionChecker.m in Sources */,
71DE22E01BC7C51200284153 /* MXReceiptData.m in Sources */,
926F401A1EEF0F6E0062630D /* MXJingleCallAudioSessionConfigurator.m in Sources */,
Expand Down Expand Up @@ -1553,6 +1608,7 @@
324BE46D1E422766008D99D4 /* MXMegolmSessionData.m in Sources */,
C6F935891E5B3BE600FC34BF /* MXEventTimeline.swift in Sources */,
C6F9358B1E5B3BE600FC34BF /* MXJSONModels.swift in Sources */,
32FA10C21FA1C9EE00E54233 /* MXOutgoingRoomKeyRequestManager.m in Sources */,
320DFDE519DD99B60068622A /* MXRestClient.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
4 changes: 4 additions & 0 deletions MatrixSDK/Contrib/Swift/JSONModels/MXEvent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public enum MXEventType {
case roomGuestAccess
case roomHistoryVisibility
case roomKey
case roomForwardedKey
case roomKeyRequest
case roomMessage
case roomMessageFeedback
case roomRedaction
Expand Down Expand Up @@ -74,6 +76,8 @@ public enum MXEventType {
case .roomGuestAccess: return kMXEventTypeStringRoomGuestAccess
case .roomHistoryVisibility: return kMXEventTypeStringRoomHistoryVisibility
case .roomKey: return kMXEventTypeStringRoomKey
case .roomForwardedKey: return kMXEventTypeStringRoomForwardedKey
case .roomKeyRequest: return kMXEventTypeStringRoomKeyRequest
case .roomMessage: return kMXEventTypeStringRoomMessage
case .roomMessageFeedback: return kMXEventTypeStringRoomMessageFeedback
case .roomRedaction: return kMXEventTypeStringRoomRedaction
Expand Down
4 changes: 2 additions & 2 deletions MatrixSDK/Contrib/Swift/MXRestClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1715,8 +1715,8 @@ public extension MXRestClient {
- returns: a `MXHTTPOperation` instance.
*/
@nonobjc @discardableResult func sendDirectToDevice(eventType: String, contentMap: MXUsersDevicesMap<NSDictionary>, completion: @escaping (_ response: MXResponse<Void>) -> Void) -> MXHTTPOperation {
return __send(toDevice: eventType, contentMap: contentMap, success: currySuccess(completion), failure: curryFailure(completion))
@nonobjc @discardableResult func sendDirectToDevice(eventType: String, contentMap: MXUsersDevicesMap<NSDictionary>, txnId: String, completion: @escaping (_ response: MXResponse<Void>) -> Void) -> MXHTTPOperation {
return __send(toDevice: eventType, contentMap: contentMap, txnId: txnId, success: currySuccess(completion), failure: curryFailure(completion))
}


Expand Down
23 changes: 23 additions & 0 deletions MatrixSDK/Crypto/Algorithms/MXDecrypting.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

#import <Foundation/Foundation.h>

#import "MXHTTPOperation.h"
#import "MXEvent.h"
#import "MXDecryptionResult.h"
#import "MXIncomingRoomKeyRequest.h"

@class MXCrypto, MXMegolmSessionData;

Expand Down Expand Up @@ -59,4 +61,25 @@
*/
- (void)importRoomKey:(MXMegolmSessionData*)session;

/**
Determine if we have the keys necessary to respond to a room key request.
@param keyRequest the key request.
@return YES if we have the keys and could (theoretically) share them; else NO.
*/
- (BOOL)hasKeysForKeyRequest:(MXIncomingRoomKeyRequest*)keyRequest;

/**
Send the response to a room key request.
@param keyRequest the key request.
@param success A block object called when the operation succeeds.
@param failure A block object called when the operation fails.
@return a MXHTTPOperation instance.
*/
- (MXHTTPOperation*)shareKeysWithDevice:(MXIncomingRoomKeyRequest*)keyRequest
success:(void (^)())success
failure:(void (^)(NSError *error))failure;
@end
10 changes: 7 additions & 3 deletions MatrixSDK/Crypto/Algorithms/MXDecryptionResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ FOUNDATION_EXPORT NSString* const MXDecryptingErrorMissingPropertyReason;
@property (nonatomic) NSDictionary *keysClaimed;

/**
The keys that the sender of the event is known to have ownership of:
map from key type to base64-encoded key.
The curve25519 key that the sender of the event is known to have ownership of.
*/
@property (nonatomic) NSString *senderKey;

/**
Devices which forwarded this session to us (normally empty).
*/
@property (nonatomic) NSDictionary *keysProved;
@property NSArray<NSString *> *forwardingCurve25519KeyChain;

@end
2 changes: 1 addition & 1 deletion MatrixSDK/Crypto/Algorithms/MXDecryptionResult.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
NSString* const MXDecryptingErrorUnableToDecryptReason = @"Unable to decrypt %@. Algoritm: %@";
NSString* const MXDecryptingErrorOlm = @"Error: OLM.%@";
NSString* const MXDecryptingErrorOlmReason = @"Unable to decrypt %@. OLM error: %@";
NSString* const MXDecryptingErrorUnknownInboundSessionIdReason = @"Unknown inbound session id";
NSString* const MXDecryptingErrorUnknownInboundSessionIdReason = @"Unknown inbound session id";
NSString* const MXDecryptingErrorInboundSessionMismatchRoomIdReason = @"Mismatched room_id for inbound group session (expected %@, was %@)";
NSString* const MXDecryptingErrorMissingFieldsReason = @"Missing fields in input";
NSString* const MXDecryptingErrorMissingCiphertextReason = @"Missing ciphertext";
Expand Down
Loading

0 comments on commit 28d11bf

Please sign in to comment.