mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-01 22:25:46 +01:00
Update to libsignal 0.86.1
This commit is contained in:
@@ -18,7 +18,6 @@ import org.whispersystems.signalservice.internal.push.CreateCallLinkAuthResponse
|
||||
import org.whispersystems.signalservice.internal.push.GetCallingRelaysResponse
|
||||
import org.whispersystems.signalservice.internal.push.PushServiceSocket
|
||||
import org.whispersystems.signalservice.internal.websocket.WebSocketRequestMessage
|
||||
import org.signal.libsignal.protocol.util.Pair as LibSignalPair
|
||||
|
||||
/**
|
||||
* Provide calling specific network apis.
|
||||
@@ -73,7 +72,7 @@ class CallingApi(
|
||||
requestId: Long,
|
||||
url: String,
|
||||
httpMethod: String,
|
||||
headers: List<LibSignalPair<String, String>>?,
|
||||
headers: List<Pair<String, String>>?,
|
||||
body: ByteArray?
|
||||
): NetworkResult<CallingResponse> {
|
||||
return when (val result = NetworkResult.fromFetch { pushServiceSocket.makeCallingRequest(requestId, url, httpMethod, headers, body) }) {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.whispersystems.signalservice.api.services;
|
||||
|
||||
import org.signal.libsignal.protocol.logging.Log;
|
||||
import org.signal.libsignal.protocol.util.Pair;
|
||||
import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialPresentation;
|
||||
import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialRequest;
|
||||
import org.signal.libsignal.zkgroup.receipts.ReceiptCredentialResponse;
|
||||
@@ -28,6 +27,8 @@ import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicReference;
|
||||
import java.util.concurrent.locks.Lock;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
|
||||
/**
|
||||
@@ -384,7 +385,7 @@ public class DonationsService {
|
||||
private <T> ServiceResponse<T> wrapInServiceResponse(Producer<T> producer) {
|
||||
try {
|
||||
Pair<T, Integer> responseAndCode = producer.produce();
|
||||
return ServiceResponse.forResult(responseAndCode.first(), responseAndCode.second(), null);
|
||||
return ServiceResponse.forResult(responseAndCode.getFirst(), responseAndCode.getSecond(), null);
|
||||
} catch (NonSuccessfulResponseCodeException e) {
|
||||
Log.w(TAG, "Bad response code from server.", e);
|
||||
return ServiceResponse.forApplicationError(e, e.code, e.getStringBody());
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.whispersystems.signalservice.api.services;
|
||||
|
||||
import org.signal.libsignal.protocol.IdentityKey;
|
||||
import org.signal.libsignal.protocol.logging.Log;
|
||||
import org.signal.libsignal.protocol.util.Pair;
|
||||
import org.signal.libsignal.zkgroup.VerificationFailedException;
|
||||
import org.signal.libsignal.zkgroup.profiles.ClientZkProfileOperations;
|
||||
import org.signal.libsignal.zkgroup.profiles.ExpiringProfileKeyCredential;
|
||||
@@ -43,6 +42,8 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Single;
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ import com.squareup.wire.Message;
|
||||
import org.signal.core.util.Base64;
|
||||
import org.signal.libsignal.protocol.InvalidKeyException;
|
||||
import org.signal.libsignal.protocol.logging.Log;
|
||||
import org.signal.libsignal.protocol.util.Pair;
|
||||
import org.signal.storageservice.protos.groups.AvatarUploadAttributes;
|
||||
import org.signal.storageservice.protos.groups.Group;
|
||||
import org.signal.storageservice.protos.groups.GroupChange;
|
||||
@@ -134,6 +133,8 @@ import javax.net.ssl.SSLContext;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
import okhttp3.Call;
|
||||
import okhttp3.ConnectionPool;
|
||||
import okhttp3.ConnectionSpec;
|
||||
@@ -1396,7 +1397,7 @@ public class PushServiceSocket {
|
||||
|
||||
if (headers != null) {
|
||||
for (Pair<String, String> header : headers) {
|
||||
builder.addHeader(header.first(), header.second());
|
||||
builder.addHeader(header.getFirst(), header.getSecond());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
|
||||
package org.whispersystems.signalservice.internal.util;
|
||||
|
||||
import org.signal.libsignal.protocol.util.Pair;
|
||||
import org.whispersystems.signalservice.api.push.TrustStore;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -24,6 +23,8 @@ import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.TrustManagerFactory;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
/**
|
||||
* Trust manager that defers to a system X509 trust manager, and
|
||||
* additionally rejects certificates if they have a blacklisted
|
||||
@@ -87,8 +88,8 @@ public class BlacklistingTrustManager implements X509TrustManager {
|
||||
|
||||
for (X509Certificate certificate : chain) {
|
||||
for (Pair<String, BigInteger> blacklistedSerial : BLACKLIST) {
|
||||
if (certificate.getIssuerDN().getName().equals(blacklistedSerial.first()) &&
|
||||
certificate.getSerialNumber().equals(blacklistedSerial.second()))
|
||||
if (certificate.getIssuerDN().getName().equals(blacklistedSerial.getFirst()) &&
|
||||
certificate.getSerialNumber().equals(blacklistedSerial.getSecond()))
|
||||
{
|
||||
throw new CertificateException("Blacklisted Serial: " + certificate.getSerialNumber());
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package org.whispersystems.signalservice.internal.websocket;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.signal.libsignal.protocol.logging.Log;
|
||||
import org.signal.libsignal.protocol.util.Pair;
|
||||
import org.whispersystems.signalservice.api.push.TrustStore;
|
||||
import org.whispersystems.signalservice.api.push.exceptions.NonSuccessfulResponseCodeException;
|
||||
import org.whispersystems.signalservice.api.util.CredentialsProvider;
|
||||
@@ -37,6 +36,8 @@ import javax.net.ssl.SSLSocketFactory;
|
||||
import javax.net.ssl.TrustManager;
|
||||
import javax.net.ssl.X509TrustManager;
|
||||
|
||||
import kotlin.Pair;
|
||||
|
||||
import io.reactivex.rxjava3.core.Observable;
|
||||
import io.reactivex.rxjava3.core.Single;
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers;
|
||||
@@ -128,13 +129,13 @@ public class OkHttpWebSocketConnection extends WebSocketListener implements WebS
|
||||
|
||||
if (client == null) {
|
||||
Pair<SignalServiceUrl, String> connectionInfo = getConnectionInfo();
|
||||
SignalServiceUrl serviceUrl = connectionInfo.first();
|
||||
String wsUri = connectionInfo.second();
|
||||
SignalServiceUrl serviceUrl = connectionInfo.getFirst();
|
||||
String wsUri = connectionInfo.getSecond();
|
||||
|
||||
Pair<SSLSocketFactory, X509TrustManager> socketFactory = createTlsSocketFactory(trustStore);
|
||||
|
||||
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder().sslSocketFactory(new Tls12SocketFactory(socketFactory.first()),
|
||||
socketFactory.second())
|
||||
OkHttpClient.Builder clientBuilder = new OkHttpClient.Builder().sslSocketFactory(new Tls12SocketFactory(socketFactory.getFirst()),
|
||||
socketFactory.getSecond())
|
||||
.connectionSpecs(serviceUrl.getConnectionSpecs().orElse(Util.immutableList(ConnectionSpec.RESTRICTED_TLS)))
|
||||
.readTimeout(KEEPALIVE_FREQUENCY_SECONDS + 10, TimeUnit.SECONDS)
|
||||
.dns(dns.orElse(Dns.SYSTEM))
|
||||
|
||||
Reference in New Issue
Block a user