File tree 2 files changed +6
-10
lines changed
2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -80,7 +80,9 @@ - (void)testBasicPreKey {
80
80
XCTAssert ([outgoingMessage isKindOfClass: [PreKeyWhisperMessage class ]], @" Message should be PreKey type" );
81
81
82
82
PreKeyWhisperMessage *incomingMessage = (PreKeyWhisperMessage*)outgoingMessage;
83
- [bobStore storePreKey: 31337 preKeyRecord: [[PreKeyRecord alloc ] initWithId: bobPreKey.preKeyId keyPair: bobPreKeyPair]];
83
+ [bobStore storePreKey: 31337 preKeyRecord: [[PreKeyRecord alloc ] initWithId: bobPreKey.preKeyId
84
+ keyPair: bobPreKeyPair
85
+ createdAt: [NSDate date ]]];
84
86
[bobStore storeSignedPreKey: 22 signedPreKeyRecord: [[SignedPreKeyRecord alloc ] initWithId: 22 keyPair: bobSignedPreKeyPair signature: bobSignedPreKeySignature generatedAt: [NSDate date ]]];
85
87
86
88
SessionCipher *bobSessionCipher = [[SessionCipher alloc ] initWithAxolotlStore: bobStore recipientId: ALICE_RECIPIENT_ID deviceId: 1 ];
Original file line number Diff line number Diff line change 7
7
8
8
NS_ASSUME_NONNULL_BEGIN
9
9
10
- @interface ECKeyPair (ECKeyPairTestingPrivate)
11
-
12
- - (nullable id )initWithPublicKey : (NSData *)publicKey privateKey : (NSData *)privateKey ;
13
-
14
- @end
15
-
16
- #pragma mark -
17
-
18
10
@implementation ECKeyPair (testing)
19
11
20
12
+ (ECKeyPair *)throws_keyPairWithPrivateKey : (NSData *)privateKey publicKey : (NSData *)publicKey
@@ -27,7 +19,9 @@ + (ECKeyPair *)throws_keyPairWithPrivateKey:(NSData *)privateKey publicKey:(NSDa
27
19
@throw [NSException exceptionWithName: NSInvalidArgumentException reason: @" Public or Private key is not required size" userInfo: @{@" PrivateKey" :privateKey, @" Public Key" :publicKey}];
28
20
}
29
21
30
- ECKeyPair *keyPairCopy = [[ECKeyPair alloc ] initWithPublicKey: [publicKey copy ] privateKey: [privateKey copy ]];
22
+ NSError *error;
23
+ ECKeyPair *_Nullable keyPairCopy = [[ECKeyPair alloc ] initWithPublicKeyData: [publicKey copy ] privateKeyData: [privateKey copy ] error: &error];
24
+ OWSAssertDebug (error == nil && keyPairCopy != nil );
31
25
return keyPairCopy;
32
26
}
33
27
You can’t perform that action at this time.
0 commit comments