185 references to NegotiateAuthenticationStatusCode
Microsoft.AspNetCore.Authentication.Negotiate (14)
Internal\NegotiateState.cs (14)
22var outgoingBlob = _instance.GetOutgoingBlob(incomingBlob, out var authStatus); 24if (authStatus == NegotiateAuthenticationStatusCode.Completed || 25authStatus == NegotiateAuthenticationStatusCode.ContinueNeeded) 71private static bool IsCredentialError(NegotiateAuthenticationStatusCode error) 73return error == NegotiateAuthenticationStatusCode.UnknownCredentials || 74error == NegotiateAuthenticationStatusCode.CredentialsExpired || 75error == NegotiateAuthenticationStatusCode.BadBinding; 78private static bool IsClientError(NegotiateAuthenticationStatusCode error) 80return error == NegotiateAuthenticationStatusCode.InvalidToken || 81error == NegotiateAuthenticationStatusCode.QopNotSupported || 82error == NegotiateAuthenticationStatusCode.UnknownCredentials || 83error == NegotiateAuthenticationStatusCode.MessageAltered || 84error == NegotiateAuthenticationStatusCode.OutOfSequence || 85error == NegotiateAuthenticationStatusCode.InvalidCredentials;
System.Net.Http (3)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (3)
153NegotiateAuthenticationStatusCode statusCode; 157if (statusCode > NegotiateAuthenticationStatusCode.ContinueNeeded || challengeResponse == null) 180if (statusCode > NegotiateAuthenticationStatusCode.ContinueNeeded)
System.Net.Mail (9)
System\Net\Mail\SmtpNegotiateAuthenticationModule.cs (6)
54NegotiateAuthenticationStatusCode statusCode; 61if (statusCode != NegotiateAuthenticationStatusCode.Completed && 62statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded) 119NegotiateAuthenticationStatusCode statusCode; 122if (statusCode != NegotiateAuthenticationStatusCode.Completed) 168if (statusCode != NegotiateAuthenticationStatusCode.Completed)
System\Net\Mail\SmtpNtlmAuthenticationModule.cs (3)
40NegotiateAuthenticationStatusCode statusCode; 43if (statusCode != NegotiateAuthenticationStatusCode.Completed && 44statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded)
System.Net.Security (159)
System\Net\NegotiateAuthenticationPal.cs (4)
22public abstract byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode); 23public abstract NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted); 24public abstract NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted); 25public abstract NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (21)
308return new UnsupportedNegotiateAuthenticationPal(clientOptions, NegotiateAuthenticationStatusCode.UnknownCredentials); 331public override unsafe byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 350statusCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 629private unsafe byte[]? ProcessChallenge(ReadOnlySpan<byte> blob, out NegotiateAuthenticationStatusCode statusCode) 634statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 644statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 657statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 664statusCode = NegotiateAuthenticationStatusCode.QopNotSupported; 672statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 681statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 775statusCode = NegotiateAuthenticationStatusCode.Completed; 838public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool _/*requestEncryption*/, out bool isEncrypted) 853return NegotiateAuthenticationStatusCode.Completed; 856public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 867return NegotiateAuthenticationStatusCode.InvalidToken; 875return NegotiateAuthenticationStatusCode.MessageAltered; 880return NegotiateAuthenticationStatusCode.Completed; 883public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) 896return NegotiateAuthenticationStatusCode.InvalidToken; 903return NegotiateAuthenticationStatusCode.MessageAltered; 906return NegotiateAuthenticationStatusCode.Completed;
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (26)
97public override unsafe byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 140private byte[]? CreateSpNegoNegotiateMessage(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 179if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded && 180statusCode != NegotiateAuthenticationStatusCode.Completed) 194statusCode == NegotiateAuthenticationStatusCode.Unsupported || 195(LocalAppContextSwitches.IsOpenBsd && statusCode == NegotiateAuthenticationStatusCode.UnknownCredentials); 223statusCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 227private byte[]? ProcessSpNegoChallenge(ReadOnlySpan<byte> challenge, out NegotiateAuthenticationStatusCode statusCode) 289statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 305statusCode = NegotiateAuthenticationStatusCode.Unsupported; 327statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 337if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded && 338statusCode != NegotiateAuthenticationStatusCode.Completed) 356if (statusCode == NegotiateAuthenticationStatusCode.Completed) 368statusCode = state == NegState.RequestMic ? NegotiateAuthenticationStatusCode.ContinueNeeded : NegotiateAuthenticationStatusCode.Completed; 369_isAuthenticated = statusCode == NegotiateAuthenticationStatusCode.Completed; 391statusCode = NegotiateAuthenticationStatusCode.GenericFailure; 397statusCode = NegotiateAuthenticationStatusCode.MessageAltered; 406NegState.AcceptCompleted => NegotiateAuthenticationStatusCode.Completed, 407NegState.AcceptIncomplete => NegotiateAuthenticationStatusCode.ContinueNeeded, 408NegState.Reject => NegotiateAuthenticationStatusCode.UnknownCredentials, 409_ => NegotiateAuthenticationStatusCode.GenericFailure 415public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 425public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 435public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\NegotiateAuthenticationPal.Unix.cs (42)
46NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported; 51if (statusCode <= NegotiateAuthenticationStatusCode.GenericFailure) 53statusCode = NegotiateAuthenticationStatusCode.Unsupported; 71NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported; 76if (statusCode <= NegotiateAuthenticationStatusCode.GenericFailure) 78statusCode = NegotiateAuthenticationStatusCode.Unsupported; 262public override byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 298if (statusCode >= NegotiateAuthenticationStatusCode.GenericFailure) 312if (statusCode == NegotiateAuthenticationStatusCode.Completed) 327public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 345return NegotiateAuthenticationStatusCode.GenericFailure; 350return NegotiateAuthenticationStatusCode.Completed; 358public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 371Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 372_ => NegotiateAuthenticationStatusCode.InvalidToken 378return NegotiateAuthenticationStatusCode.Completed; 386public override unsafe NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) 401Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 402_ => NegotiateAuthenticationStatusCode.InvalidToken 409return NegotiateAuthenticationStatusCode.Completed; 543private unsafe NegotiateAuthenticationStatusCode InitializeSecurityContext( 656NegotiateAuthenticationStatusCode.Completed : 657NegotiateAuthenticationStatusCode.ContinueNeeded; 662return NegotiateAuthenticationStatusCode.GenericFailure; 670private NegotiateAuthenticationStatusCode AcceptSecurityContext( 711NegotiateAuthenticationStatusCode errorCode; 722errorCode = NegotiateAuthenticationStatusCode.Completed; 726errorCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 735return NegotiateAuthenticationStatusCode.GenericFailure; 744internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.NetSecurityNative.GssApiException exception) 749return NegotiateAuthenticationStatusCode.UnknownCredentials; 751return NegotiateAuthenticationStatusCode.BadBinding; 753return NegotiateAuthenticationStatusCode.CredentialsExpired; 755return NegotiateAuthenticationStatusCode.InvalidToken; 757return NegotiateAuthenticationStatusCode.InvalidCredentials; 759return NegotiateAuthenticationStatusCode.MessageAltered; 762return NegotiateAuthenticationStatusCode.Unsupported; 768return NegotiateAuthenticationStatusCode.TargetUnknown; 770return NegotiateAuthenticationStatusCode.GenericFailure; 773return NegotiateAuthenticationStatusCode.GenericFailure;
System\Net\NegotiateAuthenticationPal.Unsupported.cs (9)
18private NegotiateAuthenticationStatusCode _statusCode; 29public UnsupportedNegotiateAuthenticationPal(NegotiateAuthenticationClientOptions clientOptions, NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported) 36public UnsupportedNegotiateAuthenticationPal(NegotiateAuthenticationServerOptions serverOptions, NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Unsupported) 46public override byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 52public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) => throw new InvalidOperationException(); 53public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) => throw new InvalidOperationException(); 54public override NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) => throw new InvalidOperationException();
System\Net\Security\NegotiateAuthentication.cs (26)
201/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 202/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 205/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 208public byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 218if (statusCode == NegotiateAuthenticationStatusCode.Completed) 222statusCode = NegotiateAuthenticationStatusCode.TargetUnknown; 226statusCode = NegotiateAuthenticationStatusCode.ImpersonationValidationFailed; 230statusCode = NegotiateAuthenticationStatusCode.SecurityQosFailed; 247/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 248/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 251/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 254public string? GetOutgoingBlob(string? incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 265statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 299/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success, other 300/// <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 309public NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 328/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 329/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 331/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 333/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 336public NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 356/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 357/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 359/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 361/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 364public NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\Security\NegotiateStream.cs (31)
397NegotiateAuthenticationStatusCode statusCode; 408statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 414statusCode = NegotiateAuthenticationStatusCode.Completed; 422if (statusCode != NegotiateAuthenticationStatusCode.Completed) 531NegotiateAuthenticationStatusCode statusCode; 539statusCode = NegotiateAuthenticationStatusCode.Completed; 546if (statusCode != NegotiateAuthenticationStatusCode.Completed) 763NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Completed; 769if (statusCode is NegotiateAuthenticationStatusCode.BadBinding or 770NegotiateAuthenticationStatusCode.TargetUnknown or 771NegotiateAuthenticationStatusCode.ImpersonationValidationFailed or 772NegotiateAuthenticationStatusCode.SecurityQosFailed) 776NegotiateAuthenticationStatusCode.BadBinding => 778NegotiateAuthenticationStatusCode.TargetUnknown => 780NegotiateAuthenticationStatusCode.ImpersonationValidationFailed => 792else if (statusCode == NegotiateAuthenticationStatusCode.Completed) 822else if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded) 826NegotiateAuthenticationStatusCode.BadBinding => (int)Interop.SECURITY_STATUS.BadBinding, 827NegotiateAuthenticationStatusCode.Unsupported => (int)Interop.SECURITY_STATUS.Unsupported, 828NegotiateAuthenticationStatusCode.MessageAltered => (int)Interop.SECURITY_STATUS.MessageAltered, 829NegotiateAuthenticationStatusCode.ContextExpired => (int)Interop.SECURITY_STATUS.ContextExpired, 830NegotiateAuthenticationStatusCode.CredentialsExpired => (int)Interop.SECURITY_STATUS.CertExpired, 831NegotiateAuthenticationStatusCode.InvalidCredentials => (int)Interop.SECURITY_STATUS.LogonDenied, 832NegotiateAuthenticationStatusCode.InvalidToken => (int)Interop.SECURITY_STATUS.InvalidToken, 833NegotiateAuthenticationStatusCode.UnknownCredentials => (int)Interop.SECURITY_STATUS.UnknownCredentials, 834NegotiateAuthenticationStatusCode.QopNotSupported => (int)Interop.SECURITY_STATUS.QopNotSupported, 835NegotiateAuthenticationStatusCode.OutOfSequence => (int)Interop.SECURITY_STATUS.OutOfSequence, 841NegotiateAuthenticationStatusCode.InvalidCredentials => 897_context.GetOutgoingBlob(message, out NegotiateAuthenticationStatusCode statusCode); 898_remoteOk = statusCode is NegotiateAuthenticationStatusCode.Completed;