From 59076a6bda54c90a257eaf3dae32aad7ad178d31 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 23 Oct 2018 15:47:46 +0200 Subject: [PATCH 1/4] OLMKit: Expose PK private key length --- xcode/OLMKit/OLMPkDecryption.h | 7 +++++++ xcode/OLMKit/OLMPkDecryption.m | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/xcode/OLMKit/OLMPkDecryption.h b/xcode/OLMKit/OLMPkDecryption.h index 8715a99..823dc78 100644 --- a/xcode/OLMKit/OLMPkDecryption.h +++ b/xcode/OLMKit/OLMPkDecryption.h @@ -59,6 +59,13 @@ NS_ASSUME_NONNULL_BEGIN */ - (NSString *)decryptMessage:(OLMPkMessage*)message error:(NSError* _Nullable *)error; +/** + Private key length. + + @return the length in bytes. + */ ++ (NSUInteger)privateKeyLength; + @end NS_ASSUME_NONNULL_END diff --git a/xcode/OLMKit/OLMPkDecryption.m b/xcode/OLMKit/OLMPkDecryption.m index 75fe5f2..4af2c71 100644 --- a/xcode/OLMKit/OLMPkDecryption.m +++ b/xcode/OLMKit/OLMPkDecryption.m @@ -130,7 +130,7 @@ return privateKey; } --(NSString *)decryptMessage:(OLMPkMessage *)message error:(NSError *__autoreleasing _Nullable *)error { +- (NSString *)decryptMessage:(OLMPkMessage *)message error:(NSError *__autoreleasing _Nullable *)error { NSData *messageData = [message.ciphertext dataUsingEncoding:NSUTF8StringEncoding]; NSData *macData = [message.mac dataUsingEncoding:NSUTF8StringEncoding]; NSData *ephemeralKeyData = [message.ephemeralKey dataUsingEncoding:NSUTF8StringEncoding]; @@ -189,6 +189,10 @@ return plaintext; } ++ (NSUInteger)privateKeyLength { + return olm_pk_private_key_length(); +} + #pragma mark OLMSerializable /** Initializes from encrypted serialized data. Will throw error if invalid key or invalid base64. */ From 739f3c03919e3ce22b278d6f39a49da833200c2f Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 23 Oct 2018 15:48:53 +0200 Subject: [PATCH 2/4] OLMKit: Maintenance: Update Podfile.lock --- xcode/Podfile.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/xcode/Podfile.lock b/xcode/Podfile.lock index ecafd79..e9099c4 100644 --- a/xcode/Podfile.lock +++ b/xcode/Podfile.lock @@ -1,20 +1,20 @@ PODS: - - OLMKit (2.0.1): - - OLMKit/olmc (= 2.0.1) - - OLMKit/olmcpp (= 2.0.1) - - OLMKit/olmc (2.0.1) - - OLMKit/olmcpp (2.0.1) + - OLMKit (2.3.0): + - OLMKit/olmc (= 2.3.0) + - OLMKit/olmcpp (= 2.3.0) + - OLMKit/olmc (2.3.0) + - OLMKit/olmcpp (2.3.0) DEPENDENCIES: - OLMKit (from `../OLMKit.podspec`) EXTERNAL SOURCES: OLMKit: - :path: ../OLMKit.podspec + :path: "../OLMKit.podspec" SPEC CHECKSUMS: - OLMKit: 12a35a69f92c7facdd50b559128d1b4a17857ba7 + OLMKit: 6af55a19917c35f86df5198c213979ecdf8ba76e PODFILE CHECKSUM: 4e261dae61d833ec5585ced2473023b98909fd35 -COCOAPODS: 1.1.1 +COCOAPODS: 1.6.0.beta.2 From 4e120a0eeb31241316a4a47b166108a7917bd7a4 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 23 Oct 2018 15:55:52 +0200 Subject: [PATCH 3/4] OLMKit: Fix file name case --- xcode/OLMKit/{OLMPKEncryption.h => OLMPkEncryption.h} | 0 xcode/OLMKit/{OLMPKEncryption.m => OLMPkEncryption.m} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename xcode/OLMKit/{OLMPKEncryption.h => OLMPkEncryption.h} (100%) rename xcode/OLMKit/{OLMPKEncryption.m => OLMPkEncryption.m} (100%) diff --git a/xcode/OLMKit/OLMPKEncryption.h b/xcode/OLMKit/OLMPkEncryption.h similarity index 100% rename from xcode/OLMKit/OLMPKEncryption.h rename to xcode/OLMKit/OLMPkEncryption.h diff --git a/xcode/OLMKit/OLMPKEncryption.m b/xcode/OLMKit/OLMPkEncryption.m similarity index 100% rename from xcode/OLMKit/OLMPKEncryption.m rename to xcode/OLMKit/OLMPkEncryption.m From c0d118f407ee2b0956bad2cccb5e61e6c472d533 Mon Sep 17 00:00:00 2001 From: manuroe Date: Tue, 23 Oct 2018 16:07:34 +0200 Subject: [PATCH 4/4] OLMKit: Fix typo in license header --- xcode/OLMKit/OLMPkEncryption.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xcode/OLMKit/OLMPkEncryption.h b/xcode/OLMKit/OLMPkEncryption.h index a55d5bc..6ae767c 100644 --- a/xcode/OLMKit/OLMPkEncryption.h +++ b/xcode/OLMKit/OLMPkEncryption.h @@ -5,7 +5,7 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0OLMPKEncryption + http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.