mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-25 23:47:26 +00:00
Move to Signal Protocol written in Rust.
Co-authored-by: Alex Hart <alex@signal.org>
This commit is contained in:
@@ -365,7 +365,8 @@ dependencies {
|
||||
|
||||
implementation project(':libsignal-service')
|
||||
implementation 'org.signal:zkgroup-android:0.7.0'
|
||||
|
||||
implementation 'org.whispersystems:signal-client-android:0.1.4'
|
||||
implementation 'com.google.protobuf:protobuf-javalite:3.10.0'
|
||||
implementation 'org.signal:argon2:13.1@aar'
|
||||
|
||||
implementation 'org.signal:ringrtc-android:2.8.3'
|
||||
|
@@ -14,6 +14,7 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.push.IasTrustStore;
|
||||
import org.thoughtcrime.securesms.util.SetUtil;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.signalservice.api.SignalServiceAccountManager;
|
||||
import org.whispersystems.signalservice.api.push.TrustStore;
|
||||
import org.whispersystems.signalservice.internal.contacts.crypto.Quote;
|
||||
@@ -69,7 +70,7 @@ class ContactDiscoveryV2 {
|
||||
FuzzyPhoneNumberHelper.OutputResultV2 outputResult = FuzzyPhoneNumberHelper.generateOutputV2(results, inputResult);
|
||||
|
||||
return new DirectoryResult(outputResult.getNumbers(), outputResult.getRewrites(), ignoredNumbers);
|
||||
} catch (SignatureException | UnauthenticatedQuoteException | UnauthenticatedResponseException | Quote.InvalidQuoteFormatException e) {
|
||||
} catch (SignatureException | UnauthenticatedQuoteException | UnauthenticatedResponseException | Quote.InvalidQuoteFormatException |InvalidKeyException e) {
|
||||
Log.w(TAG, "Attestation error.", e);
|
||||
throw new IOException(e);
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.pin.PinState;
|
||||
import org.thoughtcrime.securesms.util.concurrent.SimpleTask;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.signalservice.internal.contacts.crypto.UnauthenticatedResponseException;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -29,7 +30,7 @@ final class ConfirmKbsPinRepository {
|
||||
Log.i(TAG, "Pin set on KBS");
|
||||
|
||||
return PinSetResult.SUCCESS;
|
||||
} catch (IOException | UnauthenticatedResponseException e) {
|
||||
} catch (IOException | UnauthenticatedResponseException | InvalidKeyException e) {
|
||||
Log.w(TAG, e);
|
||||
PinState.onPinCreateFailure();
|
||||
return PinSetResult.FAILURE;
|
||||
|
@@ -15,6 +15,7 @@ import org.thoughtcrime.securesms.lock.PinHashing;
|
||||
import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.pin.PinState;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.signalservice.api.KeyBackupService;
|
||||
import org.whispersystems.signalservice.api.KeyBackupServicePinException;
|
||||
import org.whispersystems.signalservice.api.KeyBackupSystemNoDataException;
|
||||
@@ -60,7 +61,7 @@ public final class RegistrationPinV2MigrationJob extends BaseJob {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRun() throws IOException, UnauthenticatedResponseException {
|
||||
protected void onRun() throws IOException, UnauthenticatedResponseException, InvalidKeyException {
|
||||
if (!TextSecurePreferences.isV1RegistrationLockEnabled(context)) {
|
||||
Log.i(TAG, "Registration lock disabled");
|
||||
return;
|
||||
|
@@ -22,6 +22,7 @@ import org.thoughtcrime.securesms.logging.Log;
|
||||
import org.thoughtcrime.securesms.megaphone.Megaphones;
|
||||
import org.thoughtcrime.securesms.registration.service.KeyBackupSystemWrongPinException;
|
||||
import org.thoughtcrime.securesms.util.TextSecurePreferences;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.libsignal.util.guava.Optional;
|
||||
import org.whispersystems.signalservice.api.KbsPinData;
|
||||
import org.whispersystems.signalservice.api.KeyBackupService;
|
||||
@@ -90,7 +91,7 @@ public final class PinState {
|
||||
}
|
||||
|
||||
return kbsData;
|
||||
} catch (UnauthenticatedResponseException e) {
|
||||
} catch (UnauthenticatedResponseException | InvalidKeyException e) {
|
||||
Log.w(TAG, "Failed to restore key", e);
|
||||
throw new IOException(e);
|
||||
} catch (KeyBackupServicePinException e) {
|
||||
@@ -170,7 +171,7 @@ public final class PinState {
|
||||
*/
|
||||
@WorkerThread
|
||||
public static synchronized void onPinChangedOrCreated(@NonNull Context context, @NonNull String pin, @NonNull PinKeyboardType keyboard)
|
||||
throws IOException, UnauthenticatedResponseException
|
||||
throws IOException, UnauthenticatedResponseException, InvalidKeyException
|
||||
{
|
||||
Log.i(TAG, "onPinChangedOrCreated()");
|
||||
|
||||
@@ -272,7 +273,7 @@ public final class PinState {
|
||||
*/
|
||||
@WorkerThread
|
||||
public static synchronized void onMigrateToRegistrationLockV2(@NonNull Context context, @NonNull String pin)
|
||||
throws IOException, UnauthenticatedResponseException
|
||||
throws IOException, UnauthenticatedResponseException, InvalidKeyException
|
||||
{
|
||||
Log.i(TAG, "onMigrateToRegistrationLockV2()");
|
||||
|
||||
|
@@ -14,7 +14,6 @@ import org.thoughtcrime.securesms.util.ServiceUtil;
|
||||
import org.thoughtcrime.securesms.webrtc.locks.LockManager;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.libsignal.ecc.Curve;
|
||||
import org.whispersystems.libsignal.ecc.DjbECPublicKey;
|
||||
import org.whispersystems.libsignal.ecc.ECPublicKey;
|
||||
import org.whispersystems.signalservice.api.messages.calls.OfferMessage;
|
||||
|
||||
@@ -27,11 +26,7 @@ public final class WebRtcUtil {
|
||||
|
||||
public static @NonNull byte[] getPublicKeyBytes(@NonNull byte[] identityKey) throws InvalidKeyException {
|
||||
ECPublicKey key = Curve.decodePoint(identityKey, 0);
|
||||
|
||||
if (key instanceof DjbECPublicKey) {
|
||||
return ((DjbECPublicKey) key).getPublicKey();
|
||||
}
|
||||
throw new InvalidKeyException();
|
||||
return key.getPublicKeyBytes();
|
||||
}
|
||||
|
||||
public static @NonNull LockManager.PhoneState getInCallPhoneState(@NonNull Context context) {
|
||||
|
@@ -420,6 +420,9 @@ dependencyVerification {
|
||||
['org.apache.httpcomponents:httpclient-android:4.3.5',
|
||||
'6f56466a9bd0d42934b90bfbfe9977a8b654c058bf44a12bdc2877c4e1f033f1'],
|
||||
|
||||
['org.aspectj:aspectjrt:1.9.4',
|
||||
'4ff12340d4f1197b95fc9d53dd43b7ada6150426d685778979ceca4304361698'],
|
||||
|
||||
['org.conscrypt:conscrypt-android:2.0.0',
|
||||
'400ca559a49b860a82862b22cee0e3110764bdcf7ee7c79e7479895c25cdfc09'],
|
||||
|
||||
@@ -441,9 +444,6 @@ dependencyVerification {
|
||||
['org.signal:ringrtc-android:2.8.3',
|
||||
'1cdc73ec34b11b9eeb0a650715e1095cade226736192c091991f31367245e37a'],
|
||||
|
||||
['org.signal:signal-metadata-java:0.1.2',
|
||||
'6aaeb6a33bf3161a3e6ac9db7678277f7a4cf5a2c96b84342e4007ee49bab1bd'],
|
||||
|
||||
['org.signal:zkgroup-android:0.7.0',
|
||||
'52b172565bd01526e93ebf1796b834bdc449d4fe3422c1b827e49cb8d4f13fbd'],
|
||||
|
||||
@@ -453,11 +453,11 @@ dependencyVerification {
|
||||
['org.threeten:threetenbp:1.3.6',
|
||||
'f4c23ffaaed717c3b99c003e0ee02d6d66377fd47d866fec7d971bd8644fc1a7'],
|
||||
|
||||
['org.whispersystems:curve25519-java:0.5.0',
|
||||
'0aadd43cf01d11e9b58f867b3c4f25c3194e8b0623d1953d32dfbfbee009e38d'],
|
||||
['org.whispersystems:signal-client-android:0.1.4',
|
||||
'a95f4d8125a22552da99b5db15589454789eee322e84d9ba613c258150366a64'],
|
||||
|
||||
['org.whispersystems:signal-protocol-java:2.8.1',
|
||||
'b19db36839ab008fdccefc7f8c005f2ea43dc7c7298a209bc424e6f9b6d5617b'],
|
||||
['org.whispersystems:signal-client-java:0.1.4',
|
||||
'7d151220a203e43ecf419256eecb6309cc4c5644557beeb29f54ba34ee82645c'],
|
||||
|
||||
['pl.tajchert:waitingdots:0.1.0',
|
||||
'2835d49e0787dbcb606c5a60021ced66578503b1e9fddcd7a5ef0cd5f095ba2c'],
|
||||
|
Reference in New Issue
Block a user