Rotate profile key if blocklist intersects profile whitelist.

This commit is contained in:
Matthew Chen 2018-10-10 08:59:47 -04:00
parent c907721a18
commit 0ce2e4d4d9
1 changed files with 4 additions and 0 deletions

View File

@ -530,6 +530,10 @@ const NSUInteger kOWSProfileManager_MaxAvatarDiameter = 640;
- (nullable NSData *)groupIdForGroupKey:(NSString *)groupKey {
NSMutableData *groupId = [NSMutableData new];
if (groupKey.length % 2 != 0) {
OWSFailDebug(@"Group key has unexpected length: %@ (%lu)", groupKey, (unsigned long)groupKey.length);
return nil;
}
for (NSUInteger i = 0; i + 2 <= groupKey.length; i += 2) {
NSString *_Nullable byteString = [groupKey substringWithRange:NSMakeRange(i, 2)];
if (!byteString) {