*/
using System;
+using System.Globalization;
using System.IO;
using Mono.Security.Protocol.Tls.Handshake;
{
// Create the record message
HandshakeMessage msg = this.createServerHandshakeMessage(type);
+ msg.Process();
// Write record
this.SendRecord(msg.ContentType, msg.EncodeMessage());
#region Handshake Processing Methods
+ protected override void ProcessChangeCipherSpec()
+ {
+ // Reset sequence numbers
+ this.context.ReadSequenceNumber = 0;
+
+ // Make the pending state to be the current state
+ this.context.IsActual = true;
+ }
+
protected override void ProcessHandshakeMessage(TlsStream handMsg)
{
HandshakeType handshakeType = (HandshakeType)handMsg.ReadByte();
// Create and process the server message
message = this.createClientHandshakeMessage(handshakeType, data);
+ message.Process();
// Update the last handshake message
this.Context.LastHandshakeMsg = handshakeType;
return new TlsClientFinished(this.context, buffer);
default:
- throw this.context.CreateException("Unknown server handshake message received ({0})", type.ToString());
+ throw new TlsException(
+ AlertDescription.UnexpectedMessage,
+ String.Format(CultureInfo.CurrentUICulture,
+ "Unknown server handshake message received ({0})",
+ type.ToString()));
}
}