diff options
author | Pete Bentley <prb@google.com> | 2024-04-10 16:57:26 +0100 |
---|---|---|
committer | Pete Bentley <prb@google.com> | 2024-04-10 16:57:26 +0100 |
commit | c15276c48a44b5fce1a7bb24f10d58f5e408a67f (patch) | |
tree | 5bdb80c36fab9aab5729b78a97f2a68ed3ec5dfe | |
parent | 957f6e7aa21841acd18caf7411865a9944120d40 (diff) | |
download | conscrypt-c15276c48a44b5fce1a7bb24f10d58f5e408a67f.tar.gz |
Update repackaged source.
No functional change, srcgen output has just changed slightly and
picked up some fixes it previously missed.
Test: TH
Change-Id: I3c03693ca98ce42e7f285757b0bf4be99ec07594
5 files changed, 45 insertions, 45 deletions
diff --git a/repackaged/common/src/main/java/com/android/org/conscrypt/DuckTypedHpkeSpi.java b/repackaged/common/src/main/java/com/android/org/conscrypt/DuckTypedHpkeSpi.java index d85c3f8d..f8bcc26d 100644 --- a/repackaged/common/src/main/java/com/android/org/conscrypt/DuckTypedHpkeSpi.java +++ b/repackaged/common/src/main/java/com/android/org/conscrypt/DuckTypedHpkeSpi.java @@ -78,37 +78,37 @@ public class DuckTypedHpkeSpi implements HpkeSpi { } catch (IllegalAccessException e) { throw new IllegalStateException("DuckTypedHpkSpi internal error", e); } catch (InvocationTargetException e) { - if (e.getCause() instanceof RuntimeException) { - throw (RuntimeException) e.getCause(); - } + if (e.getCause() instanceof RuntimeException) { + throw (RuntimeException) e.getCause(); + } throw e; } } private void invokeWithPossibleInvalidKey(String methodName, Object... args) throws InvalidKeyException { - try { - invoke(methodName, args); - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - if (cause instanceof InvalidKeyException) { - throw (InvalidKeyException) cause; + try { + invoke(methodName, args); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if (cause instanceof InvalidKeyException) { + throw (InvalidKeyException) cause; + } + throw new IllegalStateException(cause); } - throw new IllegalStateException(cause); - } } private Object invokeWithPossibleGeneralSecurity(String methodName, Object... args) throws GeneralSecurityException { - try { - return invoke(methodName, args); - } catch (InvocationTargetException e) { - Throwable cause = e.getCause(); - if (cause instanceof GeneralSecurityException) { - throw (GeneralSecurityException) cause; + try { + return invoke(methodName, args); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if (cause instanceof GeneralSecurityException) { + throw (GeneralSecurityException) cause; + } + throw new IllegalStateException(cause); } - throw new IllegalStateException(cause); - } } private Object invokeNoChecked(String methodName, Object... args) { @@ -127,40 +127,40 @@ public class DuckTypedHpkeSpi implements HpkeSpi { @Override public void engineInitSender(PublicKey recipientKey, byte[] info, PrivateKey senderKey, byte[] psk, byte[] pskId) throws InvalidKeyException { - invokeWithPossibleInvalidKey("engineInitSender", recipientKey, info, senderKey, psk, pskId); + invokeWithPossibleInvalidKey("engineInitSender", recipientKey, info, senderKey, psk, pskId); } @Override public void engineInitSenderForTesting(PublicKey recipientKey, byte[] info, PrivateKey senderKey, byte[] psk, byte[] pskId, byte[] sKe) throws InvalidKeyException { - invokeWithPossibleInvalidKey( - "engineInitSenderForTesting", recipientKey, info, senderKey, psk, pskId, sKe); + invokeWithPossibleInvalidKey( + "engineInitSenderForTesting", recipientKey, info, senderKey, psk, pskId, sKe); } @Override public void engineInitRecipient(byte[] encapsulated, PrivateKey key, byte[] info, PublicKey senderKey, byte[] psk, byte[] psk_id) throws InvalidKeyException { - invokeWithPossibleInvalidKey( - "engineInitRecipient", encapsulated, key, info, senderKey, psk, psk_id); + invokeWithPossibleInvalidKey( + "engineInitRecipient", encapsulated, key, info, senderKey, psk, psk_id); } @Override public byte[] engineSeal(byte[] plaintext, byte[] aad) { - return (byte[]) invokeNoChecked("engineSeal", plaintext, aad); + return (byte[]) invokeNoChecked("engineSeal", plaintext, aad); } @Override public byte[] engineExport(int length, byte[] exporterContext) { - return (byte[]) invokeNoChecked("engineExport", length, exporterContext); + return (byte[]) invokeNoChecked("engineExport", length, exporterContext); } @Override public byte[] engineOpen(byte[] ciphertext, byte[] aad) throws GeneralSecurityException { - return (byte[]) invokeWithPossibleGeneralSecurity("engineOpen", ciphertext, aad); + return (byte[]) invokeWithPossibleGeneralSecurity("engineOpen", ciphertext, aad); } @Override public byte[] getEncapsulated() { - return (byte[]) invokeNoChecked("getEncapsulated"); + return (byte[]) invokeNoChecked("getEncapsulated"); } } diff --git a/repackaged/common/src/main/java/com/android/org/conscrypt/HpkeImpl.java b/repackaged/common/src/main/java/com/android/org/conscrypt/HpkeImpl.java index 9f957503..2c0bbab5 100644 --- a/repackaged/common/src/main/java/com/android/org/conscrypt/HpkeImpl.java +++ b/repackaged/common/src/main/java/com/android/org/conscrypt/HpkeImpl.java @@ -131,8 +131,8 @@ public class HpkeImpl implements HpkeSpi { checkInitialised(); long maxLength = hpkeSuite.getKdf().maxExportLength(); if (length < 0 || length > maxLength) { - throw new IllegalArgumentException( - "Export length must be between 0 and " + maxLength + ", but was " + length); + throw new IllegalArgumentException( + "Export length must be between 0 and " + maxLength + ", but was " + length); } return NativeCrypto.EVP_HPKE_CTX_export(ctx, exporterContext, length); } diff --git a/repackaged/common/src/test/java/com/android/org/conscrypt/java/security/KeyFactoryTestRSACrt.java b/repackaged/common/src/test/java/com/android/org/conscrypt/java/security/KeyFactoryTestRSACrt.java index 762f2af9..d6ea668d 100644 --- a/repackaged/common/src/test/java/com/android/org/conscrypt/java/security/KeyFactoryTestRSACrt.java +++ b/repackaged/common/src/test/java/com/android/org/conscrypt/java/security/KeyFactoryTestRSACrt.java @@ -75,19 +75,19 @@ public class KeyFactoryTestRSACrt extends @Test public void javaSerialization() throws Exception { - PrivateKey privateKey = DefaultKeys.getPrivateKey("RSA"); - assertTrue(privateKey instanceof RSAPrivateCrtKey); + PrivateKey privateKey = DefaultKeys.getPrivateKey("RSA"); + assertTrue(privateKey instanceof RSAPrivateCrtKey); - ByteArrayOutputStream bos = new ByteArrayOutputStream(); - ObjectOutputStream out = new ObjectOutputStream(bos); - out.writeObject(privateKey); + ByteArrayOutputStream bos = new ByteArrayOutputStream(); + ObjectOutputStream out = new ObjectOutputStream(bos); + out.writeObject(privateKey); - ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); - ObjectInputStream in = new ObjectInputStream(bis); - PrivateKey copy = (PrivateKey) in.readObject(); - assertTrue(copy instanceof RSAPrivateCrtKey); + ByteArrayInputStream bis = new ByteArrayInputStream(bos.toByteArray()); + ObjectInputStream in = new ObjectInputStream(bis); + PrivateKey copy = (PrivateKey) in.readObject(); + assertTrue(copy instanceof RSAPrivateCrtKey); - assertEquals(privateKey.getFormat(), copy.getFormat()); - assertArrayEquals(privateKey.getEncoded(), copy.getEncoded()); + assertEquals(privateKey.getFormat(), copy.getFormat()); + assertArrayEquals(privateKey.getEncoded(), copy.getEncoded()); } } diff --git a/repackaged/common/src/test/java/com/android/org/conscrypt/javax/net/ssl/SSLSocketVersionCompatibilityTest.java b/repackaged/common/src/test/java/com/android/org/conscrypt/javax/net/ssl/SSLSocketVersionCompatibilityTest.java index 89e34d97..df41a5a5 100644 --- a/repackaged/common/src/test/java/com/android/org/conscrypt/javax/net/ssl/SSLSocketVersionCompatibilityTest.java +++ b/repackaged/common/src/test/java/com/android/org/conscrypt/javax/net/ssl/SSLSocketVersionCompatibilityTest.java @@ -20,9 +20,9 @@ package com.android.org.conscrypt.javax.net.ssl; import static com.android.org.conscrypt.TestUtils.UTF_8; import static com.android.org.conscrypt.TestUtils.isLinux; import static com.android.org.conscrypt.TestUtils.isOsx; -import static com.android.org.conscrypt.TestUtils.isWindows; import static com.android.org.conscrypt.TestUtils.isTlsV1Deprecated; import static com.android.org.conscrypt.TestUtils.isTlsV1Supported; +import static com.android.org.conscrypt.TestUtils.isWindows; import static com.android.org.conscrypt.TestUtils.osName; import static org.junit.Assert.assertArrayEquals; import static org.junit.Assert.assertEquals; diff --git a/repackaged/testing/src/main/java/tests/util/ServiceTester.java b/repackaged/testing/src/main/java/tests/util/ServiceTester.java index f5298b77..5d3c37e0 100644 --- a/repackaged/testing/src/main/java/tests/util/ServiceTester.java +++ b/repackaged/testing/src/main/java/tests/util/ServiceTester.java @@ -194,9 +194,9 @@ public interface Test { try { test.test(p, algorithm); } catch (Exception | AssertionError e) { - errors.append("Failure testing " + service + ":" + algorithm + " from provider " + p.getName() - + ":\n"); - e.printStackTrace(errors); + errors.append("Failure testing " + service + ":" + algorithm + " from provider " + + p.getName() + ":\n"); + e.printStackTrace(errors); } } |