diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-03-16 22:12:00 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2022-03-16 22:12:00 +0700 |
commit | e7844d7f83a4d5321f02c9f169cd206149e9a184 (patch) | |
tree | c818b2ec2026b4db29e28c9e3dc6891cef41eab4 /crypto/src/tls/DtlsServerProtocol.cs | |
parent | Refactoring (diff) | |
download | BouncyCastle.NET-ed25519-e7844d7f83a4d5321f02c9f169cd206149e9a184.tar.xz |
DTLS: delayed handshake hash update
- avoid clone of handshake hash
Diffstat (limited to 'crypto/src/tls/DtlsServerProtocol.cs')
-rw-r--r-- | crypto/src/tls/DtlsServerProtocol.cs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/crypto/src/tls/DtlsServerProtocol.cs b/crypto/src/tls/DtlsServerProtocol.cs index 99c47ba1b..b49122423 100644 --- a/crypto/src/tls/DtlsServerProtocol.cs +++ b/crypto/src/tls/DtlsServerProtocol.cs @@ -297,12 +297,17 @@ namespace Org.BouncyCastle.Tls * parameters). */ { - TlsHandshakeHash certificateVerifyHash = handshake.PrepareToFinish(); - if (ExpectCertificateVerifyMessage(state)) { - byte[] certificateVerifyBody = handshake.ReceiveMessageBody(HandshakeType.certificate_verify); - ProcessCertificateVerify(state, certificateVerifyBody, certificateVerifyHash); + clientMessage = handshake.ReceiveMessageDelayedDigest(HandshakeType.certificate_verify); + byte[] certificateVerifyBody = clientMessage.Body; + ProcessCertificateVerify(state, certificateVerifyBody, handshake.HandshakeHash); + handshake.PrepareToFinish(); + handshake.UpdateHandshakeMessagesDigest(clientMessage); + } + else + { + handshake.PrepareToFinish(); } } |