Skip to content

Commit

Permalink
Merge branch 'release/0.23.17/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanceriu committed Aug 31, 2022
2 parents 34d6188 + d5e8b01 commit 49a7cc2
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 7 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Changes in 0.23.17 (2022-08-31)

🙌 Improvements

- KeyBackups: Add build flag for symmetric backup ([#1567](https://github.com/matrix-org/matrix-ios-sdk/pull/1567))


## Changes in 0.23.16 (2022-08-24)

✨ Features
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixSDK"
s.version = "0.23.16"
s.version = "0.23.17"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down
17 changes: 13 additions & 4 deletions MatrixSDK/Crypto/KeyBackup/MXKeyBackup.m
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,19 @@ @implementation MXKeyBackup

+ (void)initialize
{
AlgorithmClassesByName = @{
kMXCryptoCurve25519KeyBackupAlgorithm: MXCurve25519KeyBackupAlgorithm.class,
kMXCryptoAes256KeyBackupAlgorithm: MXAes256KeyBackupAlgorithm.class
};
if (MXSDKOptions.sharedInstance.enableSymmetricBackup)
{
AlgorithmClassesByName = @{
kMXCryptoCurve25519KeyBackupAlgorithm: MXCurve25519KeyBackupAlgorithm.class,
kMXCryptoAes256KeyBackupAlgorithm: MXAes256KeyBackupAlgorithm.class
};
}
else
{
AlgorithmClassesByName = @{
kMXCryptoCurve25519KeyBackupAlgorithm: MXCurve25519KeyBackupAlgorithm.class,
};
}
DefaultAlgorithmClass = MXCurve25519KeyBackupAlgorithm.class;
}

Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/Crypto/MXCrypto.m
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,9 @@ - (MXEventDecryptionResult *)decryptEvent2:(MXEvent *)event inTimeline:(NSString
NSDictionary *details = @{
@"event_id": event.eventId ?: @"unknown",
@"error": result.error ?: @"unknown",
@"event": event.JSONDictionary ?: @"unknown"
};
MXLogErrorDetails(@"[MXCrypto] decryptEvent", details);
MXLogDebug(@"[MXCrypto] decryptEvent: Unable to decrypt event %@", event.JSONDictionary);

if ([result.error.domain isEqualToString:MXDecryptingErrorDomain]
&& result.error.code == MXDecryptingErrorBadEncryptedMessageCode)
Expand Down
7 changes: 7 additions & 0 deletions MatrixSDK/MXSDKOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,13 @@ NS_ASSUME_NONNULL_BEGIN

#endif

/**
Enable symmetric room key backups
@remark NO by default
*/
@property (nonatomic) BOOL enableSymmetricBackup;

@end

NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions MatrixSDK/MXSDKOptions.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ - (instancetype)init
#if DEBUG
_enableCryptoV2 = NO;
#endif

_enableSymmetricBackup = NO;
}

return self;
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/MatrixSDKVersion.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@

#import <Foundation/Foundation.h>

NSString *const MatrixSDKVersion = @"0.23.16";
NSString *const MatrixSDKVersion = @"0.23.17";
10 changes: 10 additions & 0 deletions MatrixSDKTests/MXAes256KeyBackupTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ @interface MXAes256KeyBackupTests : MXBaseKeyBackupTests

@implementation MXAes256KeyBackupTests

- (void)setUp
{
MXSDKOptions.sharedInstance.enableSymmetricBackup = YES;
}

- (void)tearDown
{
MXSDKOptions.sharedInstance.enableSymmetricBackup = NO;
}

- (NSString *)algorithm
{
return kMXCryptoAes256KeyBackupAlgorithm;
Expand Down

0 comments on commit 49a7cc2

Please sign in to comment.