Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

401 lines
8.4 KiB

  1. //+--------------------------------------------------------------------------
  2. //
  3. // Copyright (c) 1997-1999 Microsoft Corporation
  4. //
  5. // File:
  6. //
  7. // Contents:
  8. //
  9. // History:
  10. //
  11. //---------------------------------------------------------------------------
  12. #ifndef __TLSAPIP_H__
  13. #define __TLSAPIP_H__
  14. #include <wincrypt.h>
  15. #include "tlsapi.h"
  16. #include "tlsrpc.h"
  17. #define TLSCERT_TYPE_EXCHANGE 1
  18. #define TLSCERT_TYPE_SIGNATURE 2
  19. #define ENTERPRISE_SERVER_MULTI L"EnterpriseServerMulti"
  20. #define TLS_RTM_VERSION_BIT 0x20000000
  21. #define IS_LSSERVER_RTM(x) ((x & TLS_RTM_VERSION_BIT) > 0)
  22. #define TLS_VERSION_ENTERPRISE_BIT 0x80000000
  23. #define CURRENT_TLSERVER_VERSION(version) HIBYTE(LOWORD(version))
  24. #define GET_LSSERVER_MAJOR_VERSION(version) HIBYTE(LOWORD(version))
  25. #define GET_LSSERVER_MINOR_VERSION(version) LOBYTE(LOWORD(version))
  26. #define IS_ENFORCE_LSSERVER(version) \
  27. ((version & 0x40000000) > 0)
  28. //#define PERMANENT_LICENSE_LEASE_EXPIRE_LEEWAY (30) /* 30 seconds */
  29. #define PERMANENT_LICENSE_LEASE_EXPIRE_LEEWAY (60*60*24*7) /* 7 days */
  30. //
  31. // TLSInstallCertificate() certificate type.
  32. //
  33. #define CERTIFICATE_CA_TYPE 1
  34. #define CERTITICATE_MF_TYPE 2
  35. #define CERTIFICATE_CH_TYPE 3
  36. #define CERTIFICATE_SPK_TYPE 4
  37. #define CERTIFICATE_LEVEL_ROOT 0
  38. typedef struct _LSHydraCertRequest {
  39. DWORD dwHydraVersion;
  40. PBYTE pbEncryptedHwid;
  41. DWORD cbEncryptedHwid;
  42. LPTSTR szSubjectRdn;
  43. PCERT_PUBLIC_KEY_INFO SubjectPublicKeyInfo;
  44. DWORD dwNumCertExtension;
  45. PCERT_EXTENSION pCertExtensions;
  46. } LSHydraCertRequest, *LPLSHydraCertRequest, *PLSHydraCertRequest;
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50. DWORD WINAPI
  51. RequestToTlsRequest(
  52. const LICENSEREQUEST* lpRequest,
  53. TLSLICENSEREQUEST* lpRpcRequest
  54. );
  55. DWORD WINAPI
  56. TlsRequestToRequest(
  57. TLSLICENSEREQUEST* lpRpcRequest ,
  58. LICENSEREQUEST* lpRequest
  59. );
  60. DWORD WINAPI
  61. TLSReplicateKeyPack(
  62. TLS_HANDLE hHandle,
  63. DWORD cbLsIdentification,
  64. PBYTE pbLsIdentification,
  65. LPLSKeyPack lpKeyPack,
  66. PDWORD pdwErrCode
  67. );
  68. DWORD WINAPI
  69. TLSAuditLicenseKeyPack(
  70. TLS_HANDLE hHandle,
  71. DWORD dwKeyPackId,
  72. FILETIME ftStartTime,
  73. FILETIME ftEndTime,
  74. BOOL bResetCounter,
  75. LPTLSKeyPackAudit lplsAudit,
  76. PDWORD dwErrCode
  77. );
  78. DWORD WINAPI
  79. TLSRetrieveTermServCert(
  80. TLS_HANDLE hHandle,
  81. DWORD cbResponseData,
  82. PBYTE pbResponseData,
  83. PDWORD cbCert,
  84. PBYTE* pbCert,
  85. PDWORD pdwErrCode
  86. );
  87. DWORD WINAPI
  88. TLSRequestTermServCert(
  89. TLS_HANDLE hHandle,
  90. LPLSHydraCertRequest pRequest,
  91. PDWORD cbChallengeData,
  92. PBYTE* pbChallengeData,
  93. PDWORD pdwErrCode
  94. );
  95. DWORD WINAPI
  96. TLSInstallCertificate(
  97. TLS_HANDLE hHandle,
  98. DWORD dwCertType,
  99. DWORD dwCertLevel,
  100. DWORD cbSingnatureCert,
  101. PBYTE pbSingnatureCert,
  102. DWORD cbExchangeCert,
  103. PBYTE pbExchangeCert,
  104. PDWORD pdwErrCode
  105. );
  106. DWORD WINAPI
  107. TLSGetServerCertificate(
  108. TLS_HANDLE hHandle,
  109. BOOL bSignCert,
  110. PBYTE *ppCertBlob,
  111. PDWORD pdwCertBlobLen,
  112. PDWORD pdwErrCode
  113. );
  114. DWORD WINAPI
  115. TLSRegisterLicenseKeyPack(
  116. TLS_HANDLE hHandle,
  117. LPBYTE pbCHCertBlob,
  118. DWORD cbCHCertBlobSize,
  119. LPBYTE pbRootCertBlob,
  120. DWORD cbRootCertBlob,
  121. LPBYTE lpKeyPackBlob,
  122. DWORD dwKeyPackBlobLen,
  123. PDWORD pdwErrCode
  124. );
  125. DWORD WINAPI
  126. TLSGetLSPKCS10CertRequest(
  127. TLS_HANDLE hHandle,
  128. DWORD dwCertType,
  129. PDWORD pcbdata,
  130. PBYTE* ppbData,
  131. PDWORD pdwErrCode
  132. );
  133. DWORD WINAPI
  134. TLSKeyPackAdd(
  135. TLS_HANDLE hHandle,
  136. LPLSKeyPack lpKeypack,
  137. PDWORD pdwErrCode
  138. );
  139. DWORD WINAPI
  140. TLSKeyPackSetStatus(
  141. TLS_HANDLE hHandle,
  142. DWORD dwSetParm,
  143. LPLSKeyPack lpKeyPack,
  144. PDWORD pdwErrCode
  145. );
  146. DWORD WINAPI
  147. TLSLicenseSetStatus(
  148. TLS_HANDLE hHandle,
  149. DWORD dwSetParam,
  150. LPLSLicense lpLicense,
  151. PDWORD pdwErrCode
  152. );
  153. DWORD WINAPI
  154. TLSReturnKeyPack(
  155. TLS_HANDLE hHandle,
  156. DWORD dwKeyPackId,
  157. DWORD dwReturnReason,
  158. PDWORD pdwErrCode
  159. );
  160. DWORD WINAPI
  161. TLSReturnLicense(
  162. TLS_HANDLE hHandle,
  163. DWORD dwKeyPackId,
  164. DWORD dwLicenseId,
  165. DWORD dwReturnReason,
  166. PDWORD pdwErrCode
  167. );
  168. DWORD WINAPI
  169. TLSAnnounceServer(
  170. TLS_HANDLE hHandle,
  171. DWORD dwType,
  172. FILETIME* ftTime,
  173. LPTSTR pszSetupId,
  174. LPTSTR pszDomainName,
  175. LPTSTR pszMachineName,
  176. PDWORD pdwErrCode
  177. );
  178. DWORD WINAPI
  179. TLSLookupServer(
  180. TLS_HANDLE hHandle,
  181. LPTSTR pszLookupSetupId,
  182. LPTSTR pszLsSetupId,
  183. PDWORD pcbSetupId,
  184. LPTSTR pszDomainName,
  185. PDWORD pcbDomainName,
  186. LPTSTR pszLsName,
  187. PDWORD pcbMachineName,
  188. PDWORD pdwErrCode
  189. );
  190. DWORD WINAPI
  191. TLSLookupServerFixed(
  192. IN TLS_HANDLE hHandle,
  193. IN LPTSTR pszLookupSetupId,
  194. OUT LPTSTR *pszLsSetupId,
  195. OUT LPTSTR *pszDomainName,
  196. OUT LPTSTR *pszLsName,
  197. IN OUT PDWORD pdwErrCode
  198. );
  199. DWORD WINAPI
  200. TLSAnnounceLicensePack(
  201. TLS_HANDLE hHandle,
  202. PTLSReplRecord pReplRecord,
  203. OUT PDWORD pdwErrCode
  204. );
  205. DWORD WINAPI
  206. TLSReturnLicensedProduct(
  207. PCONTEXT_HANDLE phContext,
  208. PTLSLicenseToBeReturn pClientLicense,
  209. PDWORD pdwErrCode
  210. );
  211. DWORD WINAPI
  212. TLSTriggerReGenKey(
  213. IN TLS_HANDLE hHandle,
  214. IN BOOL bReserved,
  215. OUT PDWORD pdwErrCode
  216. );
  217. DWORD WINAPI
  218. TLSSetTlsPrivateData(
  219. IN TLS_HANDLE hHandle,
  220. IN DWORD dwPrivateDataType,
  221. IN PTLSPrivateDataUnion pPrivateData,
  222. OUT PDWORD pdwErrCode
  223. );
  224. DWORD WINAPI
  225. TLSGetTlsPrivateData(
  226. IN TLS_HANDLE hHandle,
  227. IN DWORD dwGetDataType,
  228. IN PTLSPrivateDataUnion pGetParm,
  229. OUT PDWORD pdwRetDataType,
  230. OUT PTLSPrivateDataUnion* ppRetData,
  231. OUT PDWORD pdwErrCode
  232. );
  233. DWORD WINAPI
  234. TLSResponseServerChallenge(
  235. IN TLS_HANDLE hHandle,
  236. IN PTLSCHALLENGERESPONSEDATA pClientResponse,
  237. OUT PDWORD pdwErrCode
  238. );
  239. DWORD WINAPI
  240. TLSChallengeServer(
  241. IN TLS_HANDLE hHandle,
  242. IN DWORD dwClientType,
  243. IN PTLSCHALLENGEDATA pClientChallenge,
  244. OUT PTLSCHALLENGERESPONSEDATA* ppServerResponse,
  245. OUT PTLSCHALLENGEDATA* ppServerChallenge,
  246. OUT PDWORD pdwErrCode
  247. );
  248. DWORD WINAPI
  249. TLSTelephoneRegisterLKP(
  250. TLS_HANDLE hHandle,
  251. DWORD cbData,
  252. PBYTE pbData,
  253. PDWORD pdwErrCode
  254. );
  255. DWORD WINAPI
  256. TLSGetServerUniqueId(
  257. TLS_HANDLE hHandle,
  258. PDWORD pcbData,
  259. PBYTE* ppbByte,
  260. PDWORD pdwErrCode
  261. );
  262. DWORD WINAPI
  263. TLSGetServerPID(
  264. TLS_HANDLE hHandle,
  265. PDWORD pcbData,
  266. PBYTE* ppbByte,
  267. PDWORD pdwErrCode
  268. );
  269. DWORD WINAPI
  270. TLSGetServerSPK(
  271. TLS_HANDLE hHandle,
  272. PDWORD pcbData,
  273. PBYTE* ppbByte,
  274. PDWORD pdwErrCode
  275. );
  276. DWORD WINAPI
  277. TLSDepositeServerSPK(
  278. TLS_HANDLE hHandle,
  279. DWORD cbSPK,
  280. PBYTE pbSPK,
  281. PCERT_EXTENSIONS pCertExtensions,
  282. PDWORD pdwErrCode
  283. );
  284. DWORD WINAPI
  285. TLSAllocateInternetLicense(
  286. IN TLS_HANDLE hHandle,
  287. IN const CHALLENGE_CONTEXT ChallengeContext,
  288. IN const LICENSEREQUEST* pRequest,
  289. IN LPTSTR pszMachineName,
  290. IN LPTSTR pszUserName,
  291. IN const DWORD cbChallengeResponse,
  292. IN const PBYTE pbChallengeResponse,
  293. OUT PDWORD pcbLicense,
  294. OUT PBYTE* ppbLicense,
  295. IN OUT PDWORD pdwErrCode
  296. );
  297. DWORD WINAPI
  298. TLSReturnInternetLicense(
  299. IN TLS_HANDLE hHandle,
  300. IN const DWORD cbLicense,
  301. IN const PBYTE pbLicense,
  302. OUT PDWORD pdwErrCode
  303. );
  304. DWORD WINAPI
  305. TLSAllocateInternetLicenseEx(
  306. IN TLS_HANDLE hHandle,
  307. IN const CHALLENGE_CONTEXT ChallengeContext,
  308. IN const LICENSEREQUEST* pRequest,
  309. IN LPTSTR pszMachineName,
  310. IN LPTSTR pszUserName,
  311. IN const DWORD cbChallengeResponse,
  312. IN const PBYTE pbChallengeResponse,
  313. OUT PTLSInternetLicense pInternetLicense,
  314. OUT PDWORD pdwErrCode
  315. );
  316. DWORD WINAPI
  317. TLSReturnInternetLicenseEx(
  318. IN TLS_HANDLE hHandle,
  319. IN const LICENSEREQUEST* pRequest,
  320. IN const ULARGE_INTEGER* pulSerialNumber,
  321. IN const DWORD dwQuantity,
  322. OUT PDWORD pdwErrCode
  323. );
  324. BOOL
  325. TLSIsBetaNTServer();
  326. BOOL
  327. TLSIsLicenseEnforceEnable();
  328. BOOL
  329. TLSRefreshLicenseServerCache(
  330. DWORD dwTimeOut
  331. );
  332. DWORD WINAPI
  333. TLSGenerateCustomerCert(
  334. IN TLS_HANDLE hHandle,
  335. DWORD dwCertEncodingType,
  336. DWORD dwNameAttrCount,
  337. CERT_RDN_ATTR rgNameAttr[],
  338. DWORD *pcbCert,
  339. BYTE **ppbCert,
  340. DWORD *pdwErrCode
  341. );
  342. #ifdef __cplusplus
  343. }
  344. #endif
  345. #endif