Skip to content

Commit 4f72d35

Browse files
committed
TLS: always send CCS immediately before FINISHED message
1 parent 0801c15 commit 4f72d35

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

crypto/src/crypto/tls/TlsClientProtocol.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ protected override void HandleHandshakeMessage(byte type, MemoryStream buf)
145145
ProcessFinishedMessage(buf);
146146
this.mConnectionState = CS_SERVER_FINISHED;
147147

148+
SendChangeCipherSpecMessage();
148149
SendFinishedMessage();
149150
this.mConnectionState = CS_CLIENT_FINISHED;
150151

@@ -266,8 +267,6 @@ protected override void HandleHandshakeMessage(byte type, MemoryStream buf)
266267
{
267268
this.mSecurityParameters.masterSecret = Arrays.Clone(this.mSessionParameters.MasterSecret);
268269
this.mRecordStream.SetPendingConnectionState(Peer.GetCompression(), Peer.GetCipher());
269-
270-
SendChangeCipherSpecMessage();
271270
}
272271
else
273272
{

crypto/src/crypto/tls/TlsServerProtocol.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,10 @@ protected override void HandleHandshakeMessage(byte type, MemoryStream buf)
359359
if (this.mExpectSessionTicket)
360360
{
361361
SendNewSessionTicketMessage(mTlsServer.GetNewSessionTicket());
362-
SendChangeCipherSpecMessage();
363362
}
364363
this.mConnectionState = CS_SERVER_SESSION_TICKET;
365364

365+
SendChangeCipherSpecMessage();
366366
SendFinishedMessage();
367367
this.mConnectionState = CS_SERVER_FINISHED;
368368

@@ -647,11 +647,6 @@ protected virtual void ReceiveClientKeyExchangeMessage(MemoryStream buf)
647647
}
648648

649649
mRecordStream.SetPendingConnectionState(Peer.GetCompression(), Peer.GetCipher());
650-
651-
if (!mExpectSessionTicket)
652-
{
653-
SendChangeCipherSpecMessage();
654-
}
655650
}
656651

657652
protected virtual void SendCertificateRequestMessage(CertificateRequest certificateRequest)

0 commit comments

Comments
 (0)