1 module sspi.defines;
2 
3 version(Windows):
4 import core.sys.windows.ntsecpkg;
5 import core.sys.windows.sspi;
6 import core.sys.windows.security;
7 
8 
9 enum SecPkgFlag
10 {
11 	integrity = SECPKG_FLAG_INTEGRITY,
12 	privacy = SECPKG_FLAG_PRIVACY,
13 	tokenOnly = SECPKG_FLAG_TOKEN_ONLY,
14 	datagram = SECPKG_FLAG_DATAGRAM,
15 	connection = SECPKG_FLAG_CONNECTION,
16 	multiRequired = SECPKG_FLAG_MULTI_REQUIRED,
17 	clientOnly = SECPKG_FLAG_CLIENT_ONLY,
18 	extendedError = SECPKG_FLAG_EXTENDED_ERROR,
19 	impersonation = SECPKG_FLAG_IMPERSONATION,
20 	acceptWin32Name = SECPKG_FLAG_ACCEPT_WIN32_NAME,
21 	stream = SECPKG_FLAG_STREAM,
22 }
23 
24 
25 enum SECPKG_ATTR_NEGOTIATION_PACKAGE = 0x80000081;
26 
27 enum SecPackageAttribute
28 {
29 	authority = SECPKG_ATTR_AUTHORITY,
30 	connectionInfo = SECPKG_ATTR_CONNECTION_INFO,
31 	issuerList = SECPKG_ATTR_ISSUER_LIST,
32 	issuerListEx = SECPKG_ATTR_ISSUER_LIST_EX,
33 	keyInfo = SECPKG_ATTR_KEY_INFO,
34 	lifespan = SECPKG_ATTR_LIFESPAN,
35 	localCertContext = SECPKG_ATTR_LOCAL_CERT_CONTEXT,
36 	localCred = SECPKG_ATTR_LOCAL_CRED,
37 	names = SECPKG_ATTR_NAMES,
38 	protoInfo = SECPKG_ATTR_PROTO_INFO,
39 	remoteCertContext = SECPKG_ATTR_REMOTE_CERT_CONTEXT,
40 	remoteCred = SECPKG_ATTR_REMOTE_CRED,
41 	sizes = SECPKG_ATTR_SIZES,
42 	streamSizes = SECPKG_ATTR_STREAM_SIZES,
43 	negotiationInfo = SECPKG_ATTR_NEGOTIATION_PACKAGE,
44 }
45 
46 struct SecPkgContext_NegotiationInfoW
47 {
48 	SecPkgInfoW*  packageInfo;
49 	ulong negotiationState;
50 }
51 
52 
53 enum SecurityStatus
54 {
55     okay = 0,
56 	// bufferTooSmall = SECURITY_STATUS.SEC_E_BUFFER_TOO_SMALL,
57 	// contextExpired = SECURITY_STATUS.SEC_E_CONTEXT_EXPIRED,
58     // SEC_E_CERT_EXPIRED = (-2146893016),
59 	// cryptoSystemInvalid = SECURITY_STATUS.SEC_E_CRYPTO_SYSTEM_INVALID,
60     insufficientMemory =(-2146893056),
61     invalidHandle = (-2146893055),
62     invalidToken = (-2146893048),
63 	qopNotSupported = (-2146893046),
64 	//outOfSequence = SECURITY_STATUS.SEC_E_OUT_OF_SEQUENCE,
65 	//messageAltered = SECURITY_STATUS.SEC_E_MESSAGE_ALTERED,
66     completeAndContinue = 590612,
67     completeNeeded = 590611,
68 }
69 /+
70 enum :SECURITY_STATUS{
71     SEC_E_OK = 0,
72     SEC_E_CERT_EXPIRED = (-2146893016),
73     SEC_E_INCOMPLETE_MESSAGE = (-2146893032),
74     SEC_E_INSUFFICIENT_MEMORY = (-2146893056),
75     SEC_E_INTERNAL_ERROR = (-2146893052),
76     SEC_E_INVALID_HANDLE = (-2146893055),
77     SEC_E_INVALID_TOKEN = (-2146893048),
78     SEC_E_LOGON_DENIED = (-2146893044),
79     SEC_E_NO_AUTHENTICATING_AUTHORITY = (-2146893039),
80     SEC_E_NO_CREDENTIALS = (-2146893042),
81     SEC_E_TARGET_UNKNOWN = (-2146893053),
82     SEC_E_UNSUPPORTED_FUNCTION = (-2146893054),
83     SEC_E_UNTRUSTED_ROOT = (-2146893019),
84     SEC_E_WRONG_PRINCIPAL = (-2146893022),
85     SEC_E_SECPKG_NOT_FOUND = (-2146893051),
86     SEC_E_QOP_NOT_SUPPORTED = (-2146893046),
87     SEC_E_UNKNOWN_CREDENTIALS = (-2146893043),
88     SEC_E_NOT_OWNER = (-2146893050),
89 }
90 enum :SECURITY_STATUS {
91     SEC_I_RENEGOTIATE = 590625,
92     SEC_I_COMPLETE_AND_CONTINUE = 590612,
93     SEC_I_COMPLETE_NEEDED = 590611,
94     SEC_I_CONTINUE_NEEDED = 590610,
95     SEC_I_INCOMPLETE_CREDENTIALS = 590624,
96 }
97 +/
98 
99 
100 enum IscReq
101 {
102 	delegate_ = ISC_REQ_DELEGATE,
103 	mutualAuth = ISC_REQ_MUTUAL_AUTH,
104 	replayDetect = ISC_REQ_REPLAY_DETECT,
105 	sequenceDetect = ISC_REQ_SEQUENCE_DETECT,
106 	confidentiality = ISC_REQ_CONFIDENTIALITY,
107 	useSessionKey = ISC_REQ_USE_SESSION_KEY,
108 	promptForCreds = ISC_REQ_PROMPT_FOR_CREDS,
109 	useSuppliedCreds = ISC_REQ_USE_SUPPLIED_CREDS,
110 	allocateMemory = ISC_REQ_ALLOCATE_MEMORY,
111 	useDceStyle = ISC_REQ_USE_DCE_STYLE,
112 	datagram = ISC_REQ_DATAGRAM,
113 	connection = ISC_REQ_CONNECTION,
114 	extendedError = ISC_REQ_EXTENDED_ERROR,
115 	stream = ISC_REQ_STREAM,
116 	integrity = ISC_REQ_INTEGRITY,
117 	manualCredValidation = ISC_REQ_MANUAL_CRED_VALIDATION,
118 	http = ISC_REQ_HTTP,
119 }
120