From 7ee17a295738f0db8cab74cec2343a577f2ade45 Mon Sep 17 00:00:00 2001 From: manuroe Date: Mon, 14 Nov 2016 17:35:24 +0100 Subject: OLMKit: Add missing implementations for matchesInboundSession matchesInboundSessionFrom --- xcode/OLMKitTests/OLMKitTests.m | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'xcode/OLMKitTests') 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 { -- cgit v1.2.3