Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SSPIWrapper.cs
Go to the documentation of this file.
5
6namespace System.Net;
7
8internal static class SSPIWrapper
9{
10 private enum OP
11 {
12 Encrypt = 1,
13 Decrypt,
16 }
17
18 private ref struct ThreeByteArrays
19 {
20 internal byte[] _item0;
21
22 private byte[] _item1;
23
24 private byte[] _item2;
25 }
26
28 {
29 if (secModule.SecurityPackages == null)
30 {
31 lock (secModule)
32 {
33 if (secModule.SecurityPackages == null)
34 {
35 int pkgnum = 0;
36 SafeFreeContextBuffer pkgArray = null;
37 try
38 {
39 int num = secModule.EnumerateSecurityPackages(out pkgnum, out pkgArray);
40 if (System.Net.NetEventSource.Log.IsEnabled())
41 {
42 System.Net.NetEventSource.Info(null, $"arrayBase: {pkgArray}", "EnumerateSecurityPackages");
43 }
44 if (num != 0)
45 {
46 throw new Win32Exception(num);
47 }
49 for (int i = 0; i < pkgnum; i++)
50 {
51 array[i] = new SecurityPackageInfoClass(pkgArray, i);
52 if (System.Net.NetEventSource.Log.IsEnabled())
53 {
54 System.Net.NetEventSource.Log.EnumerateSecurityPackages(array[i].Name);
55 }
56 }
57 secModule.SecurityPackages = array;
58 }
59 finally
60 {
61 pkgArray?.Dispose();
62 }
63 }
64 }
65 }
66 return secModule.SecurityPackages;
67 }
68
69 internal static SecurityPackageInfoClass GetVerifyPackageInfo(ISSPIInterface secModule, string packageName, bool throwIfMissing)
70 {
72 if (array != null)
73 {
74 for (int i = 0; i < array.Length; i++)
75 {
76 if (string.Equals(array[i].Name, packageName, StringComparison.OrdinalIgnoreCase))
77 {
78 return array[i];
79 }
80 }
81 }
82 if (System.Net.NetEventSource.Log.IsEnabled())
83 {
84 System.Net.NetEventSource.Log.SspiPackageNotFound(packageName);
85 }
86 if (throwIfMissing)
87 {
89 }
90 return null;
91 }
92
93 public static SafeFreeCredentials AcquireDefaultCredential(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent)
94 {
95 if (System.Net.NetEventSource.Log.IsEnabled())
96 {
97 System.Net.NetEventSource.Log.AcquireDefaultCredential(package, intent);
98 }
99 SafeFreeCredentials outCredential = null;
100 int num = secModule.AcquireDefaultCredential(package, intent, out outCredential);
101 if (num != 0)
102 {
103 if (System.Net.NetEventSource.Log.IsEnabled())
104 {
105 System.Net.NetEventSource.Error(null, System.SR.Format(System.SR.net_log_operation_failed_with_error, "AcquireDefaultCredential", $"0x{num:X}"), "AcquireDefaultCredential");
106 }
107 throw new Win32Exception(num);
108 }
109 return outCredential;
110 }
111
112 public static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, ref SafeSspiAuthDataHandle authdata)
113 {
114 if (System.Net.NetEventSource.Log.IsEnabled())
115 {
116 System.Net.NetEventSource.Log.AcquireCredentialsHandle(package, intent, authdata);
117 }
118 SafeFreeCredentials outCredential = null;
119 int num = secModule.AcquireCredentialsHandle(package, intent, ref authdata, out outCredential);
120 if (num != 0)
121 {
122 if (System.Net.NetEventSource.Log.IsEnabled())
123 {
124 System.Net.NetEventSource.Error(null, System.SR.Format(System.SR.net_log_operation_failed_with_error, "AcquireCredentialsHandle", $"0x{num:X}"), "AcquireCredentialsHandle");
125 }
126 throw new Win32Exception(num);
127 }
128 return outCredential;
129 }
130
131 public unsafe static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCHANNEL_CRED* scc)
132 {
133 SafeFreeCredentials outCredential;
134 int num = secModule.AcquireCredentialsHandle(package, intent, scc, out outCredential);
135 if (num != 0)
136 {
137 if (System.Net.NetEventSource.Log.IsEnabled())
138 {
139 System.Net.NetEventSource.Error(null, System.SR.Format(System.SR.net_log_operation_failed_with_error, "AcquireCredentialsHandle", $"0x{num:X}"), "AcquireCredentialsHandle");
140 }
141 throw new Win32Exception(num);
142 }
143 return outCredential;
144 }
145
146 public unsafe static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCH_CREDENTIALS* scc)
147 {
148 SafeFreeCredentials outCredential;
149 int num = secModule.AcquireCredentialsHandle(package, intent, scc, out outCredential);
150 if (num != 0)
151 {
152 if (System.Net.NetEventSource.Log.IsEnabled())
153 {
154 System.Net.NetEventSource.Error(null, System.SR.Format(System.SR.net_log_operation_failed_with_error, "AcquireCredentialsHandle", $"0x{num:X}"), "AcquireCredentialsHandle");
155 }
156 throw new Win32Exception(num);
157 }
158 return outCredential;
159 }
160
161 internal static int InitializeSecurityContext(ISSPIInterface secModule, ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness datarep, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
162 {
163 if (System.Net.NetEventSource.Log.IsEnabled())
164 {
165 System.Net.NetEventSource.Log.InitializeSecurityContext(credential, context, targetName, inFlags);
166 }
167 int num = secModule.InitializeSecurityContext(ref credential, ref context, targetName, inFlags, datarep, inputBuffers, ref outputBuffer, ref outFlags);
168 if (System.Net.NetEventSource.Log.IsEnabled())
169 {
170 System.Net.NetEventSource.Log.SecurityContextInputBuffers("InitializeSecurityContext", inputBuffers.Count, outputBuffer.size, (global::Interop.SECURITY_STATUS)num);
171 }
172 return num;
173 }
174
175 internal static int AcceptSecurityContext(ISSPIInterface secModule, SafeFreeCredentials credential, ref SafeDeleteSslContext context, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness datarep, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
176 {
177 if (System.Net.NetEventSource.Log.IsEnabled())
178 {
179 System.Net.NetEventSource.Log.AcceptSecurityContext(credential, context, inFlags);
180 }
181 int num = secModule.AcceptSecurityContext(credential, ref context, inputBuffers, inFlags, datarep, ref outputBuffer, ref outFlags);
182 if (System.Net.NetEventSource.Log.IsEnabled())
183 {
184 System.Net.NetEventSource.Log.SecurityContextInputBuffers("AcceptSecurityContext", inputBuffers.Count, outputBuffer.size, (global::Interop.SECURITY_STATUS)num);
185 }
186 return num;
187 }
188
189 internal static int CompleteAuthToken(ISSPIInterface secModule, ref SafeDeleteSslContext context, in SecurityBuffer inputBuffer)
190 {
191 int num = secModule.CompleteAuthToken(ref context, in inputBuffer);
192 if (System.Net.NetEventSource.Log.IsEnabled())
193 {
194 System.Net.NetEventSource.Log.OperationReturnedSomething("CompleteAuthToken", (global::Interop.SECURITY_STATUS)num);
195 }
196 return num;
197 }
198
199 internal static int ApplyControlToken(ISSPIInterface secModule, ref SafeDeleteContext context, in SecurityBuffer inputBuffer)
200 {
201 int num = secModule.ApplyControlToken(ref context, in inputBuffer);
202 if (System.Net.NetEventSource.Log.IsEnabled())
203 {
204 System.Net.NetEventSource.Log.OperationReturnedSomething("ApplyControlToken", (global::Interop.SECURITY_STATUS)num);
205 }
206 return num;
207 }
208
210 {
211 return secModule.QuerySecurityContextToken(context, out token);
212 }
213
214 public static int EncryptMessage(ISSPIInterface secModule, SafeDeleteContext context, Span<SecurityBuffer> input, uint sequenceNumber)
215 {
216 return EncryptDecryptHelper(OP.Encrypt, secModule, context, input, sequenceNumber);
217 }
218
219 public static int DecryptMessage(ISSPIInterface secModule, SafeDeleteContext context, Span<SecurityBuffer> input, uint sequenceNumber)
220 {
221 return EncryptDecryptHelper(OP.Decrypt, secModule, context, input, sequenceNumber);
222 }
223
224 internal static int MakeSignature(ISSPIInterface secModule, SafeDeleteContext context, Span<SecurityBuffer> input, uint sequenceNumber)
225 {
226 return EncryptDecryptHelper(OP.MakeSignature, secModule, context, input, sequenceNumber);
227 }
228
229 public static int VerifySignature(ISSPIInterface secModule, SafeDeleteContext context, Span<SecurityBuffer> input, uint sequenceNumber)
230 {
231 return EncryptDecryptHelper(OP.VerifySignature, secModule, context, input, sequenceNumber);
232 }
233
234 private unsafe static int EncryptDecryptHelper(OP op, ISSPIInterface secModule, SafeDeleteContext context, Span<SecurityBuffer> input, uint sequenceNumber)
235 {
236 global::Interop.SspiCli.SecBufferDesc inputOutput = new global::Interop.SspiCli.SecBufferDesc(input.Length);
237 Span<global::Interop.SspiCli.SecBuffer> span = stackalloc global::Interop.SspiCli.SecBuffer[input.Length];
238 span.Clear();
239 fixed (global::Interop.SspiCli.SecBuffer* pBuffers = span)
240 {
241 fixed (byte* ptr4 = ((input.Length > 0) ? input[0].token : null))
242 {
243 fixed (byte* ptr3 = ((input.Length > 1) ? input[1].token : null))
244 {
245 fixed (byte* ptr2 = ((input.Length > 2) ? input[2].token : null))
246 {
247 inputOutput.pBuffers = pBuffers;
248 ThreeByteArrays threeByteArrays = default(ThreeByteArrays);
249 Span<byte[]> span2 = MemoryMarshal.CreateSpan(ref threeByteArrays._item0, 3).Slice(0, input.Length);
250 for (int i = 0; i < input.Length; i++)
251 {
252 ref SecurityBuffer reference = ref input[i];
253 span[i].cbBuffer = reference.size;
254 span[i].BufferType = reference.type;
255 if (reference.token == null || reference.token.Length == 0)
256 {
257 span[i].pvBuffer = IntPtr.Zero;
258 continue;
259 }
260 span[i].pvBuffer = Marshal.UnsafeAddrOfPinnedArrayElement(reference.token, reference.offset);
261 span2[i] = reference.token;
262 }
263 int num = op switch
264 {
265 OP.Encrypt => secModule.EncryptMessage(context, ref inputOutput, sequenceNumber),
266 OP.Decrypt => secModule.DecryptMessage(context, ref inputOutput, sequenceNumber),
267 OP.MakeSignature => secModule.MakeSignature(context, ref inputOutput, sequenceNumber),
268 _ => secModule.VerifySignature(context, ref inputOutput, sequenceNumber),
269 };
270 for (int j = 0; j < input.Length; j++)
271 {
272 ref SecurityBuffer reference2 = ref input[j];
273 reference2.size = span[j].cbBuffer;
274 reference2.type = span[j].BufferType;
275 if (reference2.size == 0)
276 {
277 reference2.offset = 0;
278 reference2.token = null;
279 continue;
280 }
281 int k;
282 for (k = 0; k < input.Length; k++)
283 {
284 if (span2[k] != null)
285 {
286 byte* ptr = (byte*)(void*)Marshal.UnsafeAddrOfPinnedArrayElement(span2[k], 0);
287 checked
288 {
289 if ((void*)span[j].pvBuffer >= ptr && unchecked((nuint)(void*)span[j].pvBuffer) + unchecked((nuint)reference2.size) <= unchecked((nuint)ptr) + unchecked((nuint)span2[k].Length))
290 {
291 reference2.offset = (int)(unchecked((byte*)(void*)span[j].pvBuffer) - ptr);
292 reference2.token = span2[k];
293 break;
294 }
295 }
296 }
297 }
298 if (k >= input.Length)
299 {
300 reference2.size = 0;
301 reference2.offset = 0;
302 reference2.token = null;
303 }
304 }
305 if (System.Net.NetEventSource.Log.IsEnabled() && num != 0)
306 {
307 System.Net.NetEventSource.Error(null, (num == 590625) ? System.SR.Format(System.SR.event_OperationReturnedSomething, op, "SEC_I_RENEGOTIATE") : System.SR.Format(System.SR.net_log_operation_failed_with_error, op, $"0x{0:X}"), "EncryptDecryptHelper");
308 }
309 return num;
310 }
311 }
312 }
313 }
314 }
315
316 public static SafeFreeContextBufferChannelBinding QueryContextChannelBinding(ISSPIInterface secModule, SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute)
317 {
319 int num = secModule.QueryContextChannelBinding(securityContext, contextAttribute, out refHandle);
320 if (num != 0)
321 {
322 if (System.Net.NetEventSource.Log.IsEnabled())
323 {
324 System.Net.NetEventSource.Error(null, $"ERROR = {ErrorDescription(num)}", "QueryContextChannelBinding");
325 }
326 return null;
327 }
328 return refHandle;
329 }
330
331 public static bool QueryBlittableContextAttributes<T>(ISSPIInterface secModule, SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute, ref T attribute) where T : unmanaged
332 {
333 Span<T> span = MemoryMarshal.CreateSpan(ref attribute, 1);
334 SafeHandle refHandle;
335 int num = secModule.QueryContextAttributes(securityContext, contextAttribute, MemoryMarshal.AsBytes(span), null, out refHandle);
336 using (refHandle)
337 {
338 if (num != 0)
339 {
340 if (System.Net.NetEventSource.Log.IsEnabled())
341 {
342 System.Net.NetEventSource.Error(null, $"ERROR = {ErrorDescription(num)}", "QueryBlittableContextAttributes");
343 }
344 return false;
345 }
346 return true;
347 }
348 }
349
350 public static bool QueryBlittableContextAttributes<T>(ISSPIInterface secModule, SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute, Type safeHandleType, out SafeHandle sspiHandle, ref T attribute) where T : unmanaged
351 {
352 Span<T> span = MemoryMarshal.CreateSpan(ref attribute, 1);
353 int num = secModule.QueryContextAttributes(securityContext, contextAttribute, MemoryMarshal.AsBytes(span), safeHandleType, out sspiHandle);
354 if (num != 0)
355 {
356 if (System.Net.NetEventSource.Log.IsEnabled())
357 {
358 System.Net.NetEventSource.Error(null, $"ERROR = {ErrorDescription(num)}", "QueryBlittableContextAttributes");
359 }
360 return false;
361 }
362 return true;
363 }
364
365 public static string QueryStringContextAttributes(ISSPIInterface secModule, SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute)
366 {
367 Span<IntPtr> span = stackalloc IntPtr[1];
368 SafeHandle refHandle;
369 int num = secModule.QueryContextAttributes(securityContext, contextAttribute, MemoryMarshal.AsBytes(span), typeof(SafeFreeContextBuffer), out refHandle);
370 using (refHandle)
371 {
372 if (num != 0)
373 {
374 if (System.Net.NetEventSource.Log.IsEnabled())
375 {
376 System.Net.NetEventSource.Error(null, $"ERROR = {ErrorDescription(num)}", "QueryStringContextAttributes");
377 }
378 return null;
379 }
380 string text = Marshal.PtrToStringUni(refHandle.DangerousGetHandle());
381 if (System.Net.NetEventSource.Log.IsEnabled())
382 {
383 System.Net.NetEventSource.Info(null, text, "QueryStringContextAttributes");
384 }
385 return text;
386 }
387 }
388
390 {
391 Span<IntPtr> span = stackalloc IntPtr[1];
392 SafeHandle refHandle;
393 int num = secModule.QueryContextAttributes(securityContext, global::Interop.SspiCli.ContextAttribute.SECPKG_ATTR_REMOTE_CERT_CONTEXT, MemoryMarshal.AsBytes(span), typeof(SafeFreeCertContext), out refHandle);
394 if (num != 0)
395 {
396 refHandle?.Dispose();
397 if (System.Net.NetEventSource.Log.IsEnabled())
398 {
399 System.Net.NetEventSource.Error(null, $"ERROR = {ErrorDescription(num)}", "QueryContextAttributes_SECPKG_ATTR_REMOTE_CERT_CONTEXT");
400 }
401 return null;
402 }
403 return (SafeFreeCertContext)refHandle;
404 }
405
406 public static bool QueryContextAttributes_SECPKG_ATTR_ISSUER_LIST_EX(ISSPIInterface secModule, SafeDeleteContext securityContext, ref global::Interop.SspiCli.SecPkgContext_IssuerListInfoEx ctx, out SafeHandle sspiHandle)
407 {
408 Span<global::Interop.SspiCli.SecPkgContext_IssuerListInfoEx> span = MemoryMarshal.CreateSpan(ref ctx, 1);
409 int num = secModule.QueryContextAttributes(securityContext, global::Interop.SspiCli.ContextAttribute.SECPKG_ATTR_ISSUER_LIST_EX, MemoryMarshal.AsBytes(span), typeof(SafeFreeContextBuffer), out sspiHandle);
410 if (num != 0)
411 {
412 if (System.Net.NetEventSource.Log.IsEnabled())
413 {
414 System.Net.NetEventSource.Error(null, $"ERROR = {ErrorDescription(num)}", "QueryContextAttributes_SECPKG_ATTR_ISSUER_LIST_EX");
415 }
416 return false;
417 }
418 return true;
419 }
420
421 public static string ErrorDescription(int errorCode)
422 {
423 if (errorCode == -1)
424 {
425 return "An exception when invoking Win32 API";
426 }
427 return (global::Interop.SECURITY_STATUS)errorCode switch
428 {
429 global::Interop.SECURITY_STATUS.InvalidHandle => "Invalid handle",
430 global::Interop.SECURITY_STATUS.InvalidToken => "Invalid token",
431 global::Interop.SECURITY_STATUS.ContinueNeeded => "Continue needed",
432 global::Interop.SECURITY_STATUS.IncompleteMessage => "Message incomplete",
433 global::Interop.SECURITY_STATUS.WrongPrincipal => "Wrong principal",
434 global::Interop.SECURITY_STATUS.TargetUnknown => "Target unknown",
435 global::Interop.SECURITY_STATUS.PackageNotFound => "Package not found",
436 global::Interop.SECURITY_STATUS.BufferNotEnough => "Buffer not enough",
437 global::Interop.SECURITY_STATUS.MessageAltered => "Message altered",
438 global::Interop.SECURITY_STATUS.UntrustedRoot => "Untrusted root",
439 _ => "0x" + errorCode.ToString("x", NumberFormatInfo.InvariantInfo),
440 };
441 }
442}
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static unsafe SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCHANNEL_CRED *scc)
static int DecryptMessage(ISSPIInterface secModule, SafeDeleteContext context, Span< SecurityBuffer > input, uint sequenceNumber)
static bool QueryContextAttributes_SECPKG_ATTR_ISSUER_LIST_EX(ISSPIInterface secModule, SafeDeleteContext securityContext, ref global::Interop.SspiCli.SecPkgContext_IssuerListInfoEx ctx, out SafeHandle sspiHandle)
static int MakeSignature(ISSPIInterface secModule, SafeDeleteContext context, Span< SecurityBuffer > input, uint sequenceNumber)
static SafeFreeCredentials AcquireDefaultCredential(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent)
static int VerifySignature(ISSPIInterface secModule, SafeDeleteContext context, Span< SecurityBuffer > input, uint sequenceNumber)
static SafeFreeCertContext QueryContextAttributes_SECPKG_ATTR_REMOTE_CERT_CONTEXT(ISSPIInterface secModule, SafeDeleteContext securityContext)
static int QuerySecurityContextToken(ISSPIInterface secModule, SafeDeleteContext context, out SecurityContextTokenHandle token)
static unsafe int EncryptDecryptHelper(OP op, ISSPIInterface secModule, SafeDeleteContext context, Span< SecurityBuffer > input, uint sequenceNumber)
static string QueryStringContextAttributes(ISSPIInterface secModule, SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute)
static int CompleteAuthToken(ISSPIInterface secModule, ref SafeDeleteSslContext context, in SecurityBuffer inputBuffer)
static string ErrorDescription(int errorCode)
static SecurityPackageInfoClass[] EnumerateSecurityPackages(ISSPIInterface secModule)
static int InitializeSecurityContext(ISSPIInterface secModule, ref SafeFreeCredentials credential, ref SafeDeleteSslContext context, string targetName, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness datarep, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
static unsafe SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, global::Interop.SspiCli.SCH_CREDENTIALS *scc)
static SafeFreeCredentials AcquireCredentialsHandle(ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, ref SafeSspiAuthDataHandle authdata)
static SecurityPackageInfoClass GetVerifyPackageInfo(ISSPIInterface secModule, string packageName, bool throwIfMissing)
static int EncryptMessage(ISSPIInterface secModule, SafeDeleteContext context, Span< SecurityBuffer > input, uint sequenceNumber)
static unsafe int EncryptDecryptHelper(OP op, System.Net.ISSPIInterface secModule, System.Net.Security.SafeDeleteContext context, Span< System.Net.Security.SecurityBuffer > input, uint sequenceNumber)
static bool QueryBlittableContextAttributes< T >(System.Net.ISSPIInterface secModule, System.Net.Security.SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute, Type safeHandleType, out SafeHandle sspiHandle, ref T attribute)
static System.Net.SecurityPackageInfoClass[] EnumerateSecurityPackages(System.Net.ISSPIInterface secModule)
Definition SSPIWrapper.cs:8
static int AcceptSecurityContext(ISSPIInterface secModule, SafeFreeCredentials credential, ref SafeDeleteSslContext context, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness datarep, InputSecurityBuffers inputBuffers, ref SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
static int ApplyControlToken(ISSPIInterface secModule, ref SafeDeleteContext context, in SecurityBuffer inputBuffer)
static SafeFreeContextBufferChannelBinding QueryContextChannelBinding(ISSPIInterface secModule, SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute)
static unsafe? string PtrToStringUni(IntPtr ptr)
Definition Marshal.cs:652
static unsafe IntPtr UnsafeAddrOfPinnedArrayElement(Array arr, int index)
Definition Marshal.cs:775
static string net_securitypackagesupport
Definition SR.cs:156
static string event_OperationReturnedSomething
Definition SR.cs:24
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
static string net_log_operation_failed_with_error
Definition SR.cs:154
Definition SR.cs:7
int AcquireDefaultCredential(string moduleName, global::Interop.SspiCli.CredentialUse usage, out System.Net.Security.SafeFreeCredentials outCredential)
int QuerySecurityContextToken(System.Net.Security.SafeDeleteContext phContext, out System.Net.Security.SecurityContextTokenHandle phToken)
System.Net.SecurityPackageInfoClass[] SecurityPackages
int DecryptMessage(System.Net.Security.SafeDeleteContext context, ref global::Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber)
int EnumerateSecurityPackages(out int pkgnum, out System.Net.Security.SafeFreeContextBuffer pkgArray)
int MakeSignature(System.Net.Security.SafeDeleteContext context, ref global::Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber)
int CompleteAuthToken(ref System.Net.Security.SafeDeleteSslContext refContext, in System.Net.Security.SecurityBuffer inputBuffer)
int AcceptSecurityContext(System.Net.Security.SafeFreeCredentials credential, ref System.Net.Security.SafeDeleteSslContext context, System.Net.Security.InputSecurityBuffers inputBuffers, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness endianness, ref System.Net.Security.SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
int AcquireCredentialsHandle(string moduleName, global::Interop.SspiCli.CredentialUse usage, ref System.Net.Security.SafeSspiAuthDataHandle authdata, out System.Net.Security.SafeFreeCredentials outCredential)
int ApplyControlToken(ref SafeDeleteContext refContext, in SecurityBuffer inputBuffer)
int QueryContextAttributes(System.Net.Security.SafeDeleteContext phContext, global::Interop.SspiCli.ContextAttribute attribute, Span< byte > buffer, Type handleType, out SafeHandle refHandle)
int EncryptMessage(System.Net.Security.SafeDeleteContext context, ref global::Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber)
int QueryContextChannelBinding(SafeDeleteContext phContext, global::Interop.SspiCli.ContextAttribute attribute, out SafeFreeContextBufferChannelBinding refHandle)
int VerifySignature(System.Net.Security.SafeDeleteContext context, ref global::Interop.SspiCli.SecBufferDesc inputOutput, uint sequenceNumber)
int InitializeSecurityContext(ref System.Net.Security.SafeFreeCredentials credential, ref System.Net.Security.SafeDeleteSslContext context, string targetName, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness endianness, System.Net.Security.InputSecurityBuffers inputBuffers, ref System.Net.Security.SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
static readonly IntPtr Zero
Definition IntPtr.cs:18
unsafe void Clear()
Definition Span.cs:198