add SEC_E_CONTEXT_EXPIRED to avoid throwing InternalException (#79129)
authorTomas Weinfurt <tweinfurt@yahoo.com>
Mon, 5 Dec 2022 21:44:53 +0000 (13:44 -0800)
committerGitHub <noreply@github.com>
Mon, 5 Dec 2022 21:44:53 +0000 (13:44 -0800)
src/libraries/Common/src/Interop/Windows/SChannel/Interop.SECURITY_STATUS.cs
src/libraries/Common/src/System/Net/SecurityStatusAdapterPal.Windows.cs
src/libraries/Common/src/System/Net/SecurityStatusPal.cs

index 17fe421cb5aff1b4abfb57dc4cfe2e0e45309873..67370f9587fa08e361bd0d3c57a0aa7eebc9f049 100644 (file)
@@ -33,6 +33,7 @@ internal static partial class Interop
         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),
index f804caddbd01c6f4f7e9f8871ef11794aa985ed3..a6b4e4115d48f43e6aaa3cab4491bbfa1f120d85 100644 (file)
@@ -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()
@@ -31,6 +31,7 @@ namespace System.Net
             { 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 },
index 064aa974d6bb2690ebc34f5c4cc1ad9230e73cdf..f3847b88397da4bc145a47bcf496a2d36d8a0955 100644 (file)
@@ -71,6 +71,7 @@ namespace System.Net
         DowngradeDetected,
         ApplicationProtocolMismatch,
         NoRenegotiation,
-        KeySetDoesNotExist
+        KeySetDoesNotExist,
+        ContextExpiredError
     }
 }