1 // Licensed to the .NET Foundation under one or more agreements.
2 // The .NET Foundation licenses this file to you under the MIT license.
3 // See the LICENSE file in the project root for more information.
4 
5 using System.Runtime.InteropServices;
6 
7 internal static partial class Interop
8 {
9     internal static partial class SChannel
10     {
11         // schannel.h;
12 
13         //
14         //
15         // ApplyControlToken PkgParams types
16         //
17         // These identifiers are the DWORD types
18         // to be passed into ApplyControlToken
19         // through a PkgParams buffer.
20 
21         public const int SCHANNEL_RENEGOTIATE = 0;   // renegotiate a connection
22         public const int SCHANNEL_SHUTDOWN = 1;   // gracefully close down a connection
23         public const int SCHANNEL_ALERT = 2;   // build an error message
24         public const int SCHANNEL_SESSION = 3;   // session control
25 
26 
27         // Alert token structure.
28         [StructLayout(LayoutKind.Sequential)]
29         public struct SCHANNEL_ALERT_TOKEN
30         {
31             public uint dwTokenType;            // SCHANNEL_ALERT
32             public uint dwAlertType;
33             public uint dwAlertNumber;
34         }
35 
36         // Alert types.
37         public const int TLS1_ALERT_WARNING = 1;
38         public const int TLS1_ALERT_FATAL = 2;
39 
40         // Alert messages.
41         public const int TLS1_ALERT_CLOSE_NOTIFY = 0; // warning
42         public const int TLS1_ALERT_UNEXPECTED_MESSAGE = 10; // error
43         public const int TLS1_ALERT_BAD_RECORD_MAC = 20; // error
44         public const int TLS1_ALERT_DECRYPTION_FAILED = 21; // reserved
45         public const int TLS1_ALERT_RECORD_OVERFLOW = 22; // error
46         public const int TLS1_ALERT_DECOMPRESSION_FAIL = 30; // error
47         public const int TLS1_ALERT_HANDSHAKE_FAILURE = 40; // error
48         public const int TLS1_ALERT_BAD_CERTIFICATE = 42; // warning or error
49         public const int TLS1_ALERT_UNSUPPORTED_CERT = 43; // warning or error
50         public const int TLS1_ALERT_CERTIFICATE_REVOKED = 44; // warning or error
51         public const int TLS1_ALERT_CERTIFICATE_EXPIRED = 45; // warning or error
52         public const int TLS1_ALERT_CERTIFICATE_UNKNOWN = 46; // warning or error
53         public const int TLS1_ALERT_ILLEGAL_PARAMETER = 47; // error
54         public const int TLS1_ALERT_UNKNOWN_CA = 48; // error
55         public const int TLS1_ALERT_ACCESS_DENIED = 49; // error
56         public const int TLS1_ALERT_DECODE_ERROR = 50; // error
57         public const int TLS1_ALERT_DECRYPT_ERROR = 51; // error
58         public const int TLS1_ALERT_EXPORT_RESTRICTION = 60; // reserved
59         public const int TLS1_ALERT_PROTOCOL_VERSION = 70; // error
60         public const int TLS1_ALERT_INSUFFIENT_SECURITY = 71; // error
61         public const int TLS1_ALERT_INTERNAL_ERROR = 80; // error
62         public const int TLS1_ALERT_USER_CANCELED = 90; // warning or error
63         public const int TLS1_ALERT_NO_RENEGOTIATION = 100; // warning
64         public const int TLS1_ALERT_UNSUPPORTED_EXT = 110; // error
65     }
66 }
67