Commit 1669537a authored by Kenny Root's avatar Kenny Root Committed by android-build-merger
Browse files

Revert "Add ExtendedSSLSession, et al." am: 132c311d

am: 85ef1e25

* commit '85ef1e25':
  Revert "Add ExtendedSSLSession, et al."
parents c4d6ca14 85ef1e25
......@@ -37,7 +37,6 @@ import java.security.spec.ECParameterSpec;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
......@@ -461,16 +460,4 @@ public class Platform {
return oid;
}
/*
* Pre-Java 8 backward compatibility.
*/
public static SSLSession wrapSSLSession(OpenSSLSessionImpl sslSession) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.M) {
return sslSession;
} else {
return new OpenSSLExtendedSessionImpl(sslSession);
}
}
}
/*
* Copyright 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.conscrypt;
import java.security.Principal;
import java.security.cert.Certificate;
import java.util.List;
import javax.net.ssl.ExtendedSSLSession;
import javax.net.ssl.SNIServerName;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSessionContext;
import javax.security.cert.X509Certificate;
/**
* Implementation of the ExtendedSSLSession class for OpenSSL. Uses a delegate to maintain backward
* compatibility with previous versions of Android which don't have ExtendedSSLSession.
*/
public class OpenSSLExtendedSessionImpl extends ExtendedSSLSession {
private final OpenSSLSessionImpl delegate;
public OpenSSLExtendedSessionImpl(OpenSSLSessionImpl delegate) {
this.delegate = delegate;
}
public String[] getLocalSupportedSignatureAlgorithms() {
throw new UnsupportedOperationException();
}
public String[] getPeerSupportedSignatureAlgorithms() {
throw new UnsupportedOperationException();
}
public List<SNIServerName> getRequestedServerNames() {
throw new UnsupportedOperationException();
}
@Override
public byte[] getId() {
return delegate.getId();
}
@Override
public SSLSessionContext getSessionContext() {
return delegate.getSessionContext();
}
@Override
public long getCreationTime() {
return delegate.getCreationTime();
}
@Override
public long getLastAccessedTime() {
return delegate.getLastAccessedTime();
}
@Override
public void invalidate() {
delegate.invalidate();
}
@Override
public boolean isValid() {
return delegate.isValid();
}
@Override
public void putValue(String name, Object value) {
delegate.putValue(name, value);
}
@Override
public Object getValue(String name) {
return delegate.getValue(name);
}
@Override
public void removeValue(String name) {
delegate.removeValue(name);
}
@Override
public String[] getValueNames() {
return delegate.getValueNames();
}
@Override
public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException {
return delegate.getPeerCertificates();
}
@Override
public Certificate[] getLocalCertificates() {
return delegate.getLocalCertificates();
}
@Override
public X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException {
return delegate.getPeerCertificateChain();
}
@Override
public Principal getPeerPrincipal() throws SSLPeerUnverifiedException {
return delegate.getPeerPrincipal();
}
@Override
public Principal getLocalPrincipal() {
return delegate.getLocalPrincipal();
}
@Override
public String getCipherSuite() {
return delegate.getCipherSuite();
}
@Override
public String getProtocol() {
return delegate.getProtocol();
}
@Override
public String getPeerHost() {
return delegate.getPeerHost();
}
@Override
public int getPeerPort() {
return delegate.getPeerPort();
}
@Override
public int getPacketBufferSize() {
return delegate.getPacketBufferSize();
}
@Override
public int getApplicationBufferSize() {
return delegate.getApplicationBufferSize();
}
}
......@@ -828,7 +828,7 @@ public class OpenSSLSocketImpl
return SSLNullSession.getNullSession();
}
}
return Platform.wrapSSLSession(sslSession);
return sslSession;
}
@Override
......
......@@ -32,7 +32,6 @@ import java.security.spec.ECParameterSpec;
import javax.crypto.spec.GCMParameterSpec;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import sun.security.x509.AlgorithmId;
......@@ -211,12 +210,4 @@ public class Platform {
return oid;
}
}
/*
* Pre-Java 8 backward compatibility.
*/
public static SSLSession wrapSSLSession(OpenSSLSessionImpl sslSession) {
return new OpenSSLExtendedSessionImpl(sslSession);
}
}
......@@ -41,7 +41,6 @@ import java.security.spec.ECParameterSpec;
import javax.crypto.spec.GCMParameterSpec;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import org.conscrypt.GCMParameters;
......@@ -229,12 +228,4 @@ class Platform {
return oid;
}
}
/*
* Pre-Java 8 backward compatibility.
*/
public static SSLSession wrapSSLSession(OpenSSLSessionImpl sslSession) {
return new OpenSSLExtendedSessionImpl(sslSession);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment