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.

163 lines
3.7 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. secinit.h
  5. Abstract:
  6. Contains prototypes for indirected security functions
  7. Author:
  8. Sophia Chung (sophiac) 7-Feb-1996
  9. Revision History:
  10. --*/
  11. #if !defined(_SECINIT_)
  12. #define _SECINIT_
  13. #if defined(__cplusplus)
  14. extern "C" {
  15. #endif
  16. #include <sspi.h>
  17. #if defined(__cplusplus)
  18. }
  19. #endif
  20. extern CCritSec InitializationSecLock;
  21. extern PSecurityFunctionTable GlobalSecFuncTable;
  22. extern WIN_VERIFY_TRUST_FN pWinVerifyTrust;
  23. extern WT_HELPER_PROV_DATA_FROM_STATE_DATA_FN pWTHelperProvDataFromStateData;
  24. extern HCERTSTORE g_hMyCertStore;
  25. #define g_EnumerateSecurityPackages \
  26. (*(GlobalSecFuncTable->EnumerateSecurityPackagesA))
  27. #define g_AcquireCredentialsHandle \
  28. (*(GlobalSecFuncTable->AcquireCredentialsHandleA))
  29. #define g_FreeCredentialsHandle \
  30. (*(GlobalSecFuncTable->FreeCredentialHandle))
  31. #define g_InitializeSecurityContext \
  32. (*(GlobalSecFuncTable->InitializeSecurityContextA))
  33. #define g_DeleteSecurityContext \
  34. (*(GlobalSecFuncTable->DeleteSecurityContext))
  35. #define g_QueryContextAttributes \
  36. (*(GlobalSecFuncTable->QueryContextAttributesA))
  37. #define g_FreeContextBuffer \
  38. (*(GlobalSecFuncTable->FreeContextBuffer))
  39. #define g_SealMessage \
  40. (*((SEAL_MESSAGE_FN)GlobalSecFuncTable->Reserved3))
  41. #define g_UnsealMessage \
  42. (*((UNSEAL_MESSAGE_FN)GlobalSecFuncTable->Reserved4))
  43. LONG WINAPI WinVerifySecureChannel(HWND hwnd, WINTRUST_DATA *pWTD);
  44. // Don't use WinVerifyTrust directly to verify secure channel connections.
  45. // Use the wininet wrapper WinVerifySecureChannel instead.
  46. #define g_WinVerifyTrust \
  47. pWinVerifyTrust
  48. typedef PSecurityFunctionTable (APIENTRY *INITSECURITYINTERFACE) (VOID);
  49. #define CRYPT_INSTALL_DEFAULT_CONTEXT_NAME "CryptInstallDefaultContext"
  50. typedef BOOL
  51. (WINAPI * CRYPT_INSTALL_DEFAULT_CONTEXT_FN)
  52. (
  53. IN HCRYPTPROV hCryptProv,
  54. IN DWORD dwDefaultType,
  55. IN const void *pvDefaultPara,
  56. IN DWORD dwFlags,
  57. IN void *pvReserved,
  58. OUT HCRYPTDEFAULTCONTEXT *phDefaultContext
  59. );
  60. #define CRYPT_UNINSTALL_DEFAULT_CONTEXT_NAME "CryptUninstallDefaultContext"
  61. typedef BOOL
  62. (WINAPI * CRYPT_UNINSTALL_DEFAULT_CONTEXT_FN)
  63. (
  64. HCRYPTDEFAULTCONTEXT hDefaultContext,
  65. IN DWORD dwFlags,
  66. IN void *pvReserved
  67. );
  68. typedef PCCERT_CHAIN_CONTEXT
  69. (WINAPI *CERT_FIND_CHAIN_IN_STORE_FN)
  70. (
  71. IN HCERTSTORE hCertStore,
  72. IN DWORD dwCertEncodingType,
  73. IN DWORD dwFindFlags,
  74. IN DWORD dwFindType,
  75. IN const void *pvFindPara,
  76. IN PCCERT_CHAIN_CONTEXT pPrevChainContext
  77. );
  78. #define CERT_FIND_CHAIN_IN_STORE_NAME "CertFindChainInStore"
  79. typedef VOID
  80. (WINAPI *CERT_FREE_CERTIFICATE_CHAIN_FN)
  81. (
  82. IN PCCERT_CHAIN_CONTEXT pChainContext
  83. );
  84. #define CERT_FREE_CERTIFICATE_CHAIN_NAME "CertFreeCertificateChain"
  85. extern CRYPT_INSTALL_DEFAULT_CONTEXT_FN g_CryptInstallDefaultContext;
  86. extern CRYPT_UNINSTALL_DEFAULT_CONTEXT_FN g_CryptUninstallDefaultContext;
  87. extern CERT_FIND_CHAIN_IN_STORE_FN g_CertFindChainInStore;
  88. extern CERT_FREE_CERTIFICATE_CHAIN_FN g_CertFreeCertificateChain;
  89. extern HCRYPTPROV GlobalFortezzaCryptProv;
  90. #define LOCK_SECURITY() (InitializationSecLock.Lock())
  91. #define UNLOCK_SECURITY() (InitializationSecLock.Unlock())
  92. //
  93. // prototypes
  94. //
  95. BOOL
  96. SecurityInitialize(
  97. VOID
  98. );
  99. VOID
  100. SecurityTerminate(
  101. VOID
  102. );
  103. DWORD
  104. LoadSecurity(
  105. VOID
  106. );
  107. VOID
  108. UnloadSecurity(
  109. VOID
  110. );
  111. DWORD
  112. LoadWinTrust(
  113. VOID
  114. );
  115. BOOL
  116. IsFortezzaInstalled(
  117. VOID
  118. );
  119. #endif // _SECINIT_