summary refs log tree commit diff
path: root/crypto/src
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/src')
-rw-r--r--crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs2
-rw-r--r--crypto/src/crypto/tls/DeferredHash.cs10
2 files changed, 8 insertions, 4 deletions
diff --git a/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs b/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs

index ef80c4b06..c7a136573 100644 --- a/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs +++ b/crypto/src/crypto/tls/DefaultTlsSignerCredentials.cs
@@ -51,6 +51,8 @@ namespace Org.BouncyCastle.Crypto.Tls throw new ArgumentException("type not supported: " + privateKey.GetType().FullName, "privateKey"); } + this.mSigner.Init(context); + this.mContext = context; this.mCertificate = certificate; this.mPrivateKey = privateKey; diff --git a/crypto/src/crypto/tls/DeferredHash.cs b/crypto/src/crypto/tls/DeferredHash.cs
index c2d5ab5b6..1112d4a3c 100644 --- a/crypto/src/crypto/tls/DeferredHash.cs +++ b/crypto/src/crypto/tls/DeferredHash.cs
@@ -73,12 +73,13 @@ namespace Org.BouncyCastle.Crypto.Tls public virtual TlsHandshakeHash StopTracking() { - IDigest prfHash = TlsUtilities.CloneHash((byte)mPrfHashAlgorithm, (IDigest)mHashes[mPrfHashAlgorithm]); + byte prfHashAlgorithm = (byte)mPrfHashAlgorithm; + IDigest prfHash = TlsUtilities.CloneHash(prfHashAlgorithm, (IDigest)mHashes[prfHashAlgorithm]); if (mBuf != null) { mBuf.UpdateDigest(prfHash); } - DeferredHash result = new DeferredHash((byte)mPrfHashAlgorithm, prfHash); + DeferredHash result = new DeferredHash(prfHashAlgorithm, prfHash); result.Init(mContext); return result; } @@ -87,14 +88,15 @@ namespace Org.BouncyCastle.Crypto.Tls { CheckStopBuffering(); + byte prfHashAlgorithm = (byte)mPrfHashAlgorithm; if (mBuf != null) { - IDigest prfHash = TlsUtilities.CreateHash((byte)mPrfHashAlgorithm); + IDigest prfHash = TlsUtilities.CreateHash(prfHashAlgorithm); mBuf.UpdateDigest(prfHash); return prfHash; } - return TlsUtilities.CloneHash((byte)mPrfHashAlgorithm, (IDigest)mHashes[mPrfHashAlgorithm]); + return TlsUtilities.CloneHash(prfHashAlgorithm, (IDigest)mHashes[prfHashAlgorithm]); } public virtual byte[] GetFinalHash(byte hashAlgorithm)