186 references to NegotiateAuthenticationStatusCode
Microsoft.AspNetCore.Authentication.Negotiate (14)
Internal\NegotiateState.cs (14)
38var outgoingBlob = _instance.GetOutgoingBlob(incomingBlob, out var authStatus); 40if (authStatus == NegotiateAuthenticationStatusCode.Completed || 41authStatus == NegotiateAuthenticationStatusCode.ContinueNeeded) 94private static bool IsCredentialError(NegotiateAuthenticationStatusCode error) 96return error == NegotiateAuthenticationStatusCode.UnknownCredentials || 97error == NegotiateAuthenticationStatusCode.CredentialsExpired || 98error == NegotiateAuthenticationStatusCode.BadBinding; 101private static bool IsClientError(NegotiateAuthenticationStatusCode error) 103return error == NegotiateAuthenticationStatusCode.InvalidToken || 104error == NegotiateAuthenticationStatusCode.QopNotSupported || 105error == NegotiateAuthenticationStatusCode.UnknownCredentials || 106error == NegotiateAuthenticationStatusCode.MessageAltered || 107error == NegotiateAuthenticationStatusCode.OutOfSequence || 108error == 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 (160)
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) 195statusCode == NegotiateAuthenticationStatusCode.Unsupported || 196statusCode == NegotiateAuthenticationStatusCode.UnknownCredentials; 224statusCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 228private byte[]? ProcessSpNegoChallenge(ReadOnlySpan<byte> challenge, out NegotiateAuthenticationStatusCode statusCode) 290statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 306statusCode = NegotiateAuthenticationStatusCode.Unsupported; 328statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 338if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded && 339statusCode != NegotiateAuthenticationStatusCode.Completed) 357if (statusCode == NegotiateAuthenticationStatusCode.Completed) 369statusCode = state == NegState.RequestMic ? NegotiateAuthenticationStatusCode.ContinueNeeded : NegotiateAuthenticationStatusCode.Completed; 370_isAuthenticated = statusCode == NegotiateAuthenticationStatusCode.Completed; 392statusCode = NegotiateAuthenticationStatusCode.GenericFailure; 398statusCode = NegotiateAuthenticationStatusCode.MessageAltered; 407NegState.AcceptCompleted => NegotiateAuthenticationStatusCode.Completed, 408NegState.AcceptIncomplete => NegotiateAuthenticationStatusCode.ContinueNeeded, 409NegState.Reject => NegotiateAuthenticationStatusCode.UnknownCredentials, 410_ => NegotiateAuthenticationStatusCode.GenericFailure 416public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 426public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 436public 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) 297if (statusCode >= NegotiateAuthenticationStatusCode.GenericFailure) 311if (statusCode == NegotiateAuthenticationStatusCode.Completed) 326public override NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 344return NegotiateAuthenticationStatusCode.GenericFailure; 349return NegotiateAuthenticationStatusCode.Completed; 357public override NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 370Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 371_ => NegotiateAuthenticationStatusCode.InvalidToken 377return NegotiateAuthenticationStatusCode.Completed; 385public override unsafe NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted) 400Interop.NetSecurityNative.Status.GSS_S_BAD_SIG => NegotiateAuthenticationStatusCode.MessageAltered, 401_ => NegotiateAuthenticationStatusCode.InvalidToken 408return NegotiateAuthenticationStatusCode.Completed; 542private NegotiateAuthenticationStatusCode InitializeSecurityContext( 648NegotiateAuthenticationStatusCode.Completed : 649NegotiateAuthenticationStatusCode.ContinueNeeded; 654return NegotiateAuthenticationStatusCode.GenericFailure; 662private NegotiateAuthenticationStatusCode AcceptSecurityContext( 704NegotiateAuthenticationStatusCode errorCode; 715errorCode = NegotiateAuthenticationStatusCode.Completed; 719errorCode = NegotiateAuthenticationStatusCode.ContinueNeeded; 728return NegotiateAuthenticationStatusCode.GenericFailure; 737internal static NegotiateAuthenticationStatusCode GetErrorCode(Interop.NetSecurityNative.GssApiException exception) 742return NegotiateAuthenticationStatusCode.UnknownCredentials; 744return NegotiateAuthenticationStatusCode.BadBinding; 746return NegotiateAuthenticationStatusCode.CredentialsExpired; 748return NegotiateAuthenticationStatusCode.InvalidToken; 750return NegotiateAuthenticationStatusCode.InvalidCredentials; 752return NegotiateAuthenticationStatusCode.MessageAltered; 755return NegotiateAuthenticationStatusCode.Unsupported; 761return NegotiateAuthenticationStatusCode.TargetUnknown; 763return NegotiateAuthenticationStatusCode.GenericFailure; 766return 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 (27)
217/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 218/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 221/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 224public byte[]? GetOutgoingBlob(ReadOnlySpan<byte> incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 234if (statusCode == NegotiateAuthenticationStatusCode.Completed) 238statusCode = NegotiateAuthenticationStatusCode.TargetUnknown; 242statusCode = NegotiateAuthenticationStatusCode.ImpersonationValidationFailed; 246statusCode = NegotiateAuthenticationStatusCode.SecurityQosFailed; 250statusCode = NegotiateAuthenticationStatusCode.SecurityQosFailed; 267/// Successful step of the authentication returns either <see cref="NegotiateAuthenticationStatusCode.Completed" /> 268/// or <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> status codes. 271/// When <see cref="NegotiateAuthenticationStatusCode.ContinueNeeded" /> is returned the 274public string? GetOutgoingBlob(string? incomingBlob, out NegotiateAuthenticationStatusCode statusCode) 285statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 319/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success, other 320/// <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 329public NegotiateAuthenticationStatusCode Wrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, bool requestEncryption, out bool isEncrypted) 348/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 349/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 351/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 353/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 356public NegotiateAuthenticationStatusCode Unwrap(ReadOnlySpan<byte> input, IBufferWriter<byte> outputWriter, out bool wasEncrypted) 376/// <see cref="NegotiateAuthenticationStatusCode.Completed" /> on success. 377/// <see cref="NegotiateAuthenticationStatusCode.MessageAltered" /> if the message signature was 379/// <see cref="NegotiateAuthenticationStatusCode.InvalidToken" /> if the wrapped message was 381/// Other <see cref="NegotiateAuthenticationStatusCode" /> values on failure. 384public NegotiateAuthenticationStatusCode UnwrapInPlace(Span<byte> input, out int unwrappedOffset, out int unwrappedLength, out bool wasEncrypted)
System\Net\Security\NegotiateStream.cs (31)
394NegotiateAuthenticationStatusCode statusCode; 405statusCode = NegotiateAuthenticationStatusCode.InvalidToken; 411statusCode = NegotiateAuthenticationStatusCode.Completed; 419if (statusCode != NegotiateAuthenticationStatusCode.Completed) 528NegotiateAuthenticationStatusCode statusCode; 536statusCode = NegotiateAuthenticationStatusCode.Completed; 543if (statusCode != NegotiateAuthenticationStatusCode.Completed) 761NegotiateAuthenticationStatusCode statusCode = NegotiateAuthenticationStatusCode.Completed; 767if (statusCode is NegotiateAuthenticationStatusCode.BadBinding or 768NegotiateAuthenticationStatusCode.TargetUnknown or 769NegotiateAuthenticationStatusCode.ImpersonationValidationFailed or 770NegotiateAuthenticationStatusCode.SecurityQosFailed) 774NegotiateAuthenticationStatusCode.BadBinding => 776NegotiateAuthenticationStatusCode.TargetUnknown => 778NegotiateAuthenticationStatusCode.ImpersonationValidationFailed => 790else if (statusCode == NegotiateAuthenticationStatusCode.Completed) 820else if (statusCode != NegotiateAuthenticationStatusCode.ContinueNeeded) 824NegotiateAuthenticationStatusCode.BadBinding => (int)Interop.SECURITY_STATUS.BadBinding, 825NegotiateAuthenticationStatusCode.Unsupported => (int)Interop.SECURITY_STATUS.Unsupported, 826NegotiateAuthenticationStatusCode.MessageAltered => (int)Interop.SECURITY_STATUS.MessageAltered, 827NegotiateAuthenticationStatusCode.ContextExpired => (int)Interop.SECURITY_STATUS.ContextExpired, 828NegotiateAuthenticationStatusCode.CredentialsExpired => (int)Interop.SECURITY_STATUS.CertExpired, 829NegotiateAuthenticationStatusCode.InvalidCredentials => (int)Interop.SECURITY_STATUS.LogonDenied, 830NegotiateAuthenticationStatusCode.InvalidToken => (int)Interop.SECURITY_STATUS.InvalidToken, 831NegotiateAuthenticationStatusCode.UnknownCredentials => (int)Interop.SECURITY_STATUS.UnknownCredentials, 832NegotiateAuthenticationStatusCode.QopNotSupported => (int)Interop.SECURITY_STATUS.QopNotSupported, 833NegotiateAuthenticationStatusCode.OutOfSequence => (int)Interop.SECURITY_STATUS.OutOfSequence, 839NegotiateAuthenticationStatusCode.InvalidCredentials => 895_context.GetOutgoingBlob(message, out NegotiateAuthenticationStatusCode statusCode); 896_remoteOk = statusCode is NegotiateAuthenticationStatusCode.Completed;