示例#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);
        }
示例#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);
        }
示例#3
0
        public IProtocolMessage CreateAlertMessage(AlertLevel level, AlertDescription desc)
        {
            AlertProtocolMessage apm = new AlertProtocolMessage(level, desc);

            return(apm);
        }
示例#4
0
        public void ProcessHelloRequest()
        {
            AlertProtocolMessage apm = new AlertProtocolMessage(AlertLevel.Warning, AlertDescription.NoRenegotiation);

            m_ProtocolQueue.Enqueue(apm);
        }