123 {
124 if (offset < 0 || offset > ((
buffer !=
null) ?
buffer.Length : 0))
125 {
126 throw new ArgumentOutOfRangeException("offset");
127 }
129 {
130 throw new ArgumentOutOfRangeException("count");
131 }
132 if (isNtlm)
133 {
135 }
136 TwoSecurityBuffers twoSecurityBuffers = default(TwoSecurityBuffers);
137 Span<SecurityBuffer>
input =
MemoryMarshal.CreateSpan(ref twoSecurityBuffers._item0, 2);
139 input[1] =
new SecurityBuffer(0, SecurityBufferType.SECBUFFER_DATA);
140 int num = ((!isConfidential) ? SSPIWrapper.VerifySignature(GlobalSSPI.SSPIAuth, securityContext,
input, sequenceNumber) : SSPIWrapper.DecryptMessage(GlobalSSPI.SSPIAuth, securityContext,
input, sequenceNumber));
141 if (num != 0)
142 {
145 {
147 }
148 throw ex;
149 }
150 if (
input[1].
type != SecurityBufferType.SECBUFFER_DATA)
151 {
152 throw new InternalException(
input[1].
type);
153 }
154 newOffset =
input[1].offset;
155 return input[1].size;
156 }
static readonly System.Net.NetEventSource Log
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static int DecryptNtlm(SafeDeleteContext securityContext, byte[] buffer, int offset, int count, bool isConfidential, out int newOffset, uint sequenceNumber)