Source code of Windows XP (NT5)
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.

159 lines
3.5 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows Terminal Server
  4. // Copyright (C) Microsoft Corporation, 1989 - 1998.
  5. //
  6. // File: lscsp.h
  7. //
  8. // Contents: Header file for License Server CSP routine
  9. //
  10. //----------------------------------------------------------------------------
  11. #ifndef __LSCSP__
  12. #define __LSCSP__
  13. #include "license.h"
  14. //-----------------------------------------------------------------------------
  15. //
  16. // The types of CSP data that can be retrieved and stored
  17. //
  18. // LsCspInfo_Certificate - The proprietory certificate
  19. // LsCspInfo_X509Certificate - The X509 certificate
  20. // LsCspInfo_PublicKey - The public key in the proprietory certificate
  21. // LsCspInfo_PrivateKey - The private key corresponding to the proprietory certificate
  22. // LsCspInfo_X509CertPrivateKey - The private key corresponding to the X509 certificate
  23. // LsCspInfo_X509CertID - The X509 certificate ID
  24. //
  25. //-----------------------------------------------------------------------------
  26. typedef enum {
  27. LsCspInfo_Certificate,
  28. LsCspInfo_X509Certificate,
  29. LsCspInfo_PublicKey,
  30. LsCspInfo_PrivateKey,
  31. LsCspInfo_X509CertPrivateKey,
  32. LsCspInfo_X509CertID
  33. } LSCSPINFO, FAR *LPLSCSPINFO;
  34. //-----------------------------------------------------------------------------
  35. //
  36. // Terminal server registry keys and values
  37. //
  38. //-----------------------------------------------------------------------------
  39. #define HYDRA_CERT_REG_KEY \
  40. "System\\CurrentControlSet\\Services\\TermService\\Parameters"
  41. #define HYDRA_CERTIFICATE_VALUE "Certificate"
  42. #define HYDRA_X509_CERTIFICATE "X509 Certificate"
  43. #define HYDRA_X509_CERT_ID "X509 Certificate ID"
  44. // L$ means only readable from the local machine
  45. #define PUBLIC_KEY_NAME \
  46. L"L$HYDRAENCKEY_3a6c88f4-80a7-4b9e-971b-c81aeaa4f943"
  47. #define PRIVATE_KEY_NAME \
  48. L"L$HYDRAENCKEY_28ada6da-d622-11d1-9cb9-00c04fb16e75"
  49. #define X509_CERT_PRIVATE_KEY_NAME \
  50. L"L$HYDRAENCKEY_dd2d98db-2316-11d2-b414-00c04fa30cc4"
  51. #define X509_CERT_PUBLIC_KEY_NAME \
  52. L"L$HYDRAENCPUBLICKEY_dd2d98db-2316-11d2-b414-00c04fa30cc4"
  53. //-----------------------------------------------------------------------------
  54. //
  55. // Function Prototypes
  56. //
  57. //-----------------------------------------------------------------------------
  58. #ifdef __cplusplus
  59. extern "C" {
  60. #endif
  61. LICENSE_STATUS
  62. LsCsp_GetServerData(
  63. LSCSPINFO Info,
  64. LPBYTE pBlob,
  65. LPDWORD pdwBlobLen
  66. );
  67. LICENSE_STATUS
  68. LsCsp_SetServerData(
  69. LSCSPINFO Info,
  70. LPBYTE pBlob,
  71. DWORD dwBlobLen
  72. );
  73. LICENSE_STATUS
  74. LsCsp_NukeServerData(
  75. LSCSPINFO Info );
  76. BOOL
  77. LsCsp_DecryptEnvelopedData(
  78. CERT_TYPE CertType,
  79. LPBYTE pbEnvelopeData,
  80. DWORD cbEnvelopeData,
  81. LPBYTE pbData,
  82. LPDWORD pcbData
  83. );
  84. BOOL
  85. LsCsp_EncryptEnvelopedData(
  86. LPBYTE pbData,
  87. DWORD cbData,
  88. LPBYTE pbEnvelopedData,
  89. LPDWORD pcbEnvelopedData);
  90. LICENSE_STATUS
  91. LsCsp_Initialize( void );
  92. VOID
  93. LsCsp_Exit( void );
  94. BOOL
  95. LsCsp_UseBuiltInCert( void );
  96. LICENSE_STATUS
  97. LsCsp_InstallX509Certificate( LPVOID lpParam );
  98. LICENSE_STATUS
  99. LsCsp_EncryptHwid(
  100. PHWID pHwid,
  101. LPBYTE pbEncryptedHwid,
  102. LPDWORD pcbEncryptedHwid );
  103. LICENSE_STATUS
  104. LsCsp_StoreSecret(
  105. TCHAR * ptszKeyName,
  106. BYTE * pbKey,
  107. DWORD cbKey );
  108. LICENSE_STATUS
  109. LsCsp_RetrieveSecret(
  110. TCHAR * ptszKeyName,
  111. PBYTE pbKey,
  112. DWORD * pcbKey );
  113. #ifdef __cplusplus
  114. }
  115. #endif
  116. #endif