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

            while (true)
            {
                if (num >= len)
                {
                    return;
                }
                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++;
            }
            throw new TlsFatalAlert(10);
        }
Beispiel #2
0
 private void ProcessChangeCipherSpec(byte[] buf, int off, int len)
 {
     for (int i = 0; i < len; i++)
     {
         byte b = TlsUtilities.ReadUint8(buf, off + i);
         if (b != 1)
         {
             throw new TlsFatalAlert(50);
         }
         if (mReceivedChangeCipherSpec || mAlertQueue.Available > 0 || mHandshakeQueue.Available > 0)
         {
             throw new TlsFatalAlert(10);
         }
         mRecordStream.ReceivedReadCipherSpec();
         mReceivedChangeCipherSpec = true;
         HandleChangeCipherSpecMessage();
     }
 }