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-11-08 09:18:38 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-11-08 09:18:38 +0400
commitcb5c2b1e900729d4fd367ec3087accc92ca591bb (patch)
treec3bb638c4a421b6a892123d6099ad4a92349143c /core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java
parent33cdae127fd0b6262dd840783e23fb47acf6af9e (diff)
Add calls to TlsHandshakeHash.stopTracking()
Add TODOs to reconsider how the server calculates the CertificateVerify handshake hash for TLS 1.2
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java20
1 files changed, 5 insertions, 15 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java b/core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java
index 9736d2e1..e7cf554f 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java
@@ -65,25 +65,15 @@ class DeferredHash
checkStopBuffering();
}
- public void keepHashAlgorithms(short[] hashAlgorithms)
+ public void stopTracking()
{
- Hashtable kept = new Hashtable();
-
- Enumeration e = hashes.keys();
- while (e.hasMoreElements())
+ if (hashes.size() > 1)
{
- Short key = (Short)e.nextElement();
- short hashAlgorithm = key.shortValue();
-
- if (hashAlgorithm == prfHashAlgorithm.shortValue()
- || TlsProtocol.arrayContains(hashAlgorithms, hashAlgorithm))
- {
- kept.put(key, hashes.get(key));
- }
+ Digest prfHash = (Digest)hashes.get(prfHashAlgorithm);
+ hashes = new Hashtable();
+ hashes.put(prfHashAlgorithm, prfHash);
}
- this.hashes = kept;
-
checkStopBuffering();
}