Skip to content

Commit

Permalink
work on multi-release jar build for BC TLS.
Browse files Browse the repository at this point in the history
  • Loading branch information
dghgit committed Mar 14, 2019
1 parent eb72274 commit 9da6458
Show file tree
Hide file tree
Showing 16 changed files with 1,444 additions and 0 deletions.
1 change: 1 addition & 0 deletions ant/jdk15+.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<fileset dir="prov/src/test/resources" includes="**/*.*" />

<fileset dir="tls/src/main/java" includes="**/*.java" />
<fileset dir="tls/src/main/jdk1.5" includes="**/*.java" />
<fileset dir="tls/src/main/javadoc" includes="**/*.html" />
<fileset dir="tls/src/test/java" includes="**/*.java" />
<fileset dir="tls/src/test/resources" includes="**/*.*" />
Expand Down
2 changes: 2 additions & 0 deletions pkix/src/main/jdk1.9/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
module org.bouncycastle.pkix
{
requires java.logging;
requires java.naming;
requires org.bouncycastle.provider;

exports org.bouncycastle.cert;
Expand Down
3 changes: 3 additions & 0 deletions prov/src/main/jdk1.9/module-info.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
module org.bouncycastle.provider
{
requires java.sql;
requires java.naming;

exports org.bouncycastle;
exports org.bouncycastle.asn1;
exports org.bouncycastle.asn1.anssi;
Expand Down
4 changes: 4 additions & 0 deletions tls/src/main/jdk1.9/module-info.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module org.bouncycastle.tls
{
provides java.security.Provider with org.bouncycastle.jsse.provider.BouncyCastleJsseProvider;

requires java.logging;
requires org.bouncycastle.provider;

exports org.bouncycastle.jsse;
exports org.bouncycastle.tls;
exports org.bouncycastle.jsse.provider;
exports org.bouncycastle.jsse.java.security;
exports org.bouncycastle.tls.crypto;
exports org.bouncycastle.tls.crypto.impl;
exports org.bouncycastle.tls.crypto.impl.bc;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
package org.bouncycastle.jsse.provider;

import java.security.Principal;
import java.security.cert.Certificate;

import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSessionContext;

import org.bouncycastle.jsse.BCExtendedSSLSession;

class ExportSSLSession_5
implements SSLSession, ExportSSLSession
{
final BCExtendedSSLSession sslSession;

ExportSSLSession_5(BCExtendedSSLSession sslSession)
{
this.sslSession = sslSession;
}

public BCExtendedSSLSession unwrap()
{
return sslSession;
}

@Override
public boolean equals(Object obj)
{
return null != obj && obj.equals(sslSession);
}

public int getApplicationBufferSize()
{
return sslSession.getApplicationBufferSize();
}

public String getCipherSuite()
{
return sslSession.getCipherSuite();
}

public long getCreationTime()
{
return sslSession.getCreationTime();
}

public byte[] getId()
{
return sslSession.getId();
}

public long getLastAccessedTime()
{
return sslSession.getLastAccessedTime();
}

public Certificate[] getLocalCertificates()
{
return sslSession.getLocalCertificates();
}

public Principal getLocalPrincipal()
{
return sslSession.getLocalPrincipal();
}

public int getPacketBufferSize()
{
return sslSession.getPacketBufferSize();
}

public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
{
return sslSession.getPeerCertificateChain();
}

public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
{
return sslSession.getPeerCertificates();
}

public String getPeerHost()
{
return sslSession.getPeerHost();
}

public int getPeerPort()
{
return sslSession.getPeerPort();
}

public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
{
return sslSession.getPeerPrincipal();
}

public String getProtocol()
{
return sslSession.getProtocol();
}

public SSLSessionContext getSessionContext()
{
return sslSession.getSessionContext();
}

public Object getValue(String name)
{
return sslSession.getValue(name);
}

public String[] getValueNames()
{
return sslSession.getValueNames();
}

@Override
public int hashCode()
{
return sslSession.hashCode();
}

public void invalidate()
{
sslSession.invalidate();
}

public boolean isValid()
{
return sslSession.isValid();
}

public void putValue(String name, Object value)
{
sslSession.putValue(name, value);
}

public void removeValue(String name)
{
sslSession.removeValue(name);
}

@Override
public String toString()
{
return sslSession.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
package org.bouncycastle.jsse.provider;

import java.security.Principal;
import java.security.cert.Certificate;

import javax.net.ssl.ExtendedSSLSession;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSessionContext;

import org.bouncycastle.jsse.BCExtendedSSLSession;

class ExportSSLSession_7
extends ExtendedSSLSession
implements ExportSSLSession
{
final BCExtendedSSLSession sslSession;

ExportSSLSession_7(BCExtendedSSLSession sslSession)
{
this.sslSession = sslSession;
}

public BCExtendedSSLSession unwrap()
{
return sslSession;
}

@Override
public boolean equals(Object obj)
{
return null != obj && obj.equals(sslSession);
}

public int getApplicationBufferSize()
{
return sslSession.getApplicationBufferSize();
}

public String getCipherSuite()
{
return sslSession.getCipherSuite();
}

public long getCreationTime()
{
return sslSession.getCreationTime();
}

public byte[] getId()
{
return sslSession.getId();
}

public long getLastAccessedTime()
{
return sslSession.getLastAccessedTime();
}

public Certificate[] getLocalCertificates()
{
return sslSession.getLocalCertificates();
}

public Principal getLocalPrincipal()
{
return sslSession.getLocalPrincipal();
}

public String[] getLocalSupportedSignatureAlgorithms()
{
return sslSession.getLocalSupportedSignatureAlgorithms();
}

public int getPacketBufferSize()
{
return sslSession.getPacketBufferSize();
}

public javax.security.cert.X509Certificate[] getPeerCertificateChain() throws SSLPeerUnverifiedException
{
return sslSession.getPeerCertificateChain();
}

public Certificate[] getPeerCertificates() throws SSLPeerUnverifiedException
{
return sslSession.getPeerCertificates();
}

public String getPeerHost()
{
return sslSession.getPeerHost();
}

public int getPeerPort()
{
return sslSession.getPeerPort();
}

public Principal getPeerPrincipal() throws SSLPeerUnverifiedException
{
return sslSession.getPeerPrincipal();
}

public String[] getPeerSupportedSignatureAlgorithms()
{
return sslSession.getPeerSupportedSignatureAlgorithms();
}

public String getProtocol()
{
return sslSession.getProtocol();
}

public SSLSessionContext getSessionContext()
{
return sslSession.getSessionContext();
}

public Object getValue(String name)
{
return sslSession.getValue(name);
}

public String[] getValueNames()
{
return sslSession.getValueNames();
}

@Override
public int hashCode()
{
return sslSession.hashCode();
}

public void invalidate()
{
sslSession.invalidate();
}

public boolean isValid()
{
return sslSession.isValid();
}

public void putValue(String name, Object value)
{
sslSession.putValue(name, value);
}

public void removeValue(String name)
{
sslSession.removeValue(name);
}

@Override
public String toString()
{
return sslSession.toString();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.bouncycastle.jsse.provider;

import java.util.List;

import javax.net.ssl.SNIServerName;

import org.bouncycastle.jsse.BCExtendedSSLSession;

class ExportSSLSession_8
extends ExportSSLSession_7
{
ExportSSLSession_8(BCExtendedSSLSession sslSession)
{
super(sslSession);
}

@SuppressWarnings("unchecked")
public List<SNIServerName> getRequestedServerNames()
{
return (List<SNIServerName>)JsseUtils_8.exportSNIServerNames(sslSession.getRequestedServerNames());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package org.bouncycastle.jsse.provider;

import java.util.List;

import org.bouncycastle.jsse.BCExtendedSSLSession;

class ExportSSLSession_9
extends ExportSSLSession_8
{
ExportSSLSession_9(BCExtendedSSLSession sslSession)
{
super(sslSession);
}

public List<byte[]> getStatusResponses()
{
return sslSession.getStatusResponses();
}
}
Loading

0 comments on commit 9da6458

Please sign in to comment.