mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 18:26:57 +00:00
Upgrade to libsignal 0.56.0
This commit is contained in:
committed by
mtang-signal
parent
9b23264502
commit
a76d400bd1
@@ -77,7 +77,7 @@ public final class PreKeyMigrationHelper {
|
||||
contentValues.put(SignedPreKeyTable.TIMESTAMP, signedPreKey.getTimestamp());
|
||||
database.insert(SignedPreKeyTable.TABLE_NAME, null, contentValues);
|
||||
Log.i(TAG, "Migrated signed prekey: " + signedPreKey.getId());
|
||||
} catch (IOException | InvalidMessageException e) {
|
||||
} catch (IOException | InvalidMessageException | InvalidKeyException e) {
|
||||
Log.w(TAG, e);
|
||||
clean = false;
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.thoughtcrime.securesms.jobs
|
||||
import androidx.annotation.VisibleForTesting
|
||||
import org.signal.core.util.logging.Log
|
||||
import org.signal.core.util.roundedString
|
||||
import org.signal.libsignal.protocol.InvalidKeyException
|
||||
import org.signal.libsignal.protocol.state.KyberPreKeyRecord
|
||||
import org.signal.libsignal.protocol.state.PreKeyRecord
|
||||
import org.signal.libsignal.protocol.state.SignalProtocolStore
|
||||
@@ -258,18 +259,23 @@ class PreKeysSyncJob private constructor(
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun checkPreKeyConsistency(serviceIdType: ServiceIdType, protocolStore: SignalServiceAccountDataStore, metadataStore: PreKeyMetadataStore): Boolean {
|
||||
val result: NetworkResult<Unit> = AppDependencies.signalServiceAccountManager.keysApi.checkRepeatedUseKeys(
|
||||
serviceIdType = serviceIdType,
|
||||
identityKey = protocolStore.identityKeyPair.publicKey,
|
||||
signedPreKeyId = metadataStore.activeSignedPreKeyId,
|
||||
signedPreKey = protocolStore.loadSignedPreKey(metadataStore.activeSignedPreKeyId).keyPair.publicKey,
|
||||
lastResortKyberKeyId = metadataStore.lastResortKyberPreKeyId,
|
||||
lastResortKyberKey = protocolStore.loadKyberPreKey(metadataStore.lastResortKyberPreKeyId).keyPair.publicKey
|
||||
)
|
||||
val result: NetworkResult<Unit> = try {
|
||||
AppDependencies.signalServiceAccountManager.keysApi.checkRepeatedUseKeys(
|
||||
serviceIdType = serviceIdType,
|
||||
identityKey = protocolStore.identityKeyPair.publicKey,
|
||||
signedPreKeyId = metadataStore.activeSignedPreKeyId,
|
||||
signedPreKey = protocolStore.loadSignedPreKey(metadataStore.activeSignedPreKeyId).keyPair.publicKey,
|
||||
lastResortKyberKeyId = metadataStore.lastResortKyberPreKeyId,
|
||||
lastResortKyberKey = protocolStore.loadKyberPreKey(metadataStore.lastResortKyberPreKeyId).keyPair.publicKey
|
||||
)
|
||||
} catch (e: InvalidKeyException) {
|
||||
Log.w(TAG, "Unable to load keys", e)
|
||||
return false
|
||||
}
|
||||
|
||||
return when (result) {
|
||||
is NetworkResult.Success -> true
|
||||
is NetworkResult.NetworkError -> throw result.exception ?: PushNetworkException("Network error")
|
||||
is NetworkResult.NetworkError -> throw result.exception
|
||||
is NetworkResult.ApplicationError -> throw result.throwable
|
||||
is NetworkResult.StatusCodeError -> if (result.code == 409) {
|
||||
false
|
||||
|
||||
Reference in New Issue
Block a user