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:27:04 +0400
committerPeter Dettman <peter.dettman@bouncycastle.org>2013-11-08 09:27:04 +0400
commit9be1eb93faa8ce28d81e0bacbe363ca9765503a7 (patch)
tree0779b1168f6e8043447c5bb1946cd429e6047674 /core/src/main/java/org/bouncycastle/crypto/tls
parentcb5c2b1e900729d4fd367ec3087accc92ca591bb (diff)
Rename some methods to make it clearer they relate to the PRF hash
Diffstat (limited to 'core/src/main/java/org/bouncycastle/crypto/tls')
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/CombinedHash.java2
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/DTLSClientProtocol.java10
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/DTLSReliableHandshake.java4
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java6
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java2
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java8
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java2
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsHandshakeHash.java2
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java4
-rw-r--r--core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java2
10 files changed, 21 insertions, 21 deletions
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/CombinedHash.java b/core/src/main/java/org/bouncycastle/crypto/tls/CombinedHash.java
index 01535d05..a433577d 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/CombinedHash.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/CombinedHash.java
@@ -48,7 +48,7 @@ class CombinedHash
{
}
- public Digest fork()
+ public Digest forkPRFHash()
{
return new CombinedHash(this);
}
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSClientProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSClientProtocol.java
index 123db41f..26e5db35 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSClientProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSClientProtocol.java
@@ -154,12 +154,12 @@ public class DTLSClientProtocol
// NOTE: Calculated exclusive of the actual Finished message from the server
byte[] expectedServerVerifyData = TlsUtils.calculateVerifyData(state.clientContext,
- ExporterLabel.server_finished, handshake.getCurrentHash());
+ ExporterLabel.server_finished, handshake.getCurrentPRFHash());
processFinished(handshake.receiveMessageBody(HandshakeType.finished), expectedServerVerifyData);
// NOTE: Calculated exclusive of the Finished message itself
byte[] clientVerifyData = TlsUtils.calculateVerifyData(state.clientContext, ExporterLabel.client_finished,
- handshake.getCurrentHash());
+ handshake.getCurrentPRFHash());
handshake.sendMessage(HandshakeType.finished, clientVerifyData);
handshake.finish();
@@ -318,7 +318,7 @@ public class DTLSClientProtocol
* TODO RFC 5246 4.7. digitally-signed element needs SignatureAndHashAlgorithm from TLS 1.2
*/
SignatureAndHashAlgorithm algorithm = null;
- byte[] hash = handshake.getCurrentHash();
+ byte[] hash = handshake.getCurrentPRFHash();
byte[] signature = signerCredentials.generateCertificateSignature(hash);
DigitallySigned certificateVerify = new DigitallySigned(algorithm, signature);
byte[] certificateVerifyBody = generateCertificateVerify(state, certificateVerify);
@@ -329,7 +329,7 @@ public class DTLSClientProtocol
// NOTE: Calculated exclusive of the Finished message itself
byte[] clientVerifyData = TlsUtils.calculateVerifyData(state.clientContext, ExporterLabel.client_finished,
- handshake.getCurrentHash());
+ handshake.getCurrentPRFHash());
handshake.sendMessage(HandshakeType.finished, clientVerifyData);
if (state.expectSessionTicket)
@@ -347,7 +347,7 @@ public class DTLSClientProtocol
// NOTE: Calculated exclusive of the actual Finished message from the server
byte[] expectedServerVerifyData = TlsUtils.calculateVerifyData(state.clientContext,
- ExporterLabel.server_finished, handshake.getCurrentHash());
+ ExporterLabel.server_finished, handshake.getCurrentPRFHash());
processFinished(handshake.receiveMessageBody(HandshakeType.finished), expectedServerVerifyData);
handshake.finish();
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSReliableHandshake.java b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSReliableHandshake.java
index bd9e1cb5..4726409e 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSReliableHandshake.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSReliableHandshake.java
@@ -36,9 +36,9 @@ class DTLSReliableHandshake
return handshakeHash;
}
- byte[] getCurrentHash()
+ byte[] getCurrentPRFHash()
{
- Digest copyOfHash = handshakeHash.fork();
+ Digest copyOfHash = handshakeHash.forkPRFHash();
byte[] result = new byte[copyOfHash.getDigestSize()];
copyOfHash.doFinal(result, 0);
return result;
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java
index a761f524..96df23d8 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/DTLSServerProtocol.java
@@ -260,7 +260,7 @@ public class DTLSServerProtocol
if (expectCertificateVerifyMessage(state))
{
// TODO For TLS 1.2, this can't be calculated until we see what hash algorithm the sender used
- byte[] certificateVerifyHash = handshake.getCurrentHash();
+ byte[] certificateVerifyHash = handshake.getCurrentPRFHash();
byte[] certificateVerifyBody = handshake.receiveMessageBody(HandshakeType.certificate_verify);
processCertificateVerify(state, certificateVerifyBody, certificateVerifyHash);
@@ -269,7 +269,7 @@ public class DTLSServerProtocol
// NOTE: Calculated exclusive of the actual Finished message from the client
byte[] expectedClientVerifyData = TlsUtils.calculateVerifyData(state.serverContext,
- ExporterLabel.client_finished, handshake.getCurrentHash());
+ ExporterLabel.client_finished, handshake.getCurrentPRFHash());
processFinished(handshake.receiveMessageBody(HandshakeType.finished), expectedClientVerifyData);
if (state.expectSessionTicket)
@@ -281,7 +281,7 @@ public class DTLSServerProtocol
// NOTE: Calculated exclusive of the Finished message itself
byte[] serverVerifyData = TlsUtils.calculateVerifyData(state.serverContext, ExporterLabel.server_finished,
- handshake.getCurrentHash());
+ handshake.getCurrentPRFHash());
handshake.sendMessage(HandshakeType.finished, serverVerifyData);
handshake.finish();
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 e7cf554f..2ae19578 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/DeferredHash.java
@@ -77,7 +77,7 @@ class DeferredHash
checkStopBuffering();
}
- public Digest fork()
+ public Digest forkPRFHash()
{
if (buf != null)
{
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java b/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java
index 0f7336c9..4c3fc845 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/RecordStream.java
@@ -293,15 +293,15 @@ class RecordStream
/**
* 'sender' only relevant to SSLv3
*/
- byte[] getCurrentHash(byte[] sender)
+ byte[] getCurrentPRFHash(byte[] sslSender)
{
- Digest d = handshakeHash.fork();
+ Digest d = handshakeHash.forkPRFHash();
if (TlsUtils.isSSL(context))
{
- if (sender != null)
+ if (sslSender != null)
{
- d.update(sender, 0, sender.length);
+ d.update(sslSender, 0, sslSender.length);
}
}
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 938ea4f7..dd0dc65c 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsClientProtocol.java
@@ -379,7 +379,7 @@ public class TlsClientProtocol
* TODO RFC 5246 4.7. digitally-signed element needs SignatureAndHashAlgorithm from TLS 1.2
*/
SignatureAndHashAlgorithm algorithm = null;
- byte[] hash = recordStream.getCurrentHash(null);
+ byte[] hash = recordStream.getCurrentPRFHash(null);
byte[] signature = signerCreds.generateCertificateSignature(hash);
DigitallySigned certificateVerify = new DigitallySigned(algorithm, signature);
sendCertificateVerifyMessage(certificateVerify);
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsHandshakeHash.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsHandshakeHash.java
index 6be3c05c..9c866b1e 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsHandshakeHash.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsHandshakeHash.java
@@ -15,5 +15,5 @@ interface TlsHandshakeHash
void stopTracking();
- Digest fork();
+ Digest forkPRFHash();
}
diff --git a/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java b/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java
index 8dd2a5be..262e222e 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsProtocol.java
@@ -747,11 +747,11 @@ public abstract class TlsProtocol
if (isServer)
{
return TlsUtils.calculateVerifyData(context, ExporterLabel.server_finished,
- recordStream.getCurrentHash(TlsUtils.SSL_SERVER));
+ recordStream.getCurrentPRFHash(TlsUtils.SSL_SERVER));
}
return TlsUtils.calculateVerifyData(context, ExporterLabel.client_finished,
- recordStream.getCurrentHash(TlsUtils.SSL_CLIENT));
+ recordStream.getCurrentPRFHash(TlsUtils.SSL_CLIENT));
}
/**
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 fdde1beb..7be1b43d 100644
--- a/core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java
+++ b/core/src/main/java/org/bouncycastle/crypto/tls/TlsServerProtocol.java
@@ -576,7 +576,7 @@ public class TlsServerProtocol
if (expectCertificateVerifyMessage())
{
// TODO For TLS 1.2, this can't be calculated until we see what hash algorithm the sender used
- this.certificateVerifyHash = recordStream.getCurrentHash(null);
+ this.certificateVerifyHash = recordStream.getCurrentPRFHash(null);
}
else
{