Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SslStreamPal.cs
Go to the documentation of this file.
9
10namespace System.Net.Security;
11
12internal static class SslStreamPal
13{
14 private static readonly bool UseNewCryptoApi = Environment.OSVersion.Version.Major >= 10 && Environment.OSVersion.Version.Build >= 18836;
15
16 private static readonly byte[] s_schannelShutdownBytes = BitConverter.GetBytes(1);
17
23
24 public static void VerifyPackageInfo()
25 {
26 SSPIWrapper.GetVerifyPackageInfo(GlobalSSPI.SSPISecureChannel, "Microsoft Unified Security Protocol Provider", throwIfMissing: true);
27 }
28
30 {
31 return global::Interop.Sec_Application_Protocols.ToByteArray(protocols);
32 }
33
35 {
36 global::Interop.SspiCli.ContextFlags outFlags = global::Interop.SspiCli.ContextFlags.Zero;
38 inputBuffers.SetNextBuffer(new InputSecurityBuffer(inputBuffer, SecurityBufferType.SECBUFFER_TOKEN));
39 inputBuffers.SetNextBuffer(new InputSecurityBuffer(default(ReadOnlySpan<byte>), SecurityBufferType.SECBUFFER_EMPTY));
40 if (sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0)
41 {
43 inputBuffers.SetNextBuffer(new InputSecurityBuffer(new ReadOnlySpan<byte>(array), SecurityBufferType.SECBUFFER_APPLICATION_PROTOCOLS));
44 }
45 SecurityBuffer outputBuffer2 = new SecurityBuffer(outputBuffer, SecurityBufferType.SECBUFFER_TOKEN);
46 int win32SecurityStatus = SSPIWrapper.AcceptSecurityContext(GlobalSSPI.SSPISecureChannel, credentialsHandle, ref context, global::Interop.SspiCli.ContextFlags.ReplayDetect | global::Interop.SspiCli.ContextFlags.SequenceDetect | global::Interop.SspiCli.ContextFlags.Confidentiality | global::Interop.SspiCli.ContextFlags.AllocateMemory | global::Interop.SspiCli.ContextFlags.AcceptExtendedError | global::Interop.SspiCli.ContextFlags.AcceptStream | (sslAuthenticationOptions.RemoteCertRequired ? global::Interop.SspiCli.ContextFlags.MutualAuth : global::Interop.SspiCli.ContextFlags.Zero), global::Interop.SspiCli.Endianness.SECURITY_NATIVE_DREP, inputBuffers, ref outputBuffer2, ref outFlags);
47 outputBuffer = outputBuffer2.token;
49 }
50
52 {
53 global::Interop.SspiCli.ContextFlags outFlags = global::Interop.SspiCli.ContextFlags.Zero;
55 inputBuffers.SetNextBuffer(new InputSecurityBuffer(inputBuffer, SecurityBufferType.SECBUFFER_TOKEN));
56 inputBuffers.SetNextBuffer(new InputSecurityBuffer(default(ReadOnlySpan<byte>), SecurityBufferType.SECBUFFER_EMPTY));
57 if (sslAuthenticationOptions.ApplicationProtocols != null && sslAuthenticationOptions.ApplicationProtocols.Count != 0)
58 {
60 inputBuffers.SetNextBuffer(new InputSecurityBuffer(new ReadOnlySpan<byte>(array), SecurityBufferType.SECBUFFER_APPLICATION_PROTOCOLS));
61 }
62 SecurityBuffer outputBuffer2 = new SecurityBuffer(outputBuffer, SecurityBufferType.SECBUFFER_TOKEN);
63 int win32SecurityStatus = SSPIWrapper.InitializeSecurityContext(GlobalSSPI.SSPISecureChannel, ref credentialsHandle, ref context, targetName, global::Interop.SspiCli.ContextFlags.ReplayDetect | global::Interop.SspiCli.ContextFlags.SequenceDetect | global::Interop.SspiCli.ContextFlags.Confidentiality | global::Interop.SspiCli.ContextFlags.AllocateMemory | global::Interop.SspiCli.ContextFlags.InitManualCredValidation, global::Interop.SspiCli.Endianness.SECURITY_NATIVE_DREP, inputBuffers, ref outputBuffer2, ref outFlags);
64 outputBuffer = outputBuffer2.token;
66 }
67
75
85
87 {
88 global::Interop.SspiCli.SecPkgCred_ClientCertPolicy pBuffer = default(global::Interop.SspiCli.SecPkgCred_ClientCertPolicy);
89 fixed (char* pwszSslCtlStoreName = store.Name)
90 {
91 pBuffer.pwszSslCtlStoreName = pwszSslCtlStoreName;
92 global::Interop.SECURITY_STATUS sECURITY_STATUS = global::Interop.SspiCli.SetCredentialsAttributesW(ref cred._handle, 96L, ref pBuffer, sizeof(global::Interop.SspiCli.SecPkgCred_ClientCertPolicy));
93 if (sECURITY_STATUS != 0)
94 {
95 throw new Win32Exception((int)sECURITY_STATUS);
96 }
97 }
98 }
99
101 {
103 global::Interop.SspiCli.CredentialUse credUsage;
104 global::Interop.SspiCli.SCHANNEL_CRED.Flags flags;
105 if (!isServer)
106 {
107 credUsage = global::Interop.SspiCli.CredentialUse.SECPKG_CRED_OUTBOUND;
108 flags = global::Interop.SspiCli.SCHANNEL_CRED.Flags.SCH_CRED_MANUAL_CRED_VALIDATION | global::Interop.SspiCli.SCHANNEL_CRED.Flags.SCH_CRED_NO_DEFAULT_CREDS | global::Interop.SspiCli.SCHANNEL_CRED.Flags.SCH_SEND_AUX_RECORD;
109 if ((protocolFlagsFromSslProtocols == 0 || ((uint)protocolFlagsFromSslProtocols & 0xFFFFFFC3u) != 0) && policy != EncryptionPolicy.AllowNoEncryption && policy != EncryptionPolicy.NoEncryption)
110 {
111 flags |= global::Interop.SspiCli.SCHANNEL_CRED.Flags.SCH_USE_STRONG_CRYPTO;
112 }
113 }
114 else
115 {
116 credUsage = global::Interop.SspiCli.CredentialUse.SECPKG_CRED_INBOUND;
117 flags = global::Interop.SspiCli.SCHANNEL_CRED.Flags.SCH_SEND_AUX_RECORD;
118 }
119 if (System.Net.NetEventSource.Log.IsEnabled())
120 {
121 System.Net.NetEventSource.Info($"flags=({flags}), ProtocolFlags=({protocolFlagsFromSslProtocols}), EncryptionPolicy={policy}", null, "AcquireCredentialsHandleSchannelCred");
122 }
123 global::Interop.SspiCli.SCHANNEL_CRED sCHANNEL_CRED = CreateSecureCredential(flags, protocolFlagsFromSslProtocols, policy);
124 global::Interop.Crypt32.CERT_CONTEXT* ptr = null;
125 if (certificate != null)
126 {
127 sCHANNEL_CRED.cCreds = 1;
128 ptr = (global::Interop.Crypt32.CERT_CONTEXT*)(void*)certificate.Handle;
129 sCHANNEL_CRED.paCred = &ptr;
130 }
132 }
133
135 {
137 global::Interop.SspiCli.CredentialUse credUsage;
138 global::Interop.SspiCli.SCH_CREDENTIALS.Flags flags;
139 if (isServer)
140 {
141 credUsage = global::Interop.SspiCli.CredentialUse.SECPKG_CRED_INBOUND;
142 flags = global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_SEND_AUX_RECORD;
143 }
144 else
145 {
146 credUsage = global::Interop.SspiCli.CredentialUse.SECPKG_CRED_OUTBOUND;
147 flags = global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_CRED_MANUAL_CRED_VALIDATION | global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_CRED_NO_DEFAULT_CREDS | global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_SEND_AUX_RECORD;
148 }
149 switch (policy)
150 {
151 case EncryptionPolicy.RequireEncryption:
153 {
154 flags |= global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_USE_STRONG_CRYPTO;
155 }
156 break;
157 case EncryptionPolicy.AllowNoEncryption:
158 flags |= global::Interop.SspiCli.SCH_CREDENTIALS.Flags.SCH_ALLOW_NULL_ENCRYPTION;
159 break;
160 default:
161 throw new ArgumentException(System.SR.Format(System.SR.net_invalid_enum, "EncryptionPolicy"), "policy");
162 }
163 global::Interop.SspiCli.SCH_CREDENTIALS sCH_CREDENTIALS = default(global::Interop.SspiCli.SCH_CREDENTIALS);
164 sCH_CREDENTIALS.dwVersion = 5;
165 sCH_CREDENTIALS.dwFlags = flags;
166 global::Interop.Crypt32.CERT_CONTEXT* ptr = null;
167 if (certificate != null)
168 {
169 sCH_CREDENTIALS.cCreds = 1;
170 ptr = (global::Interop.Crypt32.CERT_CONTEXT*)(void*)certificate.Handle;
171 sCH_CREDENTIALS.paCred = &ptr;
172 }
173 if (System.Net.NetEventSource.Log.IsEnabled())
174 {
175 System.Net.NetEventSource.Info($"flags=({flags}), ProtocolFlags=({protocolFlagsFromSslProtocols}), EncryptionPolicy={policy}", null, "AcquireCredentialsHandleSchCredentials");
176 }
178 {
179 global::Interop.SspiCli.TLS_PARAMETERS tLS_PARAMETERS = default(global::Interop.SspiCli.TLS_PARAMETERS);
180 tLS_PARAMETERS.grbitDisabledProtocols = (uint)protocolFlagsFromSslProtocols ^ 0xFFFFFFFFu;
181 sCH_CREDENTIALS.cTlsParameters = 1;
182 sCH_CREDENTIALS.pTlsParameters = &tLS_PARAMETERS;
183 }
185 }
186
188 {
189 global::Interop.SecPkgContext_ApplicationProtocol attribute = default(global::Interop.SecPkgContext_ApplicationProtocol);
190 if (SSPIWrapper.QueryBlittableContextAttributes(GlobalSSPI.SSPISecureChannel, context, global::Interop.SspiCli.ContextAttribute.SECPKG_ATTR_APPLICATION_PROTOCOL, ref attribute) && attribute.ProtoNegoExt == global::Interop.ApplicationProtocolNegotiationExt.ALPN && attribute.ProtoNegoStatus == global::Interop.ApplicationProtocolNegotiationStatus.Success)
191 {
192 return attribute.Protocol;
193 }
194 return null;
195 }
196
198 {
199 checked
200 {
201 int num = input.Length + headerSize + trailerSize;
202 if (output == null || output.Length < num)
203 {
204 output = new byte[num];
205 }
206 input.Span.CopyTo(new Span<byte>(output, headerSize, input.Length));
207 global::Interop.SspiCli.SecBuffer* ptr = stackalloc global::Interop.SspiCli.SecBuffer[4];
208 global::Interop.SspiCli.SecBufferDesc secBufferDesc = new global::Interop.SspiCli.SecBufferDesc(4);
209 secBufferDesc.pBuffers = ptr;
210 global::Interop.SspiCli.SecBufferDesc inputOutput = secBufferDesc;
211 fixed (byte* ptr3 = output)
212 {
213 global::Interop.SspiCli.SecBuffer* ptr2 = ptr;
214 ptr2->BufferType = SecurityBufferType.SECBUFFER_STREAM_HEADER;
215 ptr2->pvBuffer = (IntPtr)ptr3;
216 ptr2->cbBuffer = headerSize;
217 global::Interop.SspiCli.SecBuffer* ptr4 = ptr + 1;
218 ptr4->BufferType = SecurityBufferType.SECBUFFER_DATA;
219 ptr4->pvBuffer = (IntPtr)(ptr3 + headerSize);
220 ptr4->cbBuffer = input.Length;
221 global::Interop.SspiCli.SecBuffer* ptr5 = ptr + 2;
222 ptr5->BufferType = SecurityBufferType.SECBUFFER_STREAM_TRAILER;
223 ptr5->pvBuffer = (IntPtr)(ptr3 + headerSize + input.Length);
224 ptr5->cbBuffer = trailerSize;
225 global::Interop.SspiCli.SecBuffer* ptr6 = ptr + 3;
226 ptr6->BufferType = SecurityBufferType.SECBUFFER_EMPTY;
227 ptr6->cbBuffer = 0;
228 ptr6->pvBuffer = IntPtr.Zero;
230 if (num2 != 0)
231 {
232 if (System.Net.NetEventSource.Log.IsEnabled())
233 {
234 System.Net.NetEventSource.Info(securityContext, $"Encrypt ERROR {num2:X}", "EncryptMessage");
235 }
236 resultSize = 0;
238 }
239 resultSize = ptr2->cbBuffer + ptr4->cbBuffer + ptr5->cbBuffer;
241 }
242 }
243 }
244
246 {
247 fixed (byte* ptr3 = buffer)
248 {
249 global::Interop.SspiCli.SecBuffer* ptr = stackalloc global::Interop.SspiCli.SecBuffer[4];
250 global::Interop.SspiCli.SecBuffer* ptr2 = ptr;
251 ptr2->BufferType = SecurityBufferType.SECBUFFER_DATA;
252 ptr2->pvBuffer = (IntPtr)ptr3;
253 ptr2->cbBuffer = buffer.Length;
254 for (int i = 1; i < 4; i++)
255 {
256 global::Interop.SspiCli.SecBuffer* ptr4 = ptr + i;
257 ptr4->BufferType = SecurityBufferType.SECBUFFER_EMPTY;
258 ptr4->pvBuffer = IntPtr.Zero;
259 ptr4->cbBuffer = 0;
260 }
261 global::Interop.SspiCli.SecBufferDesc secBufferDesc = new global::Interop.SspiCli.SecBufferDesc(4);
262 secBufferDesc.pBuffers = ptr;
263 global::Interop.SspiCli.SecBufferDesc inputOutput = secBufferDesc;
264 global::Interop.SECURITY_STATUS sECURITY_STATUS = (global::Interop.SECURITY_STATUS)GlobalSSPI.SSPISecureChannel.DecryptMessage(securityContext, ref inputOutput, 0u);
265 count = 0;
266 offset = 0;
267 for (int j = 0; j < 4; j++)
268 {
269 if ((sECURITY_STATUS == global::Interop.SECURITY_STATUS.OK && ptr[j].BufferType == SecurityBufferType.SECBUFFER_DATA) || (sECURITY_STATUS != 0 && ptr[j].BufferType == SecurityBufferType.SECBUFFER_EXTRA))
270 {
271 offset = (int)((byte*)(void*)ptr[j].pvBuffer - ptr3);
272 count = ptr[j].cbBuffer;
273 break;
274 }
275 }
277 }
278 }
279
281 {
282 global::Interop.SChannel.SCHANNEL_ALERT_TOKEN sCHANNEL_ALERT_TOKEN = default(global::Interop.SChannel.SCHANNEL_ALERT_TOKEN);
283 sCHANNEL_ALERT_TOKEN.dwTokenType = 2u;
284 sCHANNEL_ALERT_TOKEN.dwAlertType = (uint)alertType;
285 sCHANNEL_ALERT_TOKEN.dwAlertNumber = (uint)alertMessage;
286 global::Interop.SChannel.SCHANNEL_ALERT_TOKEN reference = sCHANNEL_ALERT_TOKEN;
287 byte[] data = MemoryMarshal.AsBytes(MemoryMarshal.CreateReadOnlySpan(ref reference, 1)).ToArray();
288 SecurityBuffer inputBuffer = new SecurityBuffer(data, SecurityBufferType.SECBUFFER_TOKEN);
289 global::Interop.SECURITY_STATUS win32SecurityStatus = (global::Interop.SECURITY_STATUS)SSPIWrapper.ApplyControlToken(GlobalSSPI.SSPISecureChannel, ref securityContext, in inputBuffer);
291 }
292
299
304
306 {
308 bool flag = SSPIWrapper.QueryBlittableContextAttributes(GlobalSSPI.SSPISecureChannel, securityContext, global::Interop.SspiCli.ContextAttribute.SECPKG_ATTR_STREAM_SIZES, ref attribute);
310 }
311
313 {
315 bool flag = SSPIWrapper.QueryBlittableContextAttributes(GlobalSSPI.SSPISecureChannel, securityContext, global::Interop.SspiCli.ContextAttribute.SECPKG_ATTR_CONNECTION_INFO, ref attribute);
316 TlsCipherSuite cipherSuite = TlsCipherSuite.TLS_NULL_WITH_NULL_NULL;
318 if (SSPIWrapper.QueryBlittableContextAttributes(GlobalSSPI.SSPISecureChannel, securityContext, global::Interop.SspiCli.ContextAttribute.SECPKG_ATTR_CIPHER_INFO, ref attribute2))
319 {
320 cipherSuite = (TlsCipherSuite)attribute2.dwCipherSuite;
321 }
323 }
324
326 {
327 int num = (int)protocols;
328 if (isServer)
329 {
330 return num & 0x1554;
331 }
332 return num & 0x2AA8;
333 }
334
335 private unsafe static global::Interop.SspiCli.SCHANNEL_CRED CreateSecureCredential(global::Interop.SspiCli.SCHANNEL_CRED.Flags flags, int protocols, EncryptionPolicy policy)
336 {
337 global::Interop.SspiCli.SCHANNEL_CRED sCHANNEL_CRED = default(global::Interop.SspiCli.SCHANNEL_CRED);
338 sCHANNEL_CRED.hRootStore = IntPtr.Zero;
339 sCHANNEL_CRED.aphMappers = IntPtr.Zero;
340 sCHANNEL_CRED.palgSupportedAlgs = IntPtr.Zero;
341 sCHANNEL_CRED.paCred = null;
342 sCHANNEL_CRED.cCreds = 0;
343 sCHANNEL_CRED.cMappers = 0;
344 sCHANNEL_CRED.cSupportedAlgs = 0;
345 sCHANNEL_CRED.dwSessionLifespan = 0;
346 sCHANNEL_CRED.reserved = 0;
347 sCHANNEL_CRED.dwVersion = 4;
348 global::Interop.SspiCli.SCHANNEL_CRED result = sCHANNEL_CRED;
349 switch (policy)
350 {
351 case EncryptionPolicy.RequireEncryption:
352 result.dwMinimumCipherStrength = 0;
353 result.dwMaximumCipherStrength = 0;
354 break;
355 case EncryptionPolicy.AllowNoEncryption:
356 result.dwMinimumCipherStrength = -1;
357 result.dwMaximumCipherStrength = 0;
358 break;
359 case EncryptionPolicy.NoEncryption:
360 result.dwMinimumCipherStrength = -1;
361 result.dwMaximumCipherStrength = -1;
362 break;
363 default:
364 throw new ArgumentException(System.SR.Format(System.SR.net_invalid_enum, "EncryptionPolicy"), "policy");
365 }
366 result.dwFlags = flags;
367 result.grbitEnabledProtocols = protocols;
368 return result;
369 }
370
371 private unsafe static SafeFreeCredentials AcquireCredentialsHandle(global::Interop.SspiCli.CredentialUse credUsage, global::Interop.SspiCli.SCHANNEL_CRED* secureCredential)
372 {
373 try
374 {
376 }
377 catch
378 {
379 return SSPIWrapper.AcquireCredentialsHandle(GlobalSSPI.SSPISecureChannel, "Microsoft Unified Security Protocol Provider", credUsage, secureCredential);
380 }
381 }
382
383 private unsafe static SafeFreeCredentials AcquireCredentialsHandle(global::Interop.SspiCli.CredentialUse credUsage, global::Interop.SspiCli.SCH_CREDENTIALS* secureCredential)
384 {
385 try
386 {
388 }
389 catch
390 {
391 return SSPIWrapper.AcquireCredentialsHandle(GlobalSSPI.SSPISecureChannel, "Microsoft Unified Security Protocol Provider", credUsage, secureCredential);
392 }
393 }
394}
static byte[] GetBytes(bool value)
void CopyTo(KeyValuePair< TKey, TValue >[] array, int index)
static readonly System.Net.SSPISecureChannelType SSPISecureChannel
Definition GlobalSSPI.cs:7
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static System.Net.SecurityPackageInfoClass GetVerifyPackageInfo(System.Net.ISSPIInterface secModule, string packageName, bool throwIfMissing)
static int InitializeSecurityContext(System.Net.ISSPIInterface secModule, ref System.Net.Security.SafeFreeCredentials credential, ref System.Net.Security.SafeDeleteSslContext context, string targetName, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness datarep, System.Net.Security.InputSecurityBuffers inputBuffers, ref System.Net.Security.SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
static int AcceptSecurityContext(System.Net.ISSPIInterface secModule, System.Net.Security.SafeFreeCredentials credential, ref System.Net.Security.SafeDeleteSslContext context, global::Interop.SspiCli.ContextFlags inFlags, global::Interop.SspiCli.Endianness datarep, System.Net.Security.InputSecurityBuffers inputBuffers, ref System.Net.Security.SecurityBuffer outputBuffer, ref global::Interop.SspiCli.ContextFlags outFlags)
static System.Net.Security.SafeFreeCredentials AcquireCredentialsHandle(System.Net.ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, ref System.Net.Security.SafeSspiAuthDataHandle authdata)
static int ApplyControlToken(ISSPIInterface secModule, ref SafeDeleteContext context, in SecurityBuffer inputBuffer)
static SafeFreeContextBufferChannelBinding QueryContextChannelBinding(ISSPIInterface secModule, SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute)
static SecurityStatusPal GetSecurityStatusPalFromNativeInt(int win32SecurityStatus)
static global::Interop.SECURITY_STATUS GetInteropFromSecurityStatusPal(System.Net.SecurityStatusPal status)
static System.Net.SecurityStatusPal GetSecurityStatusPalFromInterop(global::Interop.SECURITY_STATUS win32SecurityStatus, bool attachException=false)
static void QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo)
static byte[] ConvertAlpnProtocolListToByteArray(List< SslApplicationProtocol > protocols)
static SafeFreeCredentials AcquireCredentialsHandle(SslStreamCertificateContext certificateContext, SslProtocols protocols, EncryptionPolicy policy, bool isServer)
static SecurityStatusPal ApplyAlertToken(ref SafeFreeCredentials credentialsHandle, SafeDeleteContext securityContext, TlsAlertType alertType, TlsAlertMessage alertMessage)
static SecurityStatusPal ApplyShutdownToken(ref SafeFreeCredentials credentialsHandle, SafeDeleteContext securityContext)
static SecurityStatusPal InitializeSecurityContext(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteSslContext context, string targetName, ReadOnlySpan< byte > inputBuffer, ref byte[] outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
static SecurityStatusPal AcceptSecurityContext(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteSslContext context, ReadOnlySpan< byte > inputBuffer, ref byte[] outputBuffer, SslAuthenticationOptions sslAuthenticationOptions)
static Exception GetException(SecurityStatusPal status)
static unsafe SecurityStatusPal DecryptMessage(SafeDeleteSslContext securityContext, Span< byte > buffer, out int offset, out int count)
static unsafe SafeFreeCredentials AcquireCredentialsHandleSchCredentials(X509Certificate2 certificate, SslProtocols protocols, EncryptionPolicy policy, bool isServer)
static unsafe SafeFreeCredentials AcquireCredentialsHandleSchannelCred(X509Certificate2 certificate, SslProtocols protocols, EncryptionPolicy policy, bool isServer)
static int GetProtocolFlagsFromSslProtocols(SslProtocols protocols, bool isServer)
static SecurityStatusPal Renegotiate(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteSslContext context, SslAuthenticationOptions sslAuthenticationOptions, out byte[] outputBuffer)
static void QueryContextStreamSizes(SafeDeleteContext securityContext, out StreamSizes streamSizes)
static unsafe SafeFreeCredentials AcquireCredentialsHandle(global::Interop.SspiCli.CredentialUse credUsage, global::Interop.SspiCli.SCHANNEL_CRED *secureCredential)
static unsafe SecurityStatusPal EncryptMessage(SafeDeleteSslContext securityContext, ReadOnlyMemory< byte > input, int headerSize, int trailerSize, ref byte[] output, out int resultSize)
static unsafe global::Interop.SspiCli.SCHANNEL_CRED CreateSecureCredential(global::Interop.SspiCli.SCHANNEL_CRED.Flags flags, int protocols, EncryptionPolicy policy)
static SafeFreeContextBufferChannelBinding QueryContextChannelBinding(SafeDeleteContext securityContext, ChannelBindingKind attribute)
static byte[] GetNegotiatedApplicationProtocol(SafeDeleteContext context)
static readonly bool UseNewCryptoApi
static unsafe void AttachCertificateStore(SafeFreeCredentials cred, X509Store store)
static readonly byte[] s_schannelShutdownBytes
static unsafe SafeFreeCredentials AcquireCredentialsHandle(global::Interop.SspiCli.CredentialUse credUsage, global::Interop.SspiCli.SCH_CREDENTIALS *secureCredential)
static string net_invalid_enum
Definition SR.cs:40
static string Format(string resourceFormat, object p1)
Definition SR.cs:118
Definition SR.cs:7
static void RunImpersonated(SafeAccessTokenHandle safeAccessTokenHandle, Action action)
static readonly IntPtr Zero
Definition IntPtr.cs:18