summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--crypto/src/tls/DeferredHash.cs20
-rw-r--r--crypto/src/tls/DigestInputBuffer.cs2
-rw-r--r--crypto/src/tls/TlsUtilities.cs2
3 files changed, 13 insertions, 11 deletions
diff --git a/crypto/src/tls/DeferredHash.cs b/crypto/src/tls/DeferredHash.cs
index f97e9c088..ac66c8f0c 100644
--- a/crypto/src/tls/DeferredHash.cs
+++ b/crypto/src/tls/DeferredHash.cs
@@ -38,7 +38,7 @@ namespace Org.BouncyCastle.Tls
                 throw new InvalidOperationException("Not buffering");
             }
 
-            m_buf.CopyTo(output);
+            m_buf.CopyInputTo(output);
         }
 
         public void ForceBuffering()
@@ -97,8 +97,8 @@ namespace Org.BouncyCastle.Tls
             case PrfAlgorithm.ssl_prf_legacy:
             case PrfAlgorithm.tls_prf_legacy:
             {
-                CloneHash(newHashes, HashAlgorithm.md5);
-                CloneHash(newHashes, HashAlgorithm.sha1);
+                CloneHash(newHashes, CryptoHashAlgorithm.md5);
+                CloneHash(newHashes, CryptoHashAlgorithm.sha1);
                 break;
             }
             default:
@@ -126,7 +126,9 @@ namespace Org.BouncyCastle.Tls
             case PrfAlgorithm.ssl_prf_legacy:
             case PrfAlgorithm.tls_prf_legacy:
             {
-                prfHash = new CombinedHash(m_context, CloneHash(HashAlgorithm.md5), CloneHash(HashAlgorithm.sha1));
+                TlsHash md5Hash = CloneHash(CryptoHashAlgorithm.md5);
+                TlsHash sha1Hash = CloneHash(CryptoHashAlgorithm.sha1);
+                prfHash = new CombinedHash(m_context, md5Hash, sha1Hash);
                 break;
             }
             default:
@@ -146,20 +148,20 @@ namespace Org.BouncyCastle.Tls
 
         public byte[] GetFinalHash(int cryptoHashAlgorithm)
         {
-            TlsHash d = (TlsHash)m_hashes[cryptoHashAlgorithm];
-            if (d == null)
+            TlsHash hash = (TlsHash)m_hashes[cryptoHashAlgorithm];
+            if (hash == null)
                 throw new InvalidOperationException("CryptoHashAlgorithm." + cryptoHashAlgorithm
                     + " is not being tracked");
 
             CheckStopBuffering();
 
-            d = d.CloneHash();
+            hash = hash.CloneHash();
             if (m_buf != null)
             {
-                m_buf.UpdateDigest(d);
+                m_buf.UpdateDigest(hash);
             }
 
-            return d.CalculateHash();
+            return hash.CalculateHash();
         }
 
         public void Update(byte[] input, int inOff, int len)
diff --git a/crypto/src/tls/DigestInputBuffer.cs b/crypto/src/tls/DigestInputBuffer.cs
index 7dd525f88..9b4ea4b06 100644
--- a/crypto/src/tls/DigestInputBuffer.cs
+++ b/crypto/src/tls/DigestInputBuffer.cs
@@ -15,7 +15,7 @@ namespace Org.BouncyCastle.Tls
         }
 
         /// <exception cref="IOException"/>
-        internal void CopyTo(Stream output)
+        internal void CopyInputTo(Stream output)
         {
             // TODO[tls-port]
             // NOTE: Copy data since the output here may be under control of external code.
diff --git a/crypto/src/tls/TlsUtilities.cs b/crypto/src/tls/TlsUtilities.cs
index f48c7e731..1d9759bca 100644
--- a/crypto/src/tls/TlsUtilities.cs
+++ b/crypto/src/tls/TlsUtilities.cs
@@ -2118,7 +2118,7 @@ namespace Org.BouncyCastle.Tls
                 output.Write(extraSignatureInput, 0, extraSignatureInput.Length);
             }
 
-            buf.CopyTo(output);
+            buf.CopyInputTo(output);
 
             Platform.Dispose(output);
         }