diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-06-22 08:31:53 +0400 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2013-06-22 08:31:53 +0400 |
commit | 91dbc4003bc6504d407b9a225872e4ac0ba5bf98 (patch) | |
tree | 9d5e7c8ba16cd8723fe70d21c38b75f52994d552 /core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java | |
parent | f4785f88c92f3f15b4c7bc0cb74ca67726891cb7 (diff) |
Store the server certificate in a field
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java')
-rw-r--r-- | core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java index 7ff819ec..c1efe7d2 100644 --- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java +++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java @@ -27,6 +27,8 @@ public class TlsClientProtocol protected TlsKeyExchange keyExchange = null; protected TlsAuthentication authentication = null; + + protected Certificate serverCertificate = null; protected CertificateStatus certificateStatus = null; protected CertificateRequest certificateRequest = null; @@ -100,6 +102,7 @@ public class TlsClientProtocol this.clientExtensions = null; this.keyExchange = null; this.authentication = null; + this.serverCertificate = null; this.certificateStatus = null; this.certificateRequest = null; } @@ -159,20 +162,20 @@ public class TlsClientProtocol { // Parse the Certificate message and send to cipher suite - Certificate serverCertificate = Certificate.parse(buf); + this.serverCertificate = Certificate.parse(buf); assertEmpty(buf); // TODO[RFC 3546] Check whether empty certificates is possible, allowed, or excludes CertificateStatus - if (serverCertificate == null || serverCertificate.isEmpty()) + if (this.serverCertificate == null || this.serverCertificate.isEmpty()) { this.allowCertificateStatus = false; } - this.keyExchange.processServerCertificate(serverCertificate); + this.keyExchange.processServerCertificate(this.serverCertificate); this.authentication = tlsClient.getAuthentication(); - this.authentication.notifyServerCertificate(serverCertificate); + this.authentication.notifyServerCertificate(this.serverCertificate); break; } |