322 references to NetSecurityNative
System.Net.Security (322)
Generated\Basic.CompilerLog.Util\Basic.CompilerLog.Util.Impl.BasicGeneratedFilesAnalyzerReference\LibraryImports.g.cs (156)
47
internal static partial global::Interop.
NetSecurityNative
.Status DisplayMinorStatus(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Interop.
NetSecurityNative
.Status statusValue, ref global::Interop.
NetSecurityNative
.GssBuffer buffer)
52
global::Interop.
NetSecurityNative
.Status __retVal;
54
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __buffer_native = &buffer)
55
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
62
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, global::Interop.
NetSecurityNative
.Status __statusValue_native, global::Interop.
NetSecurityNative
.GssBuffer* __buffer_native);
72
internal static partial global::Interop.
NetSecurityNative
.Status DisplayMajorStatus(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Interop.
NetSecurityNative
.Status statusValue, ref global::Interop.
NetSecurityNative
.GssBuffer buffer)
77
global::Interop.
NetSecurityNative
.Status __retVal;
79
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __buffer_native = &buffer)
80
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
87
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, global::Interop.
NetSecurityNative
.Status __statusValue_native, global::Interop.
NetSecurityNative
.GssBuffer* __buffer_native);
97
internal static partial global::Interop.
NetSecurityNative
.Status ImportUserName(out global::Interop.
NetSecurityNative
.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName)
106
global::Interop.
NetSecurityNative
.Status __retVal = default;
115
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
140
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native);
150
internal static partial global::Interop.
NetSecurityNative
.Status ImportPrincipalName(out global::Interop.
NetSecurityNative
.Status minorStatus, string inputName, int inputNameByteCount, out global::Microsoft.Win32.SafeHandles.SafeGssNameHandle outputName)
159
global::Interop.
NetSecurityNative
.Status __retVal = default;
168
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
193
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, byte* __inputName_native, int __inputNameByteCount_native, nint* __outputName_native);
203
internal static partial global::Interop.
NetSecurityNative
.Status ReleaseName(out global::Interop.
NetSecurityNative
.Status minorStatus, ref nint inputName)
208
global::Interop.
NetSecurityNative
.Status __retVal;
211
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
218
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint* __inputName_native);
228
internal static partial global::Interop.
NetSecurityNative
.Status AcquireAcceptorCred(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Interop.
NetSecurityNative
.PackageType packageType, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle)
236
global::Interop.
NetSecurityNative
.Status __retVal = default;
242
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
263
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, global::Interop.
NetSecurityNative
.PackageType __packageType_native, nint* __outputCredHandle_native);
273
internal static partial global::Interop.
NetSecurityNative
.Status InitiateCredSpNego(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle desiredName, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle)
282
global::Interop.
NetSecurityNative
.Status __retVal = default;
291
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
316
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __desiredName_native, nint* __outputCredHandle_native);
326
internal static partial global::Interop.
NetSecurityNative
.Status InitiateCredWithPassword(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Interop.
NetSecurityNative
.PackageType packageType, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle desiredName, string password, int passwordLen, out global::Microsoft.Win32.SafeHandles.SafeGssCredHandle outputCredHandle)
336
global::Interop.
NetSecurityNative
.Status __retVal = default;
347
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
374
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, global::Interop.
NetSecurityNative
.PackageType __packageType_native, nint __desiredName_native, byte* __password_native, int __passwordLen_native, nint* __outputCredHandle_native);
384
internal static partial global::Interop.
NetSecurityNative
.Status ReleaseCred(out global::Interop.
NetSecurityNative
.Status minorStatus, ref nint credHandle)
389
global::Interop.
NetSecurityNative
.Status __retVal;
392
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
399
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint* __credHandle_native);
409
private static partial global::Interop.
NetSecurityNative
.Status InitSecContext(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssCredHandle initiatorCredHandle, ref global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, global::Interop.
NetSecurityNative
.PackageType packageType, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle targetName, uint reqFlags, ref byte inputBytes, int inputLength, ref global::Interop.
NetSecurityNative
.GssBuffer token, out uint retFlags, out bool isNtlmUsed)
421
global::Interop.
NetSecurityNative
.Status __retVal = default;
434
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __token_native = &token)
436
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
467
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __initiatorCredHandle_native, nint* __contextHandle_native, global::Interop.
NetSecurityNative
.PackageType __packageType_native, nint __targetName_native, uint __reqFlags_native, byte* __inputBytes_native, int __inputLength_native, global::Interop.
NetSecurityNative
.GssBuffer* __token_native, uint* __retFlags_native, int* __isNtlmUsed_native);
477
private static partial global::Interop.
NetSecurityNative
.Status InitSecContext(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssCredHandle initiatorCredHandle, ref global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, global::Interop.
NetSecurityNative
.PackageType packageType, nint cbt, int cbtSize, global::Microsoft.Win32.SafeHandles.SafeGssNameHandle targetName, uint reqFlags, ref byte inputBytes, int inputLength, ref global::Interop.
NetSecurityNative
.GssBuffer token, out uint retFlags, out bool isNtlmUsed)
489
global::Interop.
NetSecurityNative
.Status __retVal = default;
502
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __token_native = &token)
504
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
535
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __initiatorCredHandle_native, nint* __contextHandle_native, global::Interop.
NetSecurityNative
.PackageType __packageType_native, nint __cbt_native, int __cbtSize_native, nint __targetName_native, uint __reqFlags_native, byte* __inputBytes_native, int __inputLength_native, global::Interop.
NetSecurityNative
.GssBuffer* __token_native, uint* __retFlags_native, int* __isNtlmUsed_native);
545
private static partial global::Interop.
NetSecurityNative
.Status AcceptSecContext(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssCredHandle acceptorCredHandle, ref global::Microsoft.Win32.SafeHandles.SafeGssContextHandle acceptContextHandle, nint cbt, int cbtSize, ref byte inputBytes, int inputLength, ref global::Interop.
NetSecurityNative
.GssBuffer token, out uint retFlags, out bool isNtlmUsed)
556
global::Interop.
NetSecurityNative
.Status __retVal = default;
567
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __token_native = &token)
569
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
598
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __acceptorCredHandle_native, nint* __acceptContextHandle_native, nint __cbt_native, int __cbtSize_native, byte* __inputBytes_native, int __inputLength_native, global::Interop.
NetSecurityNative
.GssBuffer* __token_native, uint* __retFlags_native, int* __isNtlmUsed_native);
608
internal static partial global::Interop.
NetSecurityNative
.Status DeleteSecContext(out global::Interop.
NetSecurityNative
.Status minorStatus, ref nint contextHandle)
613
global::Interop.
NetSecurityNative
.Status __retVal;
616
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
623
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint* __contextHandle_native);
633
internal static partial global::Interop.
NetSecurityNative
.Status GetUser(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle acceptContextHandle, ref global::Interop.
NetSecurityNative
.GssBuffer token)
639
global::Interop.
NetSecurityNative
.Status __retVal = default;
647
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __token_native = &token)
648
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
663
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __acceptContextHandle_native, global::Interop.
NetSecurityNative
.GssBuffer* __token_native);
673
internal static unsafe partial global::Interop.
NetSecurityNative
.Status GetNameAttribute(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle acceptContextHandle, byte* attributeName, uint attributeNameLen, out bool isAvailable, out bool isAuthenticated, ref global::Interop.
NetSecurityNative
.GssBuffer token)
683
global::Interop.
NetSecurityNative
.Status __retVal = default;
691
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __token_native = &token)
692
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
710
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __acceptContextHandle_native, byte* __attributeName_native, uint __attributeNameLen_native, int* __isAvailable_native, int* __isAuthenticated_native, global::Interop.
NetSecurityNative
.GssBuffer* __token_native);
720
private static unsafe partial global::Interop.
NetSecurityNative
.Status Wrap(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, ref bool isEncrypt, byte* inputBytes, int count, ref global::Interop.
NetSecurityNative
.GssBuffer outBuffer)
727
global::Interop.
NetSecurityNative
.Status __retVal = default;
736
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __outBuffer_native = &outBuffer)
737
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
754
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __contextHandle_native, int* __isEncrypt_native, byte* __inputBytes_native, int __count_native, global::Interop.
NetSecurityNative
.GssBuffer* __outBuffer_native);
764
private static unsafe partial global::Interop.
NetSecurityNative
.Status Unwrap(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, out bool isEncrypt, byte* inputBytes, int count, ref global::Interop.
NetSecurityNative
.GssBuffer outBuffer)
772
global::Interop.
NetSecurityNative
.Status __retVal = default;
780
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __outBuffer_native = &outBuffer)
781
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
798
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __contextHandle_native, int* __isEncrypt_native, byte* __inputBytes_native, int __count_native, global::Interop.
NetSecurityNative
.GssBuffer* __outBuffer_native);
808
private static unsafe partial global::Interop.
NetSecurityNative
.Status GetMic(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, byte* inputBytes, int inputLength, ref global::Interop.
NetSecurityNative
.GssBuffer outBuffer)
814
global::Interop.
NetSecurityNative
.Status __retVal = default;
822
fixed (global::Interop.
NetSecurityNative
.GssBuffer* __outBuffer_native = &outBuffer)
823
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
838
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __contextHandle_native, byte* __inputBytes_native, int __inputLength_native, global::Interop.
NetSecurityNative
.GssBuffer* __outBuffer_native);
848
private static unsafe partial global::Interop.
NetSecurityNative
.Status VerifyMic(out global::Interop.
NetSecurityNative
.Status minorStatus, global::Microsoft.Win32.SafeHandles.SafeGssContextHandle contextHandle, byte* inputBytes, int inputLength, byte* tokenBytes, int tokenLength)
854
global::Interop.
NetSecurityNative
.Status __retVal = default;
862
fixed (global::Interop.
NetSecurityNative
.Status* __minorStatus_native = &minorStatus)
877
static extern unsafe global::Interop.
NetSecurityNative
.Status __PInvoke(global::Interop.
NetSecurityNative
.Status* __minorStatus_native, nint __contextHandle_native, byte* __inputBytes_native, int __inputLength_native, byte* __tokenBytes_native, int __tokenLength_native);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssApiException.cs (2)
85
Interop.
NetSecurityNative
.Status minStat;
86
Interop.
NetSecurityNative
.Status displayCallStatus = isMinor ?
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (2)
34
throw new
NetSecurityNative
.GssApiException(SR.Format(SR.net_context_buffer_too_small, sourceLength, destinationAvailable));
62
Interop.
NetSecurityNative
.ReleaseGssBuffer(_data, _length);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (36)
20
Interop.
NetSecurityNative
.Status minorStatus;
21
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.ImportUserName(
24
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
27
throw new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
37
Interop.
NetSecurityNative
.Status minorStatus;
38
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.ImportPrincipalName(
41
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
44
throw new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
57
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.ReleaseName(out _, ref handle);
59
return status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE;
75
public static SafeGssCredHandle CreateAcceptor(Interop.
NetSecurityNative
.PackageType packageType)
78
Interop.
NetSecurityNative
.Status status;
79
Interop.
NetSecurityNative
.Status minorStatus;
81
status = Interop.
NetSecurityNative
.AcquireAcceptorCred(out minorStatus, packageType, out retHandle);
82
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
85
throw new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
95
public static SafeGssCredHandle Create(string username, string password, Interop.
NetSecurityNative
.PackageType packageType)
97
if (packageType == Interop.
NetSecurityNative
.PackageType.NTLM && !s_IsNtlmInstalled.Value)
99
throw new Interop.
NetSecurityNative
.GssApiException(
100
Interop.
NetSecurityNative
.Status.GSS_S_BAD_MECH,
113
Interop.
NetSecurityNative
.Status status;
114
Interop.
NetSecurityNative
.Status minorStatus;
117
status = Interop.
NetSecurityNative
.InitiateCredSpNego(out minorStatus, userHandle, out retHandle);
121
status = Interop.
NetSecurityNative
.InitiateCredWithPassword(out minorStatus, packageType, userHandle, password, Encoding.UTF8.GetByteCount(password), out retHandle);
124
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
127
throw new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
146
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.ReleaseCred(out _, ref handle);
148
return status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE;
153
return Interop.
NetSecurityNative
.IsNtlmInstalled();
171
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.DeleteSecContext(out _, ref handle);
173
return status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE;
System\Net\NegotiateAuthenticationPal.Unix.cs (126)
44
catch (Exception ex) when (ex is Interop.
NetSecurityNative
.GssApiException or TypeInitializationException)
49
if (ex is Interop.
NetSecurityNative
.GssApiException gex)
68
catch (Exception ex) when (ex is Interop.
NetSecurityNative
.GssApiException or TypeInitializationException)
74
if (ex is Interop.
NetSecurityNative
.GssApiException gex)
94
private Interop.
NetSecurityNative
.GssFlags _requestedContextFlags;
95
private Interop.
NetSecurityNative
.GssFlags _contextFlags;
100
private readonly Interop.
NetSecurityNative
.PackageType _packageType;
112
public override bool IsSigned => (_contextFlags & Interop.
NetSecurityNative
.GssFlags.GSS_C_INTEG_FLAG) != 0;
114
public override bool IsEncrypted => (_contextFlags & Interop.
NetSecurityNative
.GssFlags.GSS_C_CONF_FLAG) != 0;
116
public override bool IsMutuallyAuthenticated => (_contextFlags & Interop.
NetSecurityNative
.GssFlags.GSS_C_MUTUAL_FLAG) != 0;
199
catch (Interop.
NetSecurityNative
.GssApiException ex)
251
(_contextFlags & Interop.
NetSecurityNative
.GssFlags.GSS_C_DELEG_FLAG) != 0 && Package != NegotiationInfoClass.NTLM ? TokenImpersonationLevel.Delegation :
252
(_contextFlags & Interop.
NetSecurityNative
.GssFlags.GSS_C_IDENTIFY_FLAG) != 0 ? TokenImpersonationLevel.Identification :
259
Interop.
NetSecurityNative
.GssFlags contextFlags = clientOptions.RequiredProtectionLevel switch
261
ProtectionLevel.Sign => Interop.
NetSecurityNative
.GssFlags.GSS_C_INTEG_FLAG,
262
ProtectionLevel.EncryptAndSign => Interop.
NetSecurityNative
.GssFlags.GSS_C_INTEG_FLAG | Interop.
NetSecurityNative
.GssFlags.GSS_C_CONF_FLAG,
266
contextFlags |= clientOptions.RequireMutualAuthentication ? Interop.
NetSecurityNative
.GssFlags.GSS_C_MUTUAL_FLAG : 0;
270
TokenImpersonationLevel.Identification => Interop.
NetSecurityNative
.GssFlags.GSS_C_IDENTIFY_FLAG,
271
TokenImpersonationLevel.Delegation => Interop.
NetSecurityNative
.GssFlags.GSS_C_DELEG_FLAG,
291
if (_packageType == Interop.
NetSecurityNative
.PackageType.NTLM)
295
throw new Interop.
NetSecurityNative
.GssApiException(Interop.
NetSecurityNative
.Status.GSS_S_NO_CRED, 0, SR.net_ntlm_not_possible_default_cred);
300
throw new Interop.
NetSecurityNative
.GssApiException(Interop.
NetSecurityNative
.Status.GSS_S_BAD_NAME, 0, SR.net_nego_not_supported_empty_target_with_defaultcreds);
313
Interop.
NetSecurityNative
.GssFlags contextFlags = serverOptions.RequiredProtectionLevel switch
315
ProtectionLevel.Sign => Interop.
NetSecurityNative
.GssFlags.GSS_C_INTEG_FLAG,
316
ProtectionLevel.EncryptAndSign => Interop.
NetSecurityNative
.GssFlags.GSS_C_INTEG_FLAG | Interop.
NetSecurityNative
.GssFlags.GSS_C_CONF_FLAG,
422
Interop.
NetSecurityNative
.GssBuffer encryptedBuffer = default;
425
Interop.
NetSecurityNative
.Status minorStatus;
427
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.WrapBuffer(
434
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
453
Interop.
NetSecurityNative
.GssBuffer decryptedBuffer = default(Interop.
NetSecurityNative
.GssBuffer);
456
Interop.
NetSecurityNative
.Status minorStatus;
457
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
458
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
462
Interop.
NetSecurityNative
.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
481
Interop.
NetSecurityNative
.GssBuffer decryptedBuffer = default(Interop.
NetSecurityNative
.GssBuffer);
484
Interop.
NetSecurityNative
.Status minorStatus;
485
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.UnwrapBuffer(out minorStatus, _securityContext, out wasEncrypted, input, ref decryptedBuffer);
486
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
492
Interop.
NetSecurityNative
.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered,
512
Interop.
NetSecurityNative
.GssBuffer micBuffer = default;
515
Interop.
NetSecurityNative
.Status minorStatus;
516
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.GetMic(
521
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
523
throw new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
538
Interop.
NetSecurityNative
.Status status = Interop.
NetSecurityNative
.VerifyMic(
543
return status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE;
546
private static Interop.
NetSecurityNative
.PackageType GetPackageType(string package)
550
return Interop.
NetSecurityNative
.PackageType.Negotiate;
554
return Interop.
NetSecurityNative
.PackageType.NTLM;
558
return Interop.
NetSecurityNative
.PackageType.Kerberos;
563
throw new Interop.
NetSecurityNative
.GssApiException(Interop.
NetSecurityNative
.Status.GSS_S_UNAVAILABLE, 0);
595
catch (Exception ex) when (ex is not Interop.
NetSecurityNative
.GssApiException)
598
throw new Interop.
NetSecurityNative
.GssApiException(Interop.
NetSecurityNative
.Status.GSS_S_BAD_NAME, 0);
608
Interop.
NetSecurityNative
.GssBuffer token = default(Interop.
NetSecurityNative
.GssBuffer);
613
Interop.
NetSecurityNative
.Status status;
618
status = Interop.
NetSecurityNative
.GetNameAttribute(out var minorStatus,
626
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
628
throw new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
642
Interop.
NetSecurityNative
.GssBuffer token = default(Interop.
NetSecurityNative
.GssBuffer);
646
Interop.
NetSecurityNative
.Status status
647
= Interop.
NetSecurityNative
.GetUser(out var minorStatus,
651
if (status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
653
throw new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
677
Interop.
NetSecurityNative
.GssFlags requestedContextFlags,
682
ref Interop.
NetSecurityNative
.GssFlags contextFlags)
693
Interop.
NetSecurityNative
.PackageType.NTLM => "NTLM",
694
Interop.
NetSecurityNative
.PackageType.Kerberos => "Kerberos",
704
Interop.
NetSecurityNative
.GssBuffer token = default(Interop.
NetSecurityNative
.GssBuffer);
705
Interop.
NetSecurityNative
.Status status;
706
Interop.
NetSecurityNative
.Status minorStatus;
714
status = Interop.
NetSecurityNative
.InitSecContext(out minorStatus,
728
status = Interop.
NetSecurityNative
.InitSecContext(out minorStatus,
740
if ((status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE) &&
741
(status != Interop.
NetSecurityNative
.Status.GSS_S_CONTINUE_NEEDED))
748
Interop.
NetSecurityNative
.GssApiException gex = new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
757
if (status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
763
Interop.
NetSecurityNative
.PackageType.NTLM => "NTLM",
764
Interop.
NetSecurityNative
.PackageType.Kerberos => "Kerberos",
775
contextFlags = (Interop.
NetSecurityNative
.GssFlags)outputFlags;
777
return status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE ?
799
ref Interop.
NetSecurityNative
.GssFlags contextFlags)
803
Interop.
NetSecurityNative
.GssBuffer token = default(Interop.
NetSecurityNative
.GssBuffer);
806
Interop.
NetSecurityNative
.Status status;
807
Interop.
NetSecurityNative
.Status minorStatus;
809
status = Interop.
NetSecurityNative
.AcceptSecContext(out minorStatus,
818
if ((status != Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE) &&
819
(status != Interop.
NetSecurityNative
.Status.GSS_S_CONTINUE_NEEDED))
821
Interop.
NetSecurityNative
.GssApiException gex = new Interop.
NetSecurityNative
.GssApiException(status, minorStatus);
827
if (status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE &&
828
((_packageType == Interop.
NetSecurityNative
.PackageType.Kerberos && isNtlmUsed) ||
829
(_packageType == Interop.
NetSecurityNative
.PackageType.NTLM && !isNtlmUsed)))
837
if (status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE &&
839
(outputFlags & (uint)Interop.
NetSecurityNative
.GssFlags.GSS_C_CHANNEL_BOUND_FLAG) == 0)
850
contextFlags = (Interop.
NetSecurityNative
.GssFlags)outputFlags;
854
if (status == Interop.
NetSecurityNative
.Status.GSS_S_COMPLETE)
886
internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.
NetSecurityNative
.GssApiException exception)
890
case Interop.
NetSecurityNative
.Status.GSS_S_NO_CRED:
892
case Interop.
NetSecurityNative
.Status.GSS_S_BAD_BINDINGS:
894
case Interop.
NetSecurityNative
.Status.GSS_S_CREDENTIALS_EXPIRED:
896
case Interop.
NetSecurityNative
.Status.GSS_S_DEFECTIVE_TOKEN:
898
case Interop.
NetSecurityNative
.Status.GSS_S_DEFECTIVE_CREDENTIAL:
900
case Interop.
NetSecurityNative
.Status.GSS_S_BAD_SIG:
902
case Interop.
NetSecurityNative
.Status.GSS_S_BAD_MECH:
903
case Interop.
NetSecurityNative
.Status.GSS_S_UNAVAILABLE:
905
case Interop.
NetSecurityNative
.Status.GSS_S_FAILURE:
913
case Interop.
NetSecurityNative
.Status.GSS_S_NO_CONTEXT:
924
_ = Interop.
NetSecurityNative
.IsNtlmInstalled();