Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches
SecureChannel.cs
Go to the documentation of this file.
9
10namespace System.Net.Security;
11
12internal sealed class SecureChannel
13{
15
17
19
21
23
25
26 private int _headerSize = 5;
27
28 private int _trailerSize = 16;
29
30 private int _maxDataSize = 16354;
31
33
35
37
38 private static readonly Oid s_serverAuthOid = new Oid("1.3.6.1.5.5.7.3.1", "1.3.6.1.5.5.7.3.1");
39
40 private static readonly Oid s_clientAuthOid = new Oid("1.3.6.1.5.5.7.3.2", "1.3.6.1.5.5.7.3.2");
41
42 private SslStream _ssl;
43
45
47
49
51 {
52 get
53 {
55 return _remoteCertificate;
56 }
57 }
58
60
61 internal int MaxDataSize => _maxDataSize;
62
64
65 internal bool IsValidContext
66 {
67 [MethodImpl(MethodImplOptions.AggressiveInlining)]
68 get
69 {
70 if (_securityContext != null)
71 {
73 }
74 return false;
75 }
76 }
77
79
81
83
96
98 {
99 ChannelBinding result = null;
100 if (_securityContext != null)
101 {
103 }
104 return result;
105 }
106
108 {
110 }
111
112 internal void Close()
113 {
115 {
117 _remoteCertificate = null;
118 }
121 _ssl = null;
122 GC.SuppressFinalize(this);
123 }
124
126 {
127 if (certificate == null)
128 {
129 return null;
130 }
131 if (System.Net.NetEventSource.Log.IsEnabled())
132 {
133 System.Net.NetEventSource.Log.LocatingPrivateKey(certificate, instance);
134 }
135 try
136 {
138 if (x509Certificate != null)
139 {
140 if (x509Certificate.HasPrivateKey)
141 {
142 if (System.Net.NetEventSource.Log.IsEnabled())
143 {
144 System.Net.NetEventSource.Log.CertIsType2(instance);
145 }
146 return x509Certificate;
147 }
149 {
150 x509Certificate.Dispose();
151 }
152 }
153 string thumbprint = x509Certificate.Thumbprint;
155 if (x509Store != null)
156 {
159 {
160 if (System.Net.NetEventSource.Log.IsEnabled())
161 {
162 System.Net.NetEventSource.Log.FoundCertInStore(isServer, instance);
163 }
165 }
166 }
168 if (x509Store != null)
169 {
172 {
173 if (System.Net.NetEventSource.Log.IsEnabled())
174 {
175 System.Net.NetEventSource.Log.FoundCertInStore(!isServer, instance);
176 }
178 }
179 }
180 }
182 {
183 }
184 if (System.Net.NetEventSource.Log.IsEnabled())
185 {
186 System.Net.NetEventSource.Log.NotFoundCertInStore(instance);
187 }
188 return null;
189 }
190
192 {
193 if (certificate.GetType() == typeof(X509Certificate2))
194 {
196 }
197 X509Certificate2 result = null;
198 try
199 {
200 if (certificate.Handle != IntPtr.Zero)
201 {
202 result = new X509Certificate2(certificate);
203 }
204 }
205 catch (SecurityException)
206 {
207 }
209 {
210 }
211 return result;
212 }
213
215 {
216 string[] result = Array.Empty<string>();
217 if (IsValidContext)
218 {
220 }
221 return result;
222 }
223
225 {
228 bool flag = false;
230 {
232 if (System.Net.NetEventSource.Log.IsEnabled())
233 {
234 System.Net.NetEventSource.Info(this, "Calling CertificateSelectionCallback", "AcquireClientCredentials");
235 }
237 try
238 {
241 {
242 _sslAuthenticationOptions.ClientCertificates = new X509CertificateCollection();
243 }
245 }
246 finally
247 {
248 x509Certificate2?.Dispose();
249 }
250 if (x509Certificate != null)
251 {
252 if (_credentialsHandle == null)
253 {
254 flag = true;
255 }
256 EnsureInitialized(ref list).Add(x509Certificate);
257 if (System.Net.NetEventSource.Log.IsEnabled())
258 {
259 System.Net.NetEventSource.Log.CertificateFromDelegate(this);
260 }
261 }
263 {
264 if (System.Net.NetEventSource.Log.IsEnabled())
265 {
266 System.Net.NetEventSource.Log.NoDelegateNoClientCert(this);
267 }
268 flag = true;
269 }
270 else if (System.Net.NetEventSource.Log.IsEnabled())
271 {
272 System.Net.NetEventSource.Log.NoDelegateButClientCert(this);
273 }
274 }
276 {
278 flag = true;
279 if (x509Certificate != null)
280 {
281 EnsureInitialized(ref list).Add(x509Certificate);
282 }
283 if (System.Net.NetEventSource.Log.IsEnabled())
284 {
285 System.Net.NetEventSource.Log.AttemptingRestartUsingCert(x509Certificate, this);
286 }
287 }
289 {
291 if (System.Net.NetEventSource.Log.IsEnabled())
292 {
294 {
295 System.Net.NetEventSource.Log.NoIssuersTryAllCerts(this);
296 }
297 else
298 {
299 System.Net.NetEventSource.Log.LookForMatchingCerts(requestCertificateAuthorities.Length, this);
300 }
301 }
302 for (int i = 0; i < _sslAuthenticationOptions.ClientCertificates.Count; i++)
303 {
305 {
307 X509Chain x509Chain = null;
308 try
309 {
311 if (x509Certificate3 == null)
312 {
313 continue;
314 }
315 if (System.Net.NetEventSource.Log.IsEnabled())
316 {
317 System.Net.NetEventSource.Info(this, $"Root cert: {x509Certificate3}", "AcquireClientCredentials");
318 }
319 x509Chain = new X509Chain();
320 x509Chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
321 x509Chain.ChainPolicy.VerificationFlags = X509VerificationFlags.IgnoreInvalidName;
323 bool flag2 = false;
324 if (x509Chain.ChainElements.Count > 0)
325 {
326 int count = x509Chain.ChainElements.Count;
327 for (int j = 0; j < count; j++)
328 {
329 string issuer = x509Chain.ChainElements[j].Certificate.Issuer;
331 if (flag2)
332 {
333 if (System.Net.NetEventSource.Log.IsEnabled())
334 {
335 System.Net.NetEventSource.Info(this, $"Matched {issuer}", "AcquireClientCredentials");
336 }
337 break;
338 }
339 if (System.Net.NetEventSource.Log.IsEnabled())
340 {
341 System.Net.NetEventSource.Info(this, $"No match: {issuer}", "AcquireClientCredentials");
342 }
343 }
344 }
345 if (!flag2)
346 {
347 continue;
348 }
349 goto IL_03c0;
350 }
351 finally
352 {
353 if (x509Chain != null)
354 {
355 x509Chain.Dispose();
356 int count2 = x509Chain.ChainElements.Count;
357 for (int k = 0; k < count2; k++)
358 {
359 x509Chain.ChainElements[k].Certificate.Dispose();
360 }
361 }
363 {
364 x509Certificate3.Dispose();
365 }
366 }
367 }
368 goto IL_03c0;
369 IL_03c0:
370 if (System.Net.NetEventSource.Log.IsEnabled())
371 {
373 }
374 EnsureInitialized(ref list).Add(_sslAuthenticationOptions.ClientCertificates[i]);
375 }
376 }
377 bool result = false;
379 x509Certificate = null;
380 if (System.Net.NetEventSource.Log.IsEnabled())
381 {
382 if (list != null && list.Count != 0)
383 {
384 System.Net.NetEventSource.Log.CertsAfterFiltering(list.Count, this);
385 System.Net.NetEventSource.Log.FindingMatchingCerts(this);
386 }
387 else
388 {
389 System.Net.NetEventSource.Log.CertsAfterFiltering(0, this);
390 System.Net.NetEventSource.Info(this, "No client certificate to choose from", "AcquireClientCredentials");
391 }
392 }
393 if (list != null)
394 {
395 for (int l = 0; l < list.Count; l++)
396 {
399 {
400 break;
401 }
402 x509Certificate = null;
403 x509Certificate4 = null;
404 }
405 }
406 if (System.Net.NetEventSource.Log.IsEnabled())
407 {
408 System.Net.NetEventSource.Info(this, $"Selected cert = {x509Certificate4}", "AcquireClientCredentials");
409 }
410 try
411 {
412 byte[] array = x509Certificate4?.GetCertHash();
414 if (flag && safeFreeCredentials == null && x509Certificate4 != null)
415 {
416 if (System.Net.NetEventSource.Log.IsEnabled())
417 {
418 System.Net.NetEventSource.Info(this, "Reset to anonymous session.", "AcquireClientCredentials");
419 }
421 {
422 x509Certificate4.Dispose();
423 }
424 array = null;
425 x509Certificate4 = null;
426 x509Certificate = null;
427 }
428 if (safeFreeCredentials != null)
429 {
430 if (System.Net.NetEventSource.Log.IsEnabled())
431 {
432 System.Net.NetEventSource.Log.UsingCachedCredential(this);
433 }
436 result = true;
437 if (x509Certificate4 != null)
438 {
439 _sslAuthenticationOptions.CertificateContext = SslStreamCertificateContext.Create(x509Certificate4);
440 }
441 }
442 else
443 {
444 if (x509Certificate4 != null)
445 {
446 _sslAuthenticationOptions.CertificateContext = SslStreamCertificateContext.Create(x509Certificate4);
447 }
451 }
452 }
453 finally
454 {
456 {
457 _sslAuthenticationOptions.CertificateContext = SslStreamCertificateContext.Create(x509Certificate4);
458 }
459 }
460 return result;
461 }
462
464 {
465 return list ?? (list = new List<T>());
466 }
467
469 {
472 bool result = false;
474 {
476 if (x509Certificate == null)
477 {
478 if (System.Net.NetEventSource.Log.IsEnabled())
479 {
480 System.Net.NetEventSource.Error(this, $"ServerCertSelectionDelegate returned no certificaete for '{_sslAuthenticationOptions.TargetHost}'.", "AcquireServerCredentials");
481 }
483 }
484 if (System.Net.NetEventSource.Log.IsEnabled())
485 {
486 System.Net.NetEventSource.Info(this, "ServerCertSelectionDelegate selected Cert", "AcquireServerCredentials");
487 }
488 }
490 {
494 if (x509Certificate == null)
495 {
496 if (System.Net.NetEventSource.Log.IsEnabled())
497 {
498 System.Net.NetEventSource.Error(this, $"CertSelectionDelegate returned no certificaete for '{_sslAuthenticationOptions.TargetHost}'.", "AcquireServerCredentials");
499 }
501 }
502 if (System.Net.NetEventSource.Log.IsEnabled())
503 {
504 System.Net.NetEventSource.Info(this, "CertSelectionDelegate selected Cert", "AcquireServerCredentials");
505 }
506 }
508 {
510 }
511 if (x509Certificate2 == null)
512 {
513 if (x509Certificate == null)
514 {
515 if (System.Net.NetEventSource.Log.IsEnabled())
516 {
517 System.Net.NetEventSource.Error(this, "Certiticate callback returned no certificaete.", "AcquireServerCredentials");
518 }
520 }
522 if (x509Certificate2 == null)
523 {
525 }
526 _sslAuthenticationOptions.CertificateContext = SslStreamCertificateContext.Create(x509Certificate2);
527 }
528 byte[] certHash = x509Certificate2.GetCertHash();
530 if (safeFreeCredentials != null)
531 {
533 result = true;
534 }
535 else
536 {
539 }
540 return result;
541 }
542
544 {
545 byte[] output = null;
548 {
549 if (System.Net.NetEventSource.Log.IsEnabled())
550 {
551 System.Net.NetEventSource.Info(this, "NextMessage() returned SecurityStatusPal.CredentialsNeeded", "NextMessage");
552 }
555 }
557 if (System.Net.NetEventSource.Log.IsEnabled() && protocolToken.Failed)
558 {
559 System.Net.NetEventSource.Error(this, $"Authentication failed. Status: {securityStatusPal}, Exception message: {protocolToken.GetException().Message}", "NextMessage");
560 }
561 return protocolToken;
562 }
563
565 {
566 byte[] outputBuffer = Array.Empty<byte>();
567 SecurityStatusPal result = default(SecurityStatusPal);
568 bool flag = false;
569 byte[] thumbPrint = null;
570 try
571 {
572 do
573 {
574 thumbPrint = null;
576 {
577 flag = (_sslAuthenticationOptions.IsServer ? AcquireServerCredentials(ref thumbPrint) : AcquireClientCredentials(ref thumbPrint));
578 }
580 }
581 while (flag && _credentialsHandle == null);
582 }
583 finally
584 {
586 {
590 {
592 }
593 }
594 }
595 output = outputBuffer;
596 return result;
597 }
598
603
617
619 {
620 if (System.Net.NetEventSource.Log.IsEnabled())
621 {
622 System.Net.NetEventSource.DumpBuffer(this, buffer.Span, "Encrypt");
623 }
624 byte[] output2 = output;
627 {
628 if (System.Net.NetEventSource.Log.IsEnabled())
629 {
630 System.Net.NetEventSource.Error(this, $"ERROR {securityStatusPal}", "Encrypt");
631 }
632 }
633 else
634 {
635 output = output2;
636 }
637 return securityStatusPal;
638 }
639
649
651 {
654 bool flag = false;
655 X509Chain x509Chain = null;
657 try
658 {
660 if (_remoteCertificate != null && remoteCertificate != null && remoteCertificate.RawData.AsSpan().SequenceEqual(_remoteCertificate.RawData))
661 {
662 return true;
663 }
665 if (_remoteCertificate == null)
666 {
668 {
669 System.Net.NetEventSource.Error(this, $"Remote certificate required, but no remote certificate received", "VerifyRemoteCertificate");
670 }
671 sslPolicyErrors |= SslPolicyErrors.RemoteCertificateNotAvailable;
672 }
673 else
674 {
675 x509Chain = new X509Chain();
676 x509Chain.ChainPolicy.RevocationMode = _sslAuthenticationOptions.CertificateRevocationCheckMode;
677 x509Chain.ChainPolicy.RevocationFlag = X509RevocationFlag.ExcludeRoot;
679 if (remoteCertificateCollection != null)
680 {
681 x509Chain.ChainPolicy.ExtraStore.AddRange(remoteCertificateCollection);
682 }
683 if (trust != null)
684 {
685 x509Chain.ChainPolicy.TrustMode = X509ChainTrustMode.CustomRootTrust;
686 if (trust._store != null)
687 {
688 x509Chain.ChainPolicy.CustomTrustStore.AddRange(trust._store.Certificates);
689 }
690 if (trust._trustList != null)
691 {
692 x509Chain.ChainPolicy.CustomTrustStore.AddRange(trust._trustList);
693 }
694 }
696 }
698 {
699 object ssl = _ssl;
700 if (ssl == null)
701 {
702 throw new ObjectDisposedException("SslStream");
703 }
705 }
706 else
707 {
709 {
710 sslPolicyErrors &= ~SslPolicyErrors.RemoteCertificateNotAvailable;
711 }
712 flag = sslPolicyErrors == SslPolicyErrors.None;
713 }
714 if (System.Net.NetEventSource.Log.IsEnabled())
715 {
717 System.Net.NetEventSource.Info(this, $"Cert validation, remote cert = {_remoteCertificate}", "VerifyRemoteCertificate");
718 }
719 if (!flag)
720 {
722 if (x509Chain != null)
723 {
724 X509ChainStatus[] chainStatus2 = x509Chain.ChainStatus;
726 {
728 }
729 }
730 }
731 }
732 finally
733 {
734 if (x509Chain != null)
735 {
736 int count = x509Chain.ChainElements.Count;
737 for (int j = 0; j < count; j++)
738 {
739 x509Chain.ChainElements[j].Certificate.Dispose();
740 }
741 x509Chain.Dispose();
742 }
743 if (remoteCertificateCollection != null)
744 {
746 for (int k = 0; k < count2; k++)
747 {
749 }
750 }
751 }
752 return flag;
753 }
754
756 {
758 {
759 SslPolicyErrors.RemoteCertificateChainErrors => GetAlertMessageFromChain(chain),
760 SslPolicyErrors.RemoteCertificateNameMismatch => TlsAlertMessage.BadCertificate,
761 _ => TlsAlertMessage.CertificateUnknown,
762 };
763 if (System.Net.NetEventSource.Log.IsEnabled())
764 {
765 System.Net.NetEventSource.Info(this, $"alertMessage:{tlsAlertMessage}", "CreateFatalHandshakeAlertToken");
766 }
769 {
770 if (System.Net.NetEventSource.Log.IsEnabled())
771 {
772 System.Net.NetEventSource.Info(this, $"ApplyAlertToken() returned {securityStatusPal.ErrorCode}", "CreateFatalHandshakeAlertToken");
773 }
774 if (securityStatusPal.Exception != null)
775 {
777 }
778 return null;
779 }
780 return GenerateAlertToken();
781 }
782
784 {
787 {
788 if (System.Net.NetEventSource.Log.IsEnabled())
789 {
790 System.Net.NetEventSource.Info(this, $"ApplyAlertToken() returned {securityStatusPal.ErrorCode}", "CreateShutdownToken");
791 }
792 if (securityStatusPal.Exception != null)
793 {
795 }
796 return null;
797 }
798 return GenerateAlertToken();
799 }
800
802 {
803 byte[] output = null;
805 return new ProtocolToken(output, status);
806 }
807
809 {
810 X509ChainStatus[] chainStatus = chain.ChainStatus;
811 for (int i = 0; i < chainStatus.Length; i++)
812 {
814 if (x509ChainStatus.Status != 0)
815 {
816 if ((x509ChainStatus.Status & (X509ChainStatusFlags.UntrustedRoot | X509ChainStatusFlags.Cyclic | X509ChainStatusFlags.PartialChain)) != 0)
817 {
818 return TlsAlertMessage.UnknownCA;
819 }
820 if ((x509ChainStatus.Status & (X509ChainStatusFlags.Revoked | X509ChainStatusFlags.OfflineRevocation)) != 0)
821 {
822 return TlsAlertMessage.CertificateRevoked;
823 }
824 if ((x509ChainStatus.Status & (X509ChainStatusFlags.NotTimeValid | X509ChainStatusFlags.NotTimeNested | X509ChainStatusFlags.CtlNotTimeValid)) != 0)
825 {
826 return TlsAlertMessage.CertificateExpired;
827 }
828 if ((x509ChainStatus.Status & X509ChainStatusFlags.CtlNotValidForUsage) != 0)
829 {
830 return TlsAlertMessage.UnsupportedCert;
831 }
832 if (((x509ChainStatus.Status & (X509ChainStatusFlags.NotSignatureValid | X509ChainStatusFlags.InvalidExtension | X509ChainStatusFlags.InvalidPolicyConstraints | X509ChainStatusFlags.CtlNotSignatureValid)) | X509ChainStatusFlags.NoIssuanceChainPolicy | X509ChainStatusFlags.NotValidForUsage) != 0)
833 {
834 return TlsAlertMessage.BadCertificate;
835 }
836 return TlsAlertMessage.CertificateUnknown;
837 }
838 }
839 return TlsAlertMessage.BadCertificate;
840 }
841
843 {
844 if (!System.Net.NetEventSource.Log.IsEnabled())
845 {
846 return;
847 }
848 if (sslPolicyErrors != 0)
849 {
851 if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNotAvailable) != 0)
852 {
854 }
855 if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateNameMismatch) != 0)
856 {
858 }
859 if ((sslPolicyErrors & SslPolicyErrors.RemoteCertificateChainErrors) != 0)
860 {
861 string text = "ChainStatus: ";
862 X509ChainStatus[] chainStatus = chain.ChainStatus;
864 {
865 text = text + "\t" + x509ChainStatus.StatusInformation;
866 }
867 System.Net.NetEventSource.Log.RemoteCertificateError(this, text);
868 }
869 }
870 if (success)
871 {
873 {
874 System.Net.NetEventSource.Log.RemoteCertDeclaredValid(this);
875 }
876 else
877 {
878 System.Net.NetEventSource.Log.RemoteCertHasNoErrors(this);
879 }
880 }
881 else if (remoteCertValidationCallback != null)
882 {
883 System.Net.NetEventSource.Log.RemoteCertUserDeclaredInvalid(this);
884 }
885 }
886}
int IList. IndexOf(object value)
Definition Array.cs:1228
void AddRange(IEnumerable< KeyValuePair< TKey, TValue > > collection)
void Add(TKey key, TValue value)
static void SuppressFinalize(object obj)
Definition GC.cs:202
Definition GC.cs:8
static unsafe string[] GetRequestCertificateAuthorities(SafeDeleteContext securityContext)
static X509Certificate2 GetRemoteCertificate(SafeDeleteContext securityContext)
static SslPolicyErrors VerifyCertificateProperties(SafeDeleteContext securityContext, X509Chain chain, X509Certificate2 remoteCertificate, bool checkCertName, bool isServer, string hostName)
static X509Store EnsureStoreOpened(bool isMachineStore)
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 void DumpBuffer(object thisOrContextObject, byte[] buffer, int offset, int count, [CallerMemberName] string memberName=null)
bool AcquireServerCredentials(ref byte[] thumbPrint)
static TlsAlertMessage GetAlertMessageFromChain(X509Chain chain)
void LogCertificateValidation(RemoteCertificateValidationCallback remoteCertValidationCallback, SslPolicyErrors sslPolicyErrors, bool success, X509Chain chain)
static readonly Oid s_clientAuthOid
SafeDeleteSslContext _securityContext
ChannelBinding GetChannelBinding(ChannelBindingKind kind)
SecurityStatusPal Decrypt(Span< byte > buffer, out int outputOffset, out int outputCount)
X509Certificate _selectedClientCertificate
SecurityStatusPal Encrypt(ReadOnlyMemory< byte > buffer, ref byte[] output, out int resultSize)
X509RevocationMode CheckCertRevocationStatus
SecurityStatusPal Renegotiate(out byte[] output)
static X509Certificate2 FindCertificateWithPrivateKey(object instance, bool isServer, X509Certificate certificate)
SafeFreeCredentials _credentialsHandle
static X509Certificate2 MakeEx(X509Certificate certificate)
bool AcquireClientCredentials(ref byte[] thumbPrint)
SslApplicationProtocol NegotiatedApplicationProtocol
SslApplicationProtocol _negotiatedApplicationProtocol
bool VerifyRemoteCertificate(RemoteCertificateValidationCallback remoteCertValidationCallback, SslCertificateTrust trust, ref ProtocolToken alertToken, out SslPolicyErrors sslPolicyErrors, out X509ChainStatusFlags chainStatus)
ProtocolToken NextMessage(ReadOnlySpan< byte > incomingBuffer)
SecureChannel(SslAuthenticationOptions sslAuthenticationOptions, SslStream sslStream)
static List< T > EnsureInitialized< T >(ref List< T > list)
ProtocolToken CreateFatalHandshakeAlertToken(SslPolicyErrors sslPolicyErrors, X509Chain chain)
SecurityStatusPal GenerateToken(ReadOnlySpan< byte > inputBuffer, ref byte[] output)
readonly SslAuthenticationOptions _sslAuthenticationOptions
static readonly Oid s_serverAuthOid
static SafeFreeCredentials TryCachedCredential(byte[] thumbPrint, SslProtocols sslProtocols, bool isServer, EncryptionPolicy encryptionPolicy)
static void CacheCredential(SafeFreeCredentials creds, byte[] thumbPrint, SslProtocols sslProtocols, bool isServer, EncryptionPolicy encryptionPolicy)
static SslStreamCertificateContext Create(X509Certificate2 target, X509Certificate2Collection? additionalCertificates, bool offline)
static void QueryContextConnectionInfo(SafeDeleteContext securityContext, out SslConnectionInfo connectionInfo)
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 unsafe SecurityStatusPal DecryptMessage(SafeDeleteSslContext securityContext, Span< byte > buffer, out int offset, out int count)
static SecurityStatusPal Renegotiate(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteSslContext context, SslAuthenticationOptions sslAuthenticationOptions, out byte[] outputBuffer)
static void QueryContextStreamSizes(SafeDeleteContext securityContext, out StreamSizes streamSizes)
static unsafe SecurityStatusPal EncryptMessage(SafeDeleteSslContext securityContext, ReadOnlyMemory< byte > input, int headerSize, int trailerSize, ref byte[] output, out int resultSize)
static SafeFreeContextBufferChannelBinding QueryContextChannelBinding(SafeDeleteContext securityContext, ChannelBindingKind attribute)
static byte[] GetNegotiatedApplicationProtocol(SafeDeleteContext context)
static string net_ssl_io_no_server_cert
Definition SR.cs:52
static string net_log_remote_cert_name_mismatch
Definition SR.cs:98
static string net_log_remote_cert_not_available
Definition SR.cs:96
static string net_log_remote_cert_has_errors
Definition SR.cs:94
Definition SR.cs:7
static readonly IntPtr Zero
Definition IntPtr.cs:18
readonly System.Net.SecurityStatusPalErrorCode ErrorCode