Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Conscrypt to 1.0.0.RC11 #7235

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -67,11 +67,11 @@ private ConscryptAlpnSslEngine(SSLEngine engine, ByteBufAllocator alloc, List<St
// Alternatively, if an allocator is provided, no internal buffer will be created and direct buffers will be
// retrieved from the allocator on-demand.
if (USE_BUFFER_ALLOCATOR) {
Conscrypt.Engines.setBufferAllocator(engine, new BufferAllocatorAdapter(alloc));
Conscrypt.setBufferAllocator(engine, new BufferAllocatorAdapter(alloc));
}

// Set the list of supported ALPN protocols on the engine.
Conscrypt.Engines.setAlpnProtocols(engine, protocols.toArray(new String[protocols.size()]));
Conscrypt.setApplicationProtocols(engine, protocols.toArray(new String[protocols.size()]));
}

/**
Expand All @@ -84,13 +84,13 @@ private ConscryptAlpnSslEngine(SSLEngine engine, ByteBufAllocator alloc, List<St
*/
final int calculateOutNetBufSize(int plaintextBytes, int numBuffers) {
// Assuming a max of one frame per component in a composite buffer.
long maxOverhead = (long) Conscrypt.Engines.maxSealOverhead(getWrappedEngine()) * numBuffers;
long maxOverhead = (long) Conscrypt.maxSealOverhead(getWrappedEngine()) * numBuffers;
// TODO(nmittler): update this to use MAX_ENCRYPTED_PACKET_LENGTH instead of Integer.MAX_VALUE
return (int) min(Integer.MAX_VALUE, plaintextBytes + maxOverhead);
}

final SSLEngineResult unwrap(ByteBuffer[] srcs, ByteBuffer[] dests) throws SSLException {
return Conscrypt.Engines.unwrap(getWrappedEngine(), srcs, dests);
return Conscrypt.unwrap(getWrappedEngine(), srcs, dests);
}

private static final class ClientEngine extends ConscryptAlpnSslEngine {
Expand All @@ -100,7 +100,7 @@ private static final class ClientEngine extends ConscryptAlpnSslEngine {
JdkApplicationProtocolNegotiator applicationNegotiator) {
super(engine, alloc, applicationNegotiator.protocols());
// Register for completion of the handshake.
Conscrypt.Engines.setHandshakeListener(engine, new HandshakeListener() {
Conscrypt.setHandshakeListener(engine, new HandshakeListener() {
@Override
public void onHandshakeFinished() throws SSLException {
selectProtocol();
Expand All @@ -113,7 +113,7 @@ public void onHandshakeFinished() throws SSLException {
}

private void selectProtocol() throws SSLException {
String protocol = Conscrypt.Engines.getAlpnSelectedProtocol(getWrappedEngine());
String protocol = Conscrypt.getApplicationProtocol(getWrappedEngine());
try {
protocolListener.selected(protocol);
} catch (Throwable e) {
Expand All @@ -130,7 +130,7 @@ private static final class ServerEngine extends ConscryptAlpnSslEngine {
super(engine, alloc, applicationNegotiator.protocols());

// Register for completion of the handshake.
Conscrypt.Engines.setHandshakeListener(engine, new HandshakeListener() {
Conscrypt.setHandshakeListener(engine, new HandshakeListener() {
@Override
public void onHandshakeFinished() throws SSLException {
selectProtocol();
Expand All @@ -145,7 +145,7 @@ public void onHandshakeFinished() throws SSLException {

private void selectProtocol() throws SSLException {
try {
String protocol = Conscrypt.Engines.getAlpnSelectedProtocol(getWrappedEngine());
String protocol = Conscrypt.getApplicationProtocol(getWrappedEngine());
protocolSelector.select(protocol != null ? Collections.singletonList(protocol)
: Collections.<String>emptyList());
} catch (Throwable e) {
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -194,7 +194,7 @@
<tcnative.classifier>${os.detected.classifier}</tcnative.classifier>
<conscrypt.groupId>org.conscrypt</conscrypt.groupId>
<conscrypt.artifactId>conscrypt-openjdk-uber</conscrypt.artifactId>
<conscrypt.version>1.0.0.RC9</conscrypt.version>
<conscrypt.version>1.0.0.RC11</conscrypt.version>
<conscrypt.classifier />
<jni.classifier>${os.detected.name}-${os.detected.arch}</jni.classifier>
<logging.config>${project.basedir}/../common/src/test/resources/logback-test.xml</logging.config>
Expand Down