This repository has been archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chose contact identifiers as strings, should help to move it to email identifiers.
- Loading branch information
1 parent
dc2cc60
commit 9421f39
Showing
12 changed files
with
57 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,8 +43,8 @@ - (void)tearDown { | |
|
||
- (void)testBasicPreKey { | ||
|
||
long BOB_RECIPIENT_ID = 5L; | ||
long ALICE_RECIPIENT_ID = 3L; | ||
NSString *BOB_RECIPIENT_ID = @"+3828923892"; | ||
NSString *ALICE_RECIPIENT_ID = @"[email protected]"; | ||
|
||
AxolotlInMemoryStore *aliceStore = [AxolotlInMemoryStore new]; | ||
SessionBuilder *aliceSessionBuilder = [[SessionBuilder alloc] initWithAxolotlStore:aliceStore recipientId:BOB_RECIPIENT_ID deviceId:1]; | ||
|
@@ -93,8 +93,8 @@ - (void)testBasicPreKey { | |
|
||
- (void)testBasicPreKeyMITM { | ||
|
||
long BOB_RECIPIENT_ID = 5L; | ||
long ALICE_RECIPIENT_ID = 3L; | ||
NSString *BOB_RECIPIENT_ID = @"+3828923892"; | ||
NSString *ALICE_RECIPIENT_ID = @"[email protected]"; | ||
|
||
AxolotlInMemoryStore *aliceStore = [AxolotlInMemoryStore new]; | ||
SessionBuilder *aliceSessionBuilder = [[SessionBuilder alloc] initWithAxolotlStore:aliceStore recipientId:BOB_RECIPIENT_ID deviceId:1]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,20 +69,21 @@ -(void)sessionInitialization:(SessionState*)aliceSessionState bobSessionState:(S | |
|
||
- (void)runInteractionWithAliceRecord:(SessionRecord*)aliceSessionRecord bobRecord:(SessionRecord*)bobSessionRecord { | ||
|
||
NSString *aliceIdentifier = @"+3728378173821"; | ||
NSString *bobIdentifier = @"[email protected]"; | ||
|
||
AxolotlInMemoryStore *aliceStore = [AxolotlInMemoryStore new]; | ||
AxolotlInMemoryStore *bobStore = [AxolotlInMemoryStore new]; | ||
|
||
[aliceStore storeSession:2L deviceId:1 session:aliceSessionRecord]; | ||
[bobStore storeSession:3L deviceId:1 session:bobSessionRecord]; | ||
[aliceStore storeSession:bobIdentifier deviceId:1 session:aliceSessionRecord]; | ||
[bobStore storeSession:aliceIdentifier deviceId:1 session:bobSessionRecord]; | ||
|
||
SessionCipher *aliceSessionCipher = [[SessionCipher alloc] initWithAxolotlStore:aliceStore recipientId:2L deviceId:1]; | ||
SessionCipher *bobSessionCipher = [[SessionCipher alloc] initWithAxolotlStore:bobStore recipientId:3L deviceId:1]; | ||
SessionCipher *aliceSessionCipher = [[SessionCipher alloc] initWithAxolotlStore:aliceStore recipientId:bobIdentifier deviceId:1]; | ||
SessionCipher *bobSessionCipher = [[SessionCipher alloc] initWithAxolotlStore:bobStore recipientId:aliceIdentifier deviceId:1]; | ||
|
||
NSData *alicePlainText = [@"This is a plaintext message!" dataUsingEncoding:NSUTF8StringEncoding]; | ||
WhisperMessage *cipherText = [aliceSessionCipher encryptMessage:alicePlainText]; | ||
|
||
|
||
|
||
NSData *bobPlaintext = [bobSessionCipher decrypt:cipherText]; | ||
|
||
XCTAssert([bobPlaintext isEqualToData:alicePlainText]); | ||
|
Binary file modified
BIN
+20 Bytes
(100%)
....xcodeproj/project.xcworkspace/xcuserdata/fred.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters