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.

157 lines
4.3 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_REVCHECK_END_CERT 0x01000000 // for schannel use only
  37. #define SCH_FLAG_REVCHECK_CHAIN 0x02000000 // for schannel use only
  38. #define SCH_FLAG_REVCHECK_CHAIN_EXCLUDE_ROOT 0x04000000 // for schannel use only
  39. #define SCH_FLAG_IGNORE_NO_REVOCATION_CHECK 0x08000000 // for schannel use only
  40. #define SCH_FLAG_IGNORE_REVOCATION_OFFLINE 0x10000000 // for schannel use only
  41. #define SCH_FLAG_MAPPER_CALLED 0x40000000 // for schannel use only
  42. #define SCH_FLAG_SYSTEM_MAPPER 0x80000000 // for schannel use only
  43. // pCredential and pAuthority are both CAPI2 Cert Contexts.
  44. #define X509_ASN_CHAIN 0x00000001
  45. struct _MAPPER_VTABLE;
  46. typedef struct _HMAPPER
  47. {
  48. struct _MAPPER_VTABLE * m_vtable;
  49. DWORD m_dwMapperVersion;
  50. DWORD m_dwFlags;
  51. PVOID m_Reserved1; // For schannel use only
  52. } HMAPPER, *PHMAPPER;
  53. typedef DWORD_PTR HLOCATOR, *PHLOCATOR;
  54. typedef LONG (WINAPI FAR *REF_MAPPER_FN)(
  55. HMAPPER *phMapper // in
  56. );
  57. typedef LONG (WINAPI FAR *DEREF_MAPPER_FN)(
  58. HMAPPER *phMapper // in
  59. );
  60. typedef DWORD (WINAPI FAR * GET_ISSUER_LIST_FN)(
  61. HMAPPER *phMapper , // in
  62. VOID * Reserved, // in
  63. BYTE * pIssuerList, // out
  64. DWORD * pcbIssuerList // out
  65. );
  66. typedef DWORD (WINAPI FAR * GET_CHALLENGE_FN)(
  67. HMAPPER *phMapper , // in
  68. BYTE * pAuthenticatorId, // in
  69. DWORD cbAuthenticatorId, // in
  70. BYTE * pChallenge, // out
  71. DWORD * pcbChallenge // out
  72. );
  73. typedef DWORD (WINAPI FAR * MAP_CREDENTIAL_FN)(
  74. HMAPPER *phMapper, // in
  75. DWORD dwCredentialType, // in
  76. VOID const *pCredential, // in
  77. VOID const *pAuthority, // in
  78. HLOCATOR * phLocator // out
  79. );
  80. typedef DWORD (WINAPI FAR * CLOSE_LOCATOR_FN)(
  81. HMAPPER *phMapper,
  82. HLOCATOR hLocator //in
  83. );
  84. typedef DWORD (WINAPI FAR * GET_ACCESS_TOKEN_FN)(
  85. HMAPPER *phMapper,
  86. HLOCATOR hLocator, // in
  87. HANDLE * phToken // out
  88. );
  89. typedef DWORD (WINAPI FAR * QUERY_MAPPED_CREDENTIAL_ATTRIBUTES_FN) (
  90. HMAPPER * phMapper,
  91. HLOCATOR hLocator,
  92. ULONG ulAttribute,
  93. PVOID pBuffer,
  94. DWORD * pcbBuffer);
  95. typedef struct _MAPPER_VTABLE {
  96. REF_MAPPER_FN ReferenceMapper;
  97. DEREF_MAPPER_FN DeReferenceMapper;
  98. GET_ISSUER_LIST_FN GetIssuerList;
  99. GET_CHALLENGE_FN GetChallenge;
  100. MAP_CREDENTIAL_FN MapCredential;
  101. GET_ACCESS_TOKEN_FN GetAccessToken;
  102. CLOSE_LOCATOR_FN CloseLocator;
  103. QUERY_MAPPED_CREDENTIAL_ATTRIBUTES_FN QueryMappedCredentialAttributes;
  104. } MAPPER_VTABLE, *PMAPPER_VTABLE;
  105. //
  106. // SSL_LOOKUP_EXTERNAL_CERT_MESSAGE call package structures.
  107. //
  108. typedef struct _SSL_EXTERNAL_CERT_LOGON_REQ {
  109. ULONG MessageType ;
  110. ULONG Length ;
  111. ULONG CredentialType ;
  112. PVOID Credential ;
  113. ULONG Flags;
  114. } SSL_EXTERNAL_CERT_LOGON_REQ, * PSSL_EXTERNAL_CERT_LOGON_REQ ;
  115. typedef struct _SSL_EXTERNAL_CERT_LOGON_RESP {
  116. ULONG MessageType ;
  117. ULONG Length ;
  118. HANDLE UserToken ;
  119. ULONG Flags ;
  120. } SSL_EXTERNAL_CERT_LOGON_RESP, * PSSL_EXTERNAL_CERT_LOGON_RESP ;
  121. #ifdef __cplusplus__
  122. }
  123. #endif //__cplusplus__
  124. #endif // __CERTMAP_H__