10internal static class NegotiateStreamPal
15 string name = (context.IsServer ? context.AssociatedName : context.
Spn);
29 if (sECURITY_STATUS != 0)
63 bool flag =
SSPIWrapper.QueryBlittableContextAttributes(
GlobalSSPI.
SSPIAuth, securityContext, global::Interop.SspiCli.ContextAttribute.SECPKG_ATTR_SIZES, ref attribute);
69 int num2 = buffer.Length + attribute.cbSecurityTrailer + attribute.
cbBlockSize;
70 if (output ==
null || output.Length < num2 + 4)
72 output =
new byte[num2 + 4];
102 num2 =
input[0].size;
109 num2 +=
input[1].size;
114 num2 +=
input[2].size;
115 output[0] = (byte)((uint)num2 & 0xFFu);
116 output[1] = (byte)((uint)(num2 >> 8) & 0xFFu);
117 output[2] = (byte)((uint)(num2 >> 16) & 0xFFu);
118 output[3] = (byte)((uint)(num2 >> 24) & 0xFFu);
124 if (offset < 0 || offset > ((
buffer !=
null) ?
buffer.Length : 0))
154 newOffset =
input[1].offset;
155 return input[1].size;
177 input[1].type = securityBufferType;
193 newOffset =
input[1].offset;
194 return input[1].size;
212 global::Interop.SECURITY_STATUS sECURITY_STATUS = global::Interop.SspiCli.SspiEncodeStringsAsAuthIdentity(credential.
UserName, credential.
Domain, credential.
Password, out authData);
213 if (sECURITY_STATUS != 0)
248 if (incomingBlob !=
null)
252 if (channelBinding !=
null)
257 global::Interop.SspiCli.ContextFlags outFlags = global::Interop.SspiCli.ContextFlags.Zero;
260 securityContext = context;
261 resultBlob = outputBuffer.
token;
271 securityContext = context;
278 if (incomingBlob !=
null)
282 if (channelBinding !=
null)
287 global::Interop.SspiCli.ContextFlags outFlags = global::Interop.SspiCli.ContextFlags.Zero;
290 resultBlob = outputBuffer.
token;
291 securityContext = context;
static void BlockCopy(Array src, int srcOffset, Array dst, int dstOffset, int count)
static System.Net.ContextFlagsPal GetContextFlagsPalFromInterop(global::Interop.SspiCli.ContextFlags win32Flags)
static global::Interop.SspiCli.ContextFlags GetInteropFromContextFlagsPal(System.Net.ContextFlagsPal flags)
static readonly System.Net.SSPIAuthType SSPIAuth
System.Net.Security.SafeDeleteContext GetContext(out System.Net.SecurityStatusPal status)
static unsafe string GetAuthenticationPackageName(SafeHandle safeHandle, int negotiationState)
static readonly System.Net.NetEventSource Log
static void Error(object thisOrContextObject, FormattableString formattableString, [CallerMemberName] string memberName=null)
static int QuerySecurityContextToken(System.Net.ISSPIInterface secModule, System.Net.Security.SafeDeleteContext context, out System.Net.Security.SecurityContextTokenHandle token)
static System.Net.Security.SafeFreeCredentials AcquireDefaultCredential(System.Net.ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent)
static int DecryptMessage(ISSPIInterface secModule, SafeDeleteContext context, Span< SecurityBuffer > input, uint sequenceNumber)
static int MakeSignature(System.Net.ISSPIInterface secModule, System.Net.Security.SafeDeleteContext context, Span< System.Net.Security.SecurityBuffer > input, uint sequenceNumber)
static int VerifySignature(System.Net.ISSPIInterface secModule, System.Net.Security.SafeDeleteContext context, Span< System.Net.Security.SecurityBuffer > input, uint sequenceNumber)
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 EncryptMessage(ISSPIInterface secModule, SafeDeleteContext context, Span< SecurityBuffer > input, uint sequenceNumber)
static int CompleteAuthToken(System.Net.ISSPIInterface secModule, ref System.Net.Security.SafeDeleteSslContext context, in System.Net.Security.SecurityBuffer inputBuffer)
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 string QueryStringContextAttributes(System.Net.ISSPIInterface secModule, System.Net.Security.SafeDeleteContext securityContext, global::Interop.SspiCli.ContextAttribute contextAttribute)
static System.Net.Security.SafeFreeCredentials AcquireCredentialsHandle(System.Net.ISSPIInterface secModule, string package, global::Interop.SspiCli.CredentialUse intent, ref System.Net.Security.SafeSspiAuthDataHandle authdata)
static global::Interop.SECURITY_STATUS GetInteropFromSecurityStatusPal(System.Net.SecurityStatusPal status)
static System.Net.SecurityStatusPal GetSecurityStatusPalFromInterop(global::Interop.SECURITY_STATUS win32SecurityStatus, bool attachException=false)
static Win32Exception CreateExceptionFromError(SecurityStatusPal statusCode)
static string QueryContextAssociatedName(SafeDeleteContext securityContext)
static string QueryContextClientSpecifiedSpn(SafeDeleteContext securityContext)
static int DecryptNtlm(SafeDeleteContext securityContext, byte[] buffer, int offset, int count, bool isConfidential, out int newOffset, uint sequenceNumber)
static int Decrypt(SafeDeleteContext securityContext, byte[] buffer, int offset, int count, bool isConfidential, bool isNtlm, out int newOffset, uint sequenceNumber)
static void ValidateImpersonationLevel(TokenImpersonationLevel impersonationLevel)
static IIdentity GetIdentity(NTAuthentication context)
static int Encrypt(SafeDeleteContext securityContext, ReadOnlySpan< byte > buffer, bool isConfidential, bool isNtlm, [NotNull] ref byte[] output, uint sequenceNumber)
static int QueryMaxTokenSize(string package)
static SecurityStatusPal AcceptSecurityContext(SafeFreeCredentials credentialsHandle, ref SafeDeleteContext securityContext, ContextFlagsPal requestedContextFlags, byte[] incomingBlob, ChannelBinding channelBinding, ref byte[] resultBlob, ref ContextFlagsPal contextFlags)
static SecurityStatusPal InitializeSecurityContext(ref SafeFreeCredentials credentialsHandle, ref SafeDeleteContext securityContext, string spn, ContextFlagsPal requestedContextFlags, byte[] incomingBlob, ChannelBinding channelBinding, ref byte[] resultBlob, ref ContextFlagsPal contextFlags)
static SecurityStatusPal CompleteAuthToken(ref SafeDeleteContext securityContext, byte[] incomingBlob)
static SafeFreeCredentials AcquireCredentialsHandle(string package, bool isServer, NetworkCredential credential)
static SafeFreeCredentials AcquireDefaultCredential(string package, bool isServer)
static string QueryContextAuthenticationPackage(SafeDeleteContext securityContext)
static string Format(string resourceFormat, object p1)
static string net_log_operation_failed_with_error
static string net_auth_supported_impl_levels
static string net_io_out_range
SecurityStatusPalErrorCode
readonly int cbSecurityTrailer
readonly System.Net.SecurityStatusPalErrorCode ErrorCode
System.Net.Security.SecurityBuffer _item0