From 076a97696137da8ee4d193bdefc7574cf497bbea Mon Sep 17 00:00:00 2001 From: Jordan Rose Date: Mon, 24 Jan 2022 16:02:20 -0800 Subject: [PATCH] Remove now-unnecessary 'version' parameters from HKDF calls SignalClient used to support a non-standard version of HKDF as "version 2" (numbered for an old version of the Signal protocol), and the standard one as "version 3". Now only the standard version is supported, so the parameter is unnecessary. --- SignalMessaging/groups/GroupsV2Migration.swift | 4 ++-- SignalServiceKit/src/Devices/OWSProvisioningCipher.swift | 4 ++-- SignalServiceKit/src/Devices/ProvisioningCipher.swift | 4 ++-- SignalServiceKit/src/Messages/Stickers/StickerManager.swift | 2 +- .../src/Remote Attestation/RemoteAttestation.swift | 3 +-- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/SignalMessaging/groups/GroupsV2Migration.swift b/SignalMessaging/groups/GroupsV2Migration.swift index 39ce1ab31b..ac6d2df547 100644 --- a/SignalMessaging/groups/GroupsV2Migration.swift +++ b/SignalMessaging/groups/GroupsV2Migration.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2021 Open Whisper Systems. All rights reserved. +// Copyright (c) 2022 Open Whisper Systems. All rights reserved. // import Foundation @@ -1063,7 +1063,7 @@ fileprivate extension GroupsV2Migration { } let migrationInfo = "GV2 Migration" let masterKey = try migrationInfo.utf8.withContiguousStorageIfAvailable { - try hkdf(outputLength: GroupMasterKey.SIZE, version: 3, inputKeyMaterial: v1GroupId, salt: [], info: $0) + try hkdf(outputLength: GroupMasterKey.SIZE, inputKeyMaterial: v1GroupId, salt: [], info: $0) }! return Data(masterKey) } diff --git a/SignalServiceKit/src/Devices/OWSProvisioningCipher.swift b/SignalServiceKit/src/Devices/OWSProvisioningCipher.swift index c7d7b68ab0..e1eb9d6b22 100644 --- a/SignalServiceKit/src/Devices/OWSProvisioningCipher.swift +++ b/SignalServiceKit/src/Devices/OWSProvisioningCipher.swift @@ -1,5 +1,5 @@ // -// Copyright (c) 2021 Open Whisper Systems. All rights reserved. +// Copyright (c) 2022 Open Whisper Systems. All rights reserved. // import CommonCrypto @@ -60,7 +60,7 @@ public class OWSProvisioningCipher: NSObject { let infoData = ProvisioningCipher.messageInfo let derivedSecret: [UInt8] = try infoData.utf8.withContiguousStorageIfAvailable { let totalLength = Self.cipherKeyLength + Self.macKeyLength - return try hkdf(outputLength: totalLength, version: 3, inputKeyMaterial: sharedSecret, salt: [], info: $0) + return try hkdf(outputLength: totalLength, inputKeyMaterial: sharedSecret, salt: [], info: $0) }! let cipherKey = derivedSecret[0..