Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        public IProtocolMessage CreateAlertMessage(AlertLevel level, AlertDescription desc)
        {
            AlertProtocolMessage apm = new AlertProtocolMessage(level, desc);

            return(apm);
        }
Exemplo n.º 4
0
        public void ProcessHelloRequest()
        {
            AlertProtocolMessage apm = new AlertProtocolMessage(AlertLevel.Warning, AlertDescription.NoRenegotiation);

            m_ProtocolQueue.Enqueue(apm);
        }