Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetOutgoingBlob() [5/7]

byte[] System.Net.NTAuthentication.GetOutgoingBlob ( byte[] incomingBlob,
bool throwOnError,
out System::Net::SecurityStatusPal statusCode )
inlinepackage

Definition at line 134 of file NTAuthentication.cs.

135 {
136 byte[] resultBlob = new byte[_tokenSize];
137 bool flag = _securityContext == null;
138 try
139 {
140 if (!_isServer)
141 {
143 if (System.Net.NetEventSource.Log.IsEnabled())
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 {
150 if (System.Net.NetEventSource.Log.IsEnabled())
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 {
160 if (System.Net.NetEventSource.Log.IsEnabled())
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 {
170 _credentialsHandle?.Dispose();
171 }
172 }
173 if (statusCode.ErrorCode >= System.Net.SecurityStatusPalErrorCode.OutOfMemory)
174 {
175 CloseContext();
176 _isCompleted = true;
177 if (throwOnError)
178 {
180 }
181 return null;
182 }
183 if (flag && _credentialsHandle != null)
184 {
186 }
187 if (statusCode.ErrorCode == System.Net.SecurityStatusPalErrorCode.OK || (_isServer && statusCode.ErrorCode == System.Net.SecurityStatusPalErrorCode.CompleteNeeded))
188 {
189 _isCompleted = true;
190 }
191 else if (System.Net.NetEventSource.Log.IsEnabled())
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
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)

References System.Net.NTAuthentication._channelBinding, System.Net.NTAuthentication._contextFlags, System.Net.NTAuthentication._credentialsHandle, System.Net.NTAuthentication._isCompleted, System.Net.NTAuthentication._isServer, System.Net.NTAuthentication._requestedContextFlags, System.Net.NTAuthentication._securityContext, System.Net.NTAuthentication._spn, System.Net.NTAuthentication._tokenSize, System.Net.Security.NegotiateStreamPal.AcceptSecurityContext(), System.Net.Security.SSPIHandleCache.CacheCredential(), System.Net.NTAuthentication.CloseContext(), System.Net.Security.NegotiateStreamPal.CompleteAuthToken(), System.Net.Security.NegotiateStreamPal.CreateExceptionFromError(), System.Net.NetEventSource.Info(), System.Net.Security.NegotiateStreamPal.InitializeSecurityContext(), and System.Net.NetEventSource.Log.