public static ExtractMessagesResult ExtractMessages(ProtoType type, byte[] buffer) { ExtractMessagesResult result = new ExtractMessagesResult(); switch (type) { case ProtoType.Handshake: CreateHandshakeMessages(buffer, result); break; case ProtoType.ChangeCipherSpec: CCSProtocolMessage cMsg = CreateCCSMessage(buffer); result.protocolMessages.Add(cMsg); break; case ProtoType.Alert: AlertProtocolMessage aMsg = CreateAlertMessage(buffer); result.protocolMessages.Add(aMsg); break; case ProtoType.ApplicationData: ApplicationProtocolMessage apm = CreateAPMessage(buffer); result.protocolMessages.Add(apm); break; } return(result); }
private static AlertProtocolMessage CreateAlertMessage(byte[] buffer) { AlertProtocolMessage aMsg = null; try { aMsg = new AlertProtocolMessage(buffer); } catch (Exception) { throw new SslAlertException(AlertLevel.Fatal, AlertDescription.DecodeError); } return(aMsg); }
public IProtocolMessage CreateAlertMessage(AlertLevel level, AlertDescription desc) { AlertProtocolMessage apm = new AlertProtocolMessage(level, desc); return(apm); }
public void ProcessHelloRequest() { AlertProtocolMessage apm = new AlertProtocolMessage(AlertLevel.Warning, AlertDescription.NoRenegotiation); m_ProtocolQueue.Enqueue(apm); }