Sign() private method

Performs MAC signing of the SMB.
Performs MAC signing of the SMB. This is done as follows. The signature field of the SMB is overwritted with the sequence number; The MD5 digest of the MAC signing key + the entire SMB is taken; The first 8 bytes of this are placed in the signature field.
private Sign ( byte data, int offset, int length, ServerMessageBlock request, ServerMessageBlock response ) : void
data byte The data.
offset int The starting offset at which the SMB header begins.
length int The length of the SMB data starting at offset.
request ServerMessageBlock
response ServerMessageBlock
return void
Example #1
0
        internal virtual int Encode(byte[] dst, int dstIndex)
        {
            int start = HeaderStart = dstIndex;

            dstIndex       += WriteHeaderWireFormat(dst, dstIndex);
            WordCount       = WriteParameterWordsWireFormat(dst, dstIndex + 1);
            dst[dstIndex++] = unchecked ((byte)((WordCount / 2) & 0xFF));
            dstIndex       += WordCount;
            WordCount      /= 2;
            ByteCount       = WriteBytesWireFormat(dst, dstIndex + 2);
            dst[dstIndex++] = unchecked ((byte)(ByteCount & 0xFF));
            dst[dstIndex++] = unchecked ((byte)((ByteCount >> 8) & 0xFF));
            dstIndex       += ByteCount;
            Length          = dstIndex - start;
            if (Digest != null)
            {
                Digest.Sign(dst, HeaderStart, Length, this, Response);
            }
            return(Length);
        }