Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/quite/humla-spongycastle.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Dettman <peter.dettman@bouncycastle.org>2013-06-23 13:32:09 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-06-23 13:32:09 +0400
commitad2a7d6a07743254a32cf170be22fcabf5159aac (patch)
tree3faad271ea5b3566779987d2b7ce4c556a424acf /core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java
parent34656055887593414f3941edd38a8140e171b711 (diff)
Add the peer certificate, if any, to the SessionParameters
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java
index 2d9df713..b2d3d6b3 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java
@@ -30,7 +30,6 @@ public class TlsServerProtocol
protected CertificateRequest certificateRequest = null;
protected short clientCertificateType = -1;
- protected Certificate clientCertificate = null;
protected byte[] certificateVerifyHash = null;
public TlsServerProtocol(InputStream input, OutputStream output, SecureRandom secureRandom)
@@ -82,7 +81,6 @@ public class TlsServerProtocol
this.keyExchange = null;
this.serverCredentials = null;
this.certificateRequest = null;
- this.clientCertificate = null;
this.certificateVerifyHash = null;
}
@@ -272,7 +270,7 @@ public class TlsServerProtocol
}
else if (TlsUtils.isSSL(getContext()))
{
- if (clientCertificate == null)
+ if (this.peerCertificate == null)
{
this.failWithError(AlertLevel.fatal, AlertDescription.unexpected_message);
}
@@ -403,12 +401,12 @@ public class TlsServerProtocol
throw new IllegalStateException();
}
- if (this.clientCertificate != null)
+ if (this.peerCertificate != null)
{
throw new TlsFatalAlert(AlertDescription.unexpected_message);
}
- this.clientCertificate = clientCertificate;
+ this.peerCertificate = clientCertificate;
if (clientCertificate.isEmpty())
{
@@ -463,7 +461,7 @@ public class TlsServerProtocol
TlsSigner tlsSigner = TlsUtils.createTlsSigner(this.clientCertificateType);
tlsSigner.init(getContext());
- org.bouncycastle.asn1.x509.Certificate x509Cert = this.clientCertificate.getCertificateAt(0);
+ org.bouncycastle.asn1.x509.Certificate x509Cert = this.peerCertificate.getCertificateAt(0);
SubjectPublicKeyInfo keyInfo = x509Cert.getSubjectPublicKeyInfo();
AsymmetricKeyParameter publicKey = PublicKeyFactory.createKey(keyInfo);