Skip to content

Commit

Permalink
v0.12.3 (611)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaigner committed May 9, 2023
1 parent fd690a1 commit bb7810b
Show file tree
Hide file tree
Showing 569 changed files with 22,793 additions and 5,854 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.en.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [0.12.3 (611)] - 2023-01-11

- Introducing a long awaited feature! You can now create as many (independent) profiles as you want! For example, you can create one for family and friends and another for work.
- A profile can be "hidden": showing it back requires a specific password. For an extra layer of privacy!
- If a profile is allowed to make secure outgoing calls, all other profiles are as well.
- Certain notifications were received twice, this is fixed.
- iPad users with a physical keyboard can send messages by simply tapping Command + Return.
- You can now clone any group, even if you are not administrator of the group.
- Improved experience when sharing with Olvid: a list of all selected discussions now appears on top of the available discussions.
- When forwarding a previously sent message, the forwarded message does not show the "forward" sign anymore.
- Improves the virtual keyboard dismissal under iOS 15.5+.
- It was not possible to have a white space when specifying a first name or a last name. This is fixed.
- Certain link previews could "spin" forever. This is fixed.
- Many minor bugfixes for iOS 13 and iPadOS.
- Fixes animation issues of the composition view.
- Other minor bugfixes.

## [0.12.2 (602)] - 2022-11-29

- New redesigned (and more efficient!) list of recent discussions under iOS 16!
Expand Down
17 changes: 17 additions & 0 deletions CHANGELOG.fr.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## [0.12.3 (611)] - 2023-01-11

- Vous l'attendiez tous... Vous pouvez maintenant créer autant de profils (indépendants) que vous voulez ! Par exemple, vous pouvez créer un profil pour la famille et les amis et un autre pour vos activités professionnelles.
- Un profil peut être « masqué » : pour l'afficher, il vous faudra entrer un mot de passe.
- Si un profil a le droit de passer des appels sécurisés, tous les profils ont automatiquement ce droit.
- Certaines notifications étaient affichées deux fois, c'est corrigé.
- Les utilisateurs iPad avec un clavier physique peuvent envoyer un message en appuyant sur Command + Entrée.
- Vous pouvez maintenant cloner n'importe quel groupe, même si vous n'en êtes pas l'administrateur.
- Amélioration de l'expérience de partage via Olvid : une liste des discussions sélectionnées s'affiche au dessus des discussions disponibles.
- Si vous transférez un message que vous aviez écrit vous-même, le message transféré n'indiquera plus la mention « Transféré ».
- Améliore le comportement du clavier virtuel sous iOS 15.5+
- Il n'était pas possible d'avoir d'espace dans son nom ou prénom, c'est corrigé.
- Certaines pré-visualisations de lien pouvaient échouer. C'est corrigé.
- Corrections mineures pour iOS 13 et pour iPadOS.
- Corrige des bugs d'animation de la zone de composition de message.
- Autres corrections mineures.

## [0.12.2 (602)] - 2022-11-29

- Refonte complète de la liste des discussions récentes sous iOS 16 !
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,9 @@ extension ObvBackupManagerImplementation: ObvBackupDelegate {

try await restoreBackupableManagerObjects(backupableManagerObjects: backupableManagerObjects, fullBackup: fullBackup, backupRequestIdentifier: backupRequestIdentifier)

// Restore the app object
// Restore the app object (the internalJson may be nil for very old backups, made at a time when the app did not provide backup data).

guard let internalJson = fullBackup.allInternalJsonAndIdentifier[backupableAppObject.backupSource]?[backupableAppObject.backupIdentifier] else {
os_log("Could not recover the internal backup of the app (identified by key %{public}@)", log: log, type: .default, backupableAppObject.backupIdentifier)
throw Self.makeError(message: "Could not recover the internal backup of the app")
}

let internalJson = fullBackup.allInternalJsonAndIdentifier[backupableAppObject.backupSource]?[backupableAppObject.backupIdentifier]
try await backupableAppObject.restoreBackup(backupRequestIdentifier: backupRequestIdentifier, internalJson: internalJson)

// If we reach this point, the full backup was restored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ final class ObvLocalChannel: ObvChannel {
receptionChannelInfo: .Local,
encodedElements: message.encodedElements)

try protocolDelegate.process(receivedMessage, within: obvContext)
os_log("Processing a posted protocol message with a (just created) messageId %{public}@", log: log, type: .info, messageId.debugDescription)
try protocolDelegate.processProtocolReceivedMessage(receivedMessage, within: obvContext)

return messageId

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,19 @@ extension NetworkReceivedMessageDecryptor {
let log = OSLog(subsystem: delegateManager.logSubsystem, category: NetworkReceivedMessageDecryptor.logCategory)

guard let protocolDelegate = delegateManager.protocolDelegate else {
assertionFailure()
os_log("The protocol delegate is not set", log: log, type: .fault)
return
}

guard let notificationDelegate = delegateManager.notificationDelegate else {
assertionFailure()
os_log("The notification delegate is not set", log: log, type: .fault)
return
}

guard let networkFetchDelegate = delegateManager.networkFetchDelegate else {
assertionFailure()
os_log("The network fetch delegate is not set", log: log, type: .fault)
return
}
Expand All @@ -136,10 +144,13 @@ extension NetworkReceivedMessageDecryptor {

case .ProtocolMessage:
os_log("🔑 New protocol message with id %{public}@", log: log, type: .info, receivedMessage.messageId.debugDescription)
ObvChannelNotification.protocolMessageDecrypted(protocolMessageId: receivedMessage.messageId, flowId: obvContext.flowId)
.postOnBackgroundQueue(within: notificationDelegate)
if let receivedProtocolMessage = ReceivedProtocolMessage(with: obvChannelReceivedMessage) {
let protocolReceivedMessage = receivedProtocolMessage.protocolReceivedMessage
do {
try protocolDelegate.process(protocolReceivedMessage, within: obvContext)
os_log("Processing a decrypted received protocol message with messageId %{public}@", log: log, type: .info, protocolReceivedMessage.messageId.debugDescription)
try protocolDelegate.processProtocolReceivedMessage(protocolReceivedMessage, within: obvContext)
} catch {
os_log("A received protocol message could not be processed", log: log, type: .error)
}
Expand All @@ -152,6 +163,7 @@ extension NetworkReceivedMessageDecryptor {

case .ApplicationMessage:
os_log("🔑🌊 New application message within flow %{public}@ with id %{public}@", log: log, type: .info, obvContext.flowId.debugDescription, receivedMessage.messageId.debugDescription)
// We do not post an applicationMessageDecrypted notification, this is done by the Network Fetch Manager.
if let receivedApplicationMessage = ReceivedApplicationMessage(with: obvChannelReceivedMessage) {
do {
// At this point, we expect the `knownAttachmentCount` of the `obvChannelReceivedMessage` to be set and equal to `receivedApplicationMessage.attachmentsInfos`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ final class ObvObliviousChannel: NSManagedObject, ObvManagedObject, ObvNetworkCh
self.timestampOfLastFullRatchetSentMessage = now

// Using the seed, we derive the seedForNextSendKey and compute the first provision (which contains the seedForNextProvisionedReceiveKey).
guard let sendSeed = seed.diversify(with: currentDeviceUid, withCryptoSuite: cryptoSuiteVersion) else { return nil }
guard let sendSeed = seed.diversify(with: currentDeviceUid, withCryptoSuite: cryptoSuiteVersion) else { assertionFailure(); return nil }
self.seedForNextSendKey = sendSeed
guard let recvSeed = seed.diversify(with: remoteDeviceUid, withCryptoSuite: cryptoSuiteVersion) else { return nil }
guard let recvSeed = seed.diversify(with: remoteDeviceUid, withCryptoSuite: cryptoSuiteVersion) else { assertionFailure(); return nil }

self.provisions = Set<Provision>()
guard let provision = Provision(fullRatchetingCount: 0,
obliviousChannel: self,
seedForNextProvisionedReceiveKey: recvSeed) else { return nil }
seedForNextProvisionedReceiveKey: recvSeed) else { assertionFailure(); return nil }
self.provisions.insert(provision)
}

Expand Down Expand Up @@ -460,11 +460,11 @@ extension ObvObliviousChannel {
currentDeviceUidKey, currentDeviceUid,
remoteDeviceUidKey, remoteDeviceUid,
remoteCryptoIdentityKey, remoteIdentity)
guard let channel = try obvContext.fetch(request).first else {
return
let channels = try obvContext.fetch(request)
for channel in channels {
channel.obvContext = obvContext
obvContext.delete(channel)
}
channel.obvContext = obvContext
obvContext.delete(channel)
}


Expand All @@ -480,14 +480,26 @@ extension ObvObliviousChannel {
return Set(identities)
}


static func getAllKnownRemoteDeviceUids(within obvContext: ObvContext) throws -> Set<ObliviousChannelIdentifier> {
let request: NSFetchRequest<ObvObliviousChannel> = ObvObliviousChannel.fetchRequest()
let items = try obvContext.fetch(request)
_ = items.map { $0.obvContext = obvContext }
let values = Set(items.map { ObliviousChannelIdentifier(currentDeviceUid: $0.currentDeviceUid, remoteCryptoIdentity: $0.remoteCryptoIdentity, remoteDeviceUid: $0.remoteDeviceUid) })
return values

}


static func deleteAllObliviousChannelsForCurrentDeviceUid(_ currentDeviceUid: UID, within obvContext: ObvContext) throws {
let request: NSFetchRequest<ObvObliviousChannel> = ObvObliviousChannel.fetchRequest()
request.fetchBatchSize = 500
request.predicate = NSPredicate(format: "%K == %@", currentDeviceUidKey, currentDeviceUid)
request.propertiesToFetch = []
let channels = try obvContext.fetch(request)
for channel in channels {
channel.obvContext = obvContext
obvContext.delete(channel)
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,18 +267,21 @@ extension ObvChannelManagerImplementation {
// MARK: Oblivious Channels management

public func deleteObliviousChannelBetweenTheCurrentDeviceOf(ownedIdentity: ObvCryptoIdentity, andTheRemoteDeviceWithUid remoteDeviceUid: UID, ofRemoteIdentity remoteIdentity: ObvCryptoIdentity, within obvContext: ObvContext) throws {
os_log("🚗 deleteObliviousChannelBetweenTheCurrentDeviceOf", log: log, type: .info)
try gateKeeper.waitUntilSlotIsAvailableForObvContext(obvContext)
try delegateManager.obliviousChannelLifeDelegate.deleteObliviousChannelBetweenTheCurrentDeviceOf(ownedIdentity: ownedIdentity, andTheRemoteDeviceWithUid: remoteDeviceUid, ofRemoteIdentity: remoteIdentity, within: obvContext)
}


public func deleteObliviousChannelBetweenCurentDeviceWithUid(currentDeviceUid: UID, andTheRemoteDeviceWithUid remoteDeviceUid: UID, ofRemoteIdentity remoteIdentity: ObvCryptoIdentity, within obvContext: ObvContext) throws {
os_log("🚗 deleteObliviousChannelBetweenCurentDeviceWithUid", log: log, type: .info)
try gateKeeper.waitUntilSlotIsAvailableForObvContext(obvContext)
try delegateManager.obliviousChannelLifeDelegate.deleteObliviousChannelBetweenCurentDeviceWithUid(currentDeviceUid: currentDeviceUid, andTheRemoteDeviceWithUid: remoteDeviceUid, ofRemoteIdentity: remoteIdentity, within: obvContext)
}


public func deleteAllObliviousChannelsBetweenTheCurrentDeviceOf(ownedIdentity: ObvCryptoIdentity, andTheDevicesOfContactIdentity contactIdentity: ObvCryptoIdentity, within obvContext: ObvContext) throws {
os_log("🚗 deleteAllObliviousChannelsBetweenTheCurrentDeviceOf", log: log, type: .info)
try gateKeeper.waitUntilSlotIsAvailableForObvContext(obvContext)
try delegateManager.obliviousChannelLifeDelegate.deleteAllObliviousChannelsBetweenTheCurrentDeviceOf(ownedIdentity: ownedIdentity, andTheDevicesOfContactIdentity: contactIdentity, within: obvContext)
}
Expand Down Expand Up @@ -348,6 +351,12 @@ extension ObvChannelManagerImplementation {
return try ObvObliviousChannel.getAllKnownRemoteDeviceUids(within: obvContext)
}


public func deleteAllObliviousChannelsWithTheCurrentDeviceUid(_ currentDeviceUid: UID, within obvContext: ObvContext) throws {
try gateKeeper.waitUntilSlotIsAvailableForObvContext(obvContext)
try ObvObliviousChannel.deleteAllObliviousChannelsForCurrentDeviceUid(currentDeviceUid, within: obvContext)
}

}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1400"
LastUpgradeVersion = "1420"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
12 changes: 12 additions & 0 deletions Engine/ObvCrypto/ObvCrypto/ObvCryptoIdentity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ public final class ObvCryptoIdentity: NSObject, NSCopying, ObvCodable {
identity.append(publicKeyForPublicKeyEncryption.getCompactKey())
return identity
}

// MARK: - Implementing LosslessStringConvertible

public override var description: String {
getIdentity().hexString()
}

public convenience init?(_ description: String) {
guard let identity = Data(hexString: description) else { assertionFailure(); return nil }
self.init(from: identity)
}

}

// MARK: Implementing Hashable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ final class ProofOfWorkEngineSyndromeBased: ProofOfWorkEngine {
}

private static func decode(_ challenge: ObvEncoded) -> (H: Matrix, S: Column)? {
guard let listOfEncodedElements = [ObvEncoded].init(challenge) else { return nil }
guard let listOfEncodedElements = [ObvEncoded](challenge) else { return nil }
guard listOfEncodedElements.count == 2 else { return nil }
// Decode H
guard let seed = Seed(listOfEncodedElements[0]) else { return nil }
Expand Down
30 changes: 27 additions & 3 deletions Engine/ObvCrypto/ObvCrypto/SymmetricPrimitives/PBKDF.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,24 @@ import OlvidUtils
public final class PBKDF: ObvErrorMaker {

public static var errorDomain: String { "PBKDF" }

public static func pbkdf2sha256(password: String, salt: Data, rounds: UInt32, derivedKeyLength: Int) throws -> Data {
let hash = CCPseudoRandomAlgorithm(kCCPRFHmacAlgSHA256)

private enum HashFunction {
case sha1
case sha256

var algorithm: CCPseudoRandomAlgorithm {
switch self {
case .sha1:
return CCPseudoRandomAlgorithm(kCCPRFHmacAlgSHA1)
case .sha256:
return CCPseudoRandomAlgorithm(kCCPRFHmacAlgSHA256)
}
}

}

private static func pbkdf2(hashFunction: HashFunction, password: String, salt: Data, rounds: UInt32, derivedKeyLength: Int) throws -> Data {
let hash = hashFunction.algorithm
var derivedKey = [UInt8](repeating: 0, count: derivedKeyLength)
let status: Int32 = salt.withUnsafeBytes { unsafeBytes in
guard let saltBytes = unsafeBytes.bindMemory(to: UInt8.self).baseAddress else {
Expand All @@ -50,4 +65,13 @@ public final class PBKDF: ObvErrorMaker {
}


public static func pbkdf2sha256(password: String, salt: Data, rounds: UInt32, derivedKeyLength: Int) throws -> Data {
return try pbkdf2(hashFunction: .sha256, password: password, salt: salt, rounds: rounds, derivedKeyLength: derivedKeyLength)
}


public static func pbkdf2sha1(password: String, salt: Data, rounds: UInt32, derivedKeyLength: Int) throws -> Data {
return try pbkdf2(hashFunction: .sha1, password: password, salt: salt, rounds: rounds, derivedKeyLength: derivedKeyLength)
}

}
Loading

0 comments on commit bb7810b

Please sign in to comment.