Skip to content

Commit

Permalink
add SEC_E_CONTEXT_EXPIRED to avoid throwing InternalException (#79129)
Browse files Browse the repository at this point in the history
  • Loading branch information
wfurt committed Dec 5, 2022
1 parent a49489b commit 21a3647
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ internal enum SECURITY_STATUS
MessageAltered = unchecked((int)0x8009030F),
OutOfSequence = unchecked((int)0x80090310),
NoAuthenticatingAuthority = unchecked((int)0x80090311),
ContextExpiredError = unchecked((int)0x80090317),
IncompleteMessage = unchecked((int)0x80090318),
IncompleteCredentials = unchecked((int)0x80090320),
BufferNotEnough = unchecked((int)0x80090321),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace System.Net
{
internal static class SecurityStatusAdapterPal
{
private const int StatusDictionarySize = 44;
private const int StatusDictionarySize = 45;

#if DEBUG
static SecurityStatusAdapterPal()
Expand All @@ -31,6 +31,7 @@ static SecurityStatusAdapterPal()
{ Interop.SECURITY_STATUS.CompAndContinue, SecurityStatusPalErrorCode.CompAndContinue },
{ Interop.SECURITY_STATUS.CompleteNeeded, SecurityStatusPalErrorCode.CompleteNeeded },
{ Interop.SECURITY_STATUS.ContextExpired, SecurityStatusPalErrorCode.ContextExpired },
{ Interop.SECURITY_STATUS.ContextExpiredError, SecurityStatusPalErrorCode.ContextExpiredError },
{ Interop.SECURITY_STATUS.ContinueNeeded, SecurityStatusPalErrorCode.ContinueNeeded },
{ Interop.SECURITY_STATUS.CredentialsNeeded, SecurityStatusPalErrorCode.CredentialsNeeded },
{ Interop.SECURITY_STATUS.DecryptFailure, SecurityStatusPalErrorCode.DecryptFailure },
Expand Down
3 changes: 2 additions & 1 deletion src/libraries/Common/src/System/Net/SecurityStatusPal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ internal enum SecurityStatusPalErrorCode
DowngradeDetected,
ApplicationProtocolMismatch,
NoRenegotiation,
KeySetDoesNotExist
KeySetDoesNotExist,
ContextExpiredError
}
}

0 comments on commit 21a3647

Please sign in to comment.