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.

157 lines
4.6 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1996-1999.
  5. //
  6. // File: certmap.h
  7. //
  8. // Contents: Prototypes and structure definitions for the schannel
  9. // certificate mapper.
  10. //
  11. // Functions:
  12. //
  13. // History: 5/29/96 Created
  14. //
  15. //----------------------------------------------------------------------------
  16. #ifndef __CERTMAP_H__
  17. #define __CERTMAP_H__
  18. #if _MSC_VER > 1000
  19. #pragma once
  20. #endif
  21. #define CERT_FAR
  22. #define CERT_API __stdcall
  23. #ifdef __cplusplus__
  24. extern "C"
  25. {
  26. #endif //__cplusplus__
  27. // Schannel call package functions
  28. #define SSL_LOOKUP_CERT_MESSAGE 2
  29. #define SSL_PURGE_CACHE_MESSAGE 3
  30. #define SSL_CACHE_INFO_MESSAGE 4
  31. #define SSL_PERFMON_INFO_MESSAGE 5
  32. #define SSL_LOOKUP_EXTERNAL_CERT_MESSAGE 6
  33. #define MAPPER_INTERFACE_VER 0x00000003
  34. // Flags for use with the m_dwFlags field.
  35. #define SCH_FLAG_DEFAULT_MAPPER 0x00000001
  36. #define SCH_FLAG_NO_VALIDATION 0x00800000 // for schannel use only
  37. #define SCH_FLAG_REVCHECK_END_CERT 0x01000000 // for schannel use only
  38. #define SCH_FLAG_REVCHECK_CHAIN 0x02000000 // for schannel use only
  39. #define SCH_FLAG_REVCHECK_CHAIN_EXCLUDE_ROOT 0x04000000 // for schannel use only
  40. #define SCH_FLAG_IGNORE_NO_REVOCATION_CHECK 0x08000000 // for schannel use only
  41. #define SCH_FLAG_IGNORE_REVOCATION_OFFLINE 0x10000000 // for schannel use only
  42. #define SCH_FLAG_MAPPER_CALLED 0x40000000 // for schannel use only
  43. #define SCH_FLAG_SYSTEM_MAPPER 0x80000000 // for schannel use only
  44. // pCredential and pAuthority are both CAPI2 Cert Contexts.
  45. #define X509_ASN_CHAIN 0x00000001
  46. struct _MAPPER_VTABLE;
  47. typedef struct _HMAPPER
  48. {
  49. struct _MAPPER_VTABLE * m_vtable;
  50. DWORD m_dwMapperVersion;
  51. DWORD m_dwFlags;
  52. PVOID m_Reserved1; // For schannel use only
  53. } HMAPPER, *PHMAPPER;
  54. typedef DWORD_PTR HLOCATOR, *PHLOCATOR;
  55. typedef LONG (WINAPI FAR *REF_MAPPER_FN)(
  56. HMAPPER *phMapper // in
  57. );
  58. typedef LONG (WINAPI FAR *DEREF_MAPPER_FN)(
  59. HMAPPER *phMapper // in
  60. );
  61. typedef DWORD (WINAPI FAR * GET_ISSUER_LIST_FN)(
  62. HMAPPER *phMapper , // in
  63. VOID * Reserved, // in
  64. BYTE * pIssuerList, // out
  65. DWORD * pcbIssuerList // out
  66. );
  67. typedef DWORD (WINAPI FAR * GET_CHALLENGE_FN)(
  68. HMAPPER *phMapper , // in
  69. BYTE * pAuthenticatorId, // in
  70. DWORD cbAuthenticatorId, // in
  71. BYTE * pChallenge, // out
  72. DWORD * pcbChallenge // out
  73. );
  74. typedef DWORD (WINAPI FAR * MAP_CREDENTIAL_FN)(
  75. HMAPPER *phMapper, // in
  76. DWORD dwCredentialType, // in
  77. VOID const *pCredential, // in
  78. VOID const *pAuthority, // in
  79. HLOCATOR * phLocator // out
  80. );
  81. typedef DWORD (WINAPI FAR * CLOSE_LOCATOR_FN)(
  82. HMAPPER *phMapper,
  83. HLOCATOR hLocator //in
  84. );
  85. typedef DWORD (WINAPI FAR * GET_ACCESS_TOKEN_FN)(
  86. HMAPPER *phMapper,
  87. HLOCATOR hLocator, // in
  88. HANDLE * phToken // out
  89. );
  90. typedef DWORD (WINAPI FAR * QUERY_MAPPED_CREDENTIAL_ATTRIBUTES_FN) (
  91. HMAPPER * phMapper,
  92. HLOCATOR hLocator,
  93. ULONG ulAttribute,
  94. PVOID pBuffer,
  95. DWORD * pcbBuffer);
  96. typedef struct _MAPPER_VTABLE {
  97. REF_MAPPER_FN ReferenceMapper;
  98. DEREF_MAPPER_FN DeReferenceMapper;
  99. GET_ISSUER_LIST_FN GetIssuerList;
  100. GET_CHALLENGE_FN GetChallenge;
  101. MAP_CREDENTIAL_FN MapCredential;
  102. GET_ACCESS_TOKEN_FN GetAccessToken;
  103. CLOSE_LOCATOR_FN CloseLocator;
  104. QUERY_MAPPED_CREDENTIAL_ATTRIBUTES_FN QueryMappedCredentialAttributes;
  105. } MAPPER_VTABLE, *PMAPPER_VTABLE;
  106. //
  107. // SSL_LOOKUP_EXTERNAL_CERT_MESSAGE call package structures.
  108. //
  109. typedef struct _SSL_EXTERNAL_CERT_LOGON_REQ {
  110. ULONG MessageType ;
  111. ULONG Length ;
  112. ULONG CredentialType ;
  113. PVOID Credential ;
  114. ULONG Flags;
  115. } SSL_EXTERNAL_CERT_LOGON_REQ, * PSSL_EXTERNAL_CERT_LOGON_REQ ;
  116. typedef struct _SSL_EXTERNAL_CERT_LOGON_RESP {
  117. ULONG MessageType ;
  118. ULONG Length ;
  119. HANDLE UserToken ;
  120. ULONG Flags ;
  121. } SSL_EXTERNAL_CERT_LOGON_RESP, * PSSL_EXTERNAL_CERT_LOGON_RESP ;
  122. #ifdef __cplusplus__
  123. }
  124. #endif //__cplusplus__
  125. #endif // __CERTMAP_H__