Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
---
Language: Cpp
BasedOnStyle: Google
BasedOnStyle: Google
AccessModifierOffset: -4
AllowShortFunctionsOnASingleLine: Empty
ColumnLimit: 100
IndentWidth: 4
ContinuationIndentWidth: 8
TypenameMacros: ['STACK_OF']
AlignEscapedNewlines: Left
AlignAfterOpenBracket: Align
---
Language: Java
BasedOnStyle: Google
ColumnLimit: 100
IndentWidth: 4
ContinuationIndentWidth: 8
AlignAfterOpenBracket: Align
JavaImportGroups:
- android
- androidx
Expand Down
39 changes: 14 additions & 25 deletions android-stub/src/main/java/android/crypto/hpke/HpkeSpi.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

package android.crypto.hpke;

import libcore.util.NonNull;
import libcore.util.Nullable;

import java.security.GeneralSecurityException;
import java.security.InvalidKeyException;
import java.security.PrivateKey;
import java.security.PublicKey;
import libcore.util.NonNull;
import libcore.util.Nullable;


/**
* Service Provider Interface for HPKE client API classes to communicate with implementations
Expand Down Expand Up @@ -64,13 +64,9 @@ public interface HpkeSpi {
* @throws UnsupportedOperationException if the mode is not supported by this implementation
* @throws IllegalStateException if this SPI has already been initialised
*/
void engineInitSender(
@NonNull PublicKey recipientKey,
@Nullable byte[] info,
@Nullable PrivateKey senderKey,
@Nullable byte[] psk,
@Nullable byte[] psk_id)
throws InvalidKeyException;
void engineInitSender(@NonNull PublicKey recipientKey, @Nullable byte[] info,
@Nullable PrivateKey senderKey, @Nullable byte[] psk,
@Nullable byte[] psk_id) throws InvalidKeyException;

/**
* Initialises an HPKE SPI in one of the sender modes described in RFC 9180 with
Expand Down Expand Up @@ -109,13 +105,9 @@ void engineInitSender(
* @throws UnsupportedOperationException if the mode is not supported by this implementation
* @throws IllegalStateException if this SPI has already been initialised
*/
void engineInitSenderWithSeed(
@NonNull PublicKey recipientKey,
@Nullable byte[] info,
@Nullable PrivateKey senderKey,
@Nullable byte[] psk,
@Nullable byte[] psk_id,
@NonNull byte[] sKe)
void engineInitSenderWithSeed(@NonNull PublicKey recipientKey, @Nullable byte[] info,
@Nullable PrivateKey senderKey, @Nullable byte[] psk,
@Nullable byte[] psk_id, @NonNull byte[] sKe)
throws InvalidKeyException;

/**
Expand Down Expand Up @@ -149,13 +141,9 @@ void engineInitSenderWithSeed(
* @throws UnsupportedOperationException if the mode is not supported by this implementation
* @throws IllegalStateException if this SPI has already been initialised
*/
void engineInitRecipient(
@NonNull byte[] encapsulated,
@NonNull PrivateKey recipientKey,
@Nullable byte[] info,
@Nullable PublicKey senderKey,
@Nullable byte[] psk,
@Nullable byte[] psk_id)
void engineInitRecipient(@NonNull byte[] encapsulated, @NonNull PrivateKey recipientKey,
@Nullable byte[] info, @Nullable PublicKey senderKey,
@Nullable byte[] psk, @Nullable byte[] psk_id)
throws InvalidKeyException;

/**
Expand All @@ -180,7 +168,8 @@ void engineInitRecipient(
* as a sender
* @throws GeneralSecurityException on decryption failures
*/
@NonNull byte[] engineOpen(@NonNull byte[] ciphertext, @Nullable byte[] aad)
@NonNull
byte[] engineOpen(@NonNull byte[] ciphertext, @Nullable byte[] aad)
throws GeneralSecurityException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ public final class PakeServerKeyManagerParameters implements ManagerFactoryParam
* @param serverId The server identifier for the link.
* @return An unmodifiable list of PAKE options for the given link.
*/
public @NonNull List<PakeOption> getOptions(
@Nullable byte[] clientId, @Nullable byte[] serverId) {
public @NonNull List<PakeOption> getOptions(@Nullable byte[] clientId,
@Nullable byte[] serverId) {
throw new RuntimeException("Stub!");
}

Expand Down Expand Up @@ -139,7 +139,7 @@ public static final class Builder {
* @throws InvalidParameterException If the provided options are invalid.
*/
public @NonNull Builder setOptions(@Nullable byte[] clientId, @Nullable byte[] serverId,
@NonNull List<PakeOption> options) {
@NonNull List<PakeOption> options) {
throw new RuntimeException("Stub!");
}

Expand Down
7 changes: 3 additions & 4 deletions android-stub/src/main/java/android/util/StatsEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package android.util;

@SuppressWarnings({"unused", "DoNotCallSuggester"})
@SuppressWarnings({"unused", "DoNotCallSuggester"})
public final class StatsEvent {
public static StatsEvent.Builder newBuilder() {
throw new RuntimeException("Stub!");
Expand All @@ -38,10 +38,9 @@ public void release() {
throw new RuntimeException("Stub!");
}

private static final class Buffer {
}
private static final class Buffer {}

@SuppressWarnings({"unused", "DoNotCallSuggester"})
@SuppressWarnings({"unused", "DoNotCallSuggester"})
public static final class Builder {
public StatsEvent.Builder setAtomId(int atomId) {
throw new RuntimeException("Stub!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;

import javax.net.ssl.SSLException;

@SuppressWarnings("unused")
Expand All @@ -31,8 +32,8 @@ public interface SSLHandshakeCallbacks {
*
* @throws CertificateException if the certificate is untrusted
*/
void verifyCertificateChain(byte[][] asn1DerEncodedCertificateChain,
String authMethod) throws CertificateException;
void verifyCertificateChain(byte[][] asn1DerEncodedCertificateChain, String authMethod)
throws CertificateException;
/**
* Called on an SSL client when the server requests (or
* requires a certificate). The client can respond by using
Expand All @@ -44,8 +45,7 @@ void verifyCertificateChain(byte[][] asn1DerEncodedCertificateChain,
* convertible to strings with #keyType
* @param asn1DerEncodedX500Principals CAs known to the server
*/
void clientCertificateRequested(
byte[] keyTypes, byte[][] asn1DerEncodedX500Principals)
void clientCertificateRequested(byte[] keyTypes, byte[][] asn1DerEncodedX500Principals)
throws CertificateEncodingException, SSLException;
/**
* Called when SSL handshake is completed. Note that this can
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.security.PrivateKey;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;

import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
Expand All @@ -46,7 +47,7 @@ protected OpenSSLSocketImpl(SSLParametersImpl sslParameters) throws IOException
}

protected OpenSSLSocketImpl(SSLParametersImpl sslParameters, String[] enabledProtocols,
String[] enabledCipherSuites) throws IOException {
String[] enabledCipherSuites) throws IOException {
throw new RuntimeException("Stub!");
}

Expand All @@ -61,17 +62,18 @@ protected OpenSSLSocketImpl(InetAddress address, int port, SSLParametersImpl ssl
}

protected OpenSSLSocketImpl(String host, int port, InetAddress clientAddress, int clientPort,
SSLParametersImpl sslParameters) throws IOException {
SSLParametersImpl sslParameters) throws IOException {
throw new RuntimeException("Stub!");
}

protected OpenSSLSocketImpl(InetAddress address, int port, InetAddress clientAddress,
int clientPort, SSLParametersImpl sslParameters) throws IOException {
int clientPort, SSLParametersImpl sslParameters)
throws IOException {
throw new RuntimeException("Stub!");
}

protected OpenSSLSocketImpl(Socket socket, String host, int port, boolean autoClose,
SSLParametersImpl sslParameters) throws IOException {
SSLParametersImpl sslParameters) throws IOException {
throw new RuntimeException("Stub!");
}

Expand Down
4 changes: 3 additions & 1 deletion android-stub/src/main/java/dalvik/system/BlockGuard.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public static Policy getThreadPolicy() {
throw new UnsupportedOperationException("Stub!");
}

public interface Policy { void onNetwork(); }
public interface Policy {
void onNetwork();
}

public static class PolicyWrapper implements Policy {
private PolicyWrapper() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import java.net.InetAddress;
import java.net.Socket;
import java.net.UnknownHostException;

import javax.net.ssl.SSLSocketFactory;

@Internal
public abstract class BaseOpenSSLSocketAdapterFactory extends SSLSocketFactory {

private final OpenSSLSocketFactoryImpl delegate;

protected BaseOpenSSLSocketAdapterFactory(OpenSSLSocketFactoryImpl delegate) {
Expand All @@ -47,8 +47,7 @@ public Socket createSocket() throws IOException {
}

@Override
public Socket createSocket(String hostname, int port)
throws IOException, UnknownHostException {
public Socket createSocket(String hostname, int port) throws IOException, UnknownHostException {
return wrap((OpenSSLSocketImpl) delegate.createSocket(hostname, port));
}

Expand All @@ -64,11 +63,8 @@ public Socket createSocket(InetAddress address, int port) throws IOException {
}

@Override
public Socket createSocket(InetAddress address,
int port,
InetAddress localAddress,
int localPort)
throws IOException {
public Socket createSocket(InetAddress address, int port, InetAddress localAddress,
int localPort) throws IOException {
return wrap(
(OpenSSLSocketImpl) delegate.createSocket(address, port, localAddress, localPort));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
*/
@Internal
public class KitKatPlatformOpenSSLSocketAdapterFactory extends BaseOpenSSLSocketAdapterFactory {

public KitKatPlatformOpenSSLSocketAdapterFactory(OpenSSLSocketFactoryImpl delegate) {
super(delegate);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.security.PrivateKey;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;

import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLParameters;
Expand All @@ -44,8 +45,6 @@
@Internal
public class KitKatPlatformOpenSSLSocketImplAdapter
extends com.android.org.conscrypt.OpenSSLSocketImpl {


private final AbstractConscryptSocket delegate;

public KitKatPlatformOpenSSLSocketImplAdapter(AbstractConscryptSocket delegate)
Expand Down
6 changes: 3 additions & 3 deletions android/src/main/java/org/conscrypt/NativeCryptoJni.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
*/
class NativeCryptoJni {
public static void init() {
if ("com.google.android.gms.org.conscrypt".equals(NativeCrypto.class.getPackage().getName())) {
if ("com.google.android.gms.org.conscrypt".equals(
NativeCrypto.class.getPackage().getName())) {
System.loadLibrary("conscrypt_gmscore_jni");
} else {
System.loadLibrary("conscrypt_jni");
}
}

private NativeCryptoJni() {
}
private NativeCryptoJni() {}
}
Loading
Loading