QA target can pass on ARM MacBook

The Conscrypt library does not have a native library suitable for
running on the ARM MacBooks. As a result, unit tests that rely on
Conscrypt also don't work on this hardware.

Fortunately, though, the tests will pass without Conscrypt anyway. As a
workaround, we can avoid using Conscrypt only when running the unit test
suite on these machines.

See also: https://github.com/google/conscrypt/issues/1034

Resolves #13382.
This commit is contained in:
Jameson Williams
2024-01-24 23:20:38 -06:00
committed by Nicholas Tinsley
parent 716afc98ac
commit 1d5e108cd4
4 changed files with 17 additions and 4 deletions

View File

@@ -29,7 +29,10 @@ import static org.whispersystems.signalservice.testutil.LibSignalLibraryUtil.ass
public final class AttachmentCipherTest {
static {
Security.insertProviderAt(Conscrypt.newProvider(), 1);
// https://github.com/google/conscrypt/issues/1034
if (!System.getProperty("os.arch").equals("aarch64")) {
Security.insertProviderAt(Conscrypt.newProvider(), 1);
}
}
@Test

View File

@@ -30,7 +30,10 @@ public class ProfileCipherTest {
}
static {
Security.insertProviderAt(Conscrypt.newProvider(), 1);
// https://github.com/google/conscrypt/issues/1034
if (!System.getProperty("os.arch").equals("aarch64")) {
Security.insertProviderAt(Conscrypt.newProvider(), 1);
}
}
@Test

View File

@@ -19,7 +19,10 @@ import java.security.cert.CertificateException;
public class SigningCertificateTest extends TestCase {
static {
Security.insertProviderAt(Conscrypt.newProvider(), 1);
// https://github.com/google/conscrypt/issues/1034
if (!System.getProperty("os.arch").equals("aarch64")) {
Security.insertProviderAt(Conscrypt.newProvider(), 1);
}
}
public void testGoodSignature() throws CertificateException, NoSuchAlgorithmException, IOException, KeyStoreException, CertPathValidatorException, SignatureException {

View File

@@ -2,6 +2,7 @@ package org.whispersystems.signalservice.api.crypto;
import junit.framework.TestCase;
import org.conscrypt.Conscrypt;
import org.conscrypt.OpenSSLProvider;
import org.signal.libsignal.zkgroup.InvalidInputException;
import org.signal.libsignal.zkgroup.profiles.ProfileKey;
@@ -12,7 +13,10 @@ import java.util.Arrays;
public class UnidentifiedAccessTest extends TestCase {
static {
Security.insertProviderAt(new OpenSSLProvider(), 1);
// https://github.com/google/conscrypt/issues/1034
if (!System.getProperty("os.arch").equals("aarch64")) {
Security.insertProviderAt(new OpenSSLProvider(), 1);
}
}
private final byte[] EXPECTED_RESULT = {(byte)0x5a, (byte)0x72, (byte)0x3a, (byte)0xce, (byte)0xe5, (byte)0x2c, (byte)0x5e, (byte)0xa0, (byte)0x2b, (byte)0x92, (byte)0xa3, (byte)0xa3, (byte)0x60, (byte)0xc0, (byte)0x95, (byte)0x95};