135 {
138 try
139 {
141 {
144 {
145 System.
Net.
NetEventSource.
Info(
this, $
"SSPIWrapper.InitializeSecurityContext() returns statusCode:0x{(int)statusCode.ErrorCode:x8} ({statusCode})",
"GetOutgoingBlob");
146 }
147 if (statusCode.ErrorCode ==
System.
Net.SecurityStatusPalErrorCode.CompleteNeeded)
148 {
151 {
152 System.
Net.
NetEventSource.
Info(
this, $
"SSPIWrapper.CompleteAuthToken() returns statusCode:0x{(int)statusCode.ErrorCode:x8} ({statusCode})",
"GetOutgoingBlob");
153 }
154 resultBlob = null;
155 }
156 }
157 else
158 {
161 {
162 System.
Net.
NetEventSource.
Info(
this, $
"SSPIWrapper.AcceptSecurityContext() returns statusCode:0x{(int)statusCode.ErrorCode:x8} ({statusCode})",
"GetOutgoingBlob");
163 }
164 }
165 }
166 finally
167 {
168 if (flag)
169 {
171 }
172 }
173 if (statusCode.ErrorCode >=
System.
Net.SecurityStatusPalErrorCode.OutOfMemory)
174 {
177 if (throwOnError)
178 {
180 }
181 return null;
182 }
184 {
186 }
187 if (statusCode.ErrorCode ==
System.
Net.SecurityStatusPalErrorCode.OK || (
_isServer && statusCode.ErrorCode ==
System.
Net.SecurityStatusPalErrorCode.CompleteNeeded))
188 {
190 }
192 {
193 System.
Net.
NetEventSource.
Info(
this, $
"need continue statusCode:0x{(int)statusCode.ErrorCode:x8} ({statusCode}) _securityContext:{_securityContext}",
"GetOutgoingBlob");
194 }
195 return resultBlob;
196 }
System.Net.ContextFlagsPal _contextFlags
ChannelBinding _channelBinding
System.Net.Security.SafeFreeCredentials _credentialsHandle
System.Net.ContextFlagsPal _requestedContextFlags
System.Net.Security.SafeDeleteContext _securityContext
static readonly System.Net.NetEventSource Log
static void Info(object thisOrContextObject, FormattableString formattableString=null, [CallerMemberName] string memberName=null)
static System.Net.SecurityStatusPal AcceptSecurityContext(System.Net.Security.SafeFreeCredentials credentialsHandle, ref System.Net.Security.SafeDeleteContext securityContext, System.Net.ContextFlagsPal requestedContextFlags, byte[] incomingBlob, ChannelBinding channelBinding, ref byte[] resultBlob, ref System.Net.ContextFlagsPal contextFlags)
static System.Net.SecurityStatusPal InitializeSecurityContext(ref System.Net.Security.SafeFreeCredentials credentialsHandle, ref System.Net.Security.SafeDeleteContext securityContext, string spn, System.Net.ContextFlagsPal requestedContextFlags, byte[] incomingBlob, ChannelBinding channelBinding, ref byte[] resultBlob, ref System.Net.ContextFlagsPal contextFlags)
static System.Net.SecurityStatusPal CompleteAuthToken(ref System.Net.Security.SafeDeleteContext securityContext, byte[] incomingBlob)
static Win32Exception CreateExceptionFromError(System.Net.SecurityStatusPal statusCode)
static void CacheCredential(System.Net.Security.SafeFreeCredentials newHandle)