示例#1
0
    private void ProcessChangeCipherSpec(byte[] buf, int off, int len)
    {
        int num = 0;

        while (true)
        {
            if (num < len)
            {
                byte b = TlsUtilities.ReadUint8(buf, off + num);
                if (b != 1)
                {
                    throw new TlsFatalAlert(50);
                }
                if (mReceivedChangeCipherSpec || mAlertQueue.Available > 0 || mHandshakeQueue.Available > 0)
                {
                    break;
                }
                mRecordStream.ReceivedReadCipherSpec();
                mReceivedChangeCipherSpec = true;
                HandleChangeCipherSpecMessage();
                num++;
                continue;
            }
            return;
        }
        throw new TlsFatalAlert(10);
    }