diff options
author | manuroe <manu@matrix.org> | 2016-11-14 17:35:24 +0100 |
---|---|---|
committer | manuroe <manu@matrix.org> | 2016-11-14 17:35:24 +0100 |
commit | 7ee17a295738f0db8cab74cec2343a577f2ade45 (patch) | |
tree | ab4dfe945e68ded9c92cb46e78c81032e40f30aa /xcode/OLMKitTests/OLMKitTests.m | |
parent | aa70c8afbccdccd289a69fb513dd3664aa8e3fc7 (diff) |
OLMKit: Add missing implementations for matchesInboundSession matchesInboundSessionFromolmkit-v2.0.0
Diffstat (limited to 'xcode/OLMKitTests/OLMKitTests.m')
-rw-r--r-- | xcode/OLMKitTests/OLMKitTests.m | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/xcode/OLMKitTests/OLMKitTests.m b/xcode/OLMKitTests/OLMKitTests.m index 251c90e..1adbde2 100644 --- a/xcode/OLMKitTests/OLMKitTests.m +++ b/xcode/OLMKitTests/OLMKitTests.m @@ -52,6 +52,15 @@ NSString *plaintext = [bobSession decryptMessage:aliceToBobMsg error:&error]; XCTAssertEqualObjects(message, plaintext); XCTAssertNil(error); + + XCTAssert([bobSession matchesInboundSession:aliceToBobMsg.ciphertext]); + XCTAssertFalse([aliceSession matchesInboundSession:@"ARandomOtkMessage"]); + + NSString *aliceIdKey = alice.identityKeys[@"curve25519"]; + XCTAssert([bobSession matchesInboundSessionFrom:aliceIdKey oneTimeKeyMessage:aliceToBobMsg.ciphertext]); + XCTAssertFalse([bobSession matchesInboundSessionFrom:@"ARandomIdKey" oneTimeKeyMessage:aliceToBobMsg.ciphertext]); + XCTAssertFalse([bobSession matchesInboundSessionFrom:aliceIdKey oneTimeKeyMessage:@"ARandomOtkMessage"]); + BOOL success = [bob removeOneTimeKeysForSession:bobSession]; XCTAssertTrue(success); } @@ -96,8 +105,6 @@ XCTAssertEqualObjects(msg1, dMsg1); XCTAssertEqualObjects(msg2, dMsg2); XCTAssertEqualObjects(msg3, dMsg3); - - } - (void) testAccountSerialization { |