home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / kerberos.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  4KB  |  146 lines

  1. //+-----------------------------------------------------------------------
  2. //
  3. // File:        KERBEROS.H
  4. //
  5. // Contents:    Public Kerberos Security Package structures for use
  6. //              with APIs from SECURITY.H
  7. //
  8. //
  9. // History:     26 Feb 92,  RichardW    Compiled from other files
  10. //
  11. //------------------------------------------------------------------------
  12.  
  13. #ifndef __KERBEROS_H__
  14. #define __KERBEROS_H__
  15. #include <ntmsv1_0.h>
  16. #include <kerbcon.h>
  17.  
  18. #define MICROSOFT_KERBEROS_NAME_A   "Kerberos"
  19. #define MICROSOFT_KERBEROS_NAME_W   L"Kerberos"
  20. #ifdef WIN32_CHICAGO
  21. #define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_A
  22. #else
  23. #define MICROSOFT_KERBEROS_NAME MICROSOFT_KERBEROS_NAME_W
  24. #endif
  25.  
  26.  
  27. typedef struct _KERB_INIT_CONTEXT_DATA {
  28.     TimeStamp StartTime;            // Start time
  29.     TimeStamp EndTime;              // End time
  30.     TimeStamp RenewUntilTime;       // Renew until time
  31.     ULONG TicketOptions;            // From krb5.h
  32.     ULONG RequestOptions;           // Options on what to return
  33. } KERB_INIT_CONTEXT_DATA, *PKERB_INIT_CONTEXT_DATA;
  34.  
  35. #define KERB_INIT_RETURN_TICKET             0x1     // return raw ticket
  36. #define KERB_INIT_RETURN_MIT_AP_REQ         0x2     // return MIT style AP request
  37.  
  38.  
  39.  
  40.  
  41. typedef enum _KERB_LOGON_SUBMIT_TYPE {
  42.     KerbInteractiveLogon = 2
  43. } KERB_LOGON_SUBMIT_TYPE, *PKERB_LOGON_SUBMIT_TYPE;
  44.  
  45.  
  46. typedef struct _KERB_INTERACTIVE_LOGON {
  47.     KERB_LOGON_SUBMIT_TYPE MessageType;
  48.     UNICODE_STRING LogonDomainName;
  49.     UNICODE_STRING UserName;
  50.     UNICODE_STRING Password;
  51.     UNICODE_STRING SubAuthData;
  52.     ULONG Flags;
  53. } KERB_INTERACTIVE_LOGON, *PKERB_INTERACTIVE_LOGON;
  54.  
  55.  
  56. #define KERB_LOGON_SUBUATH               0x1
  57. #define KERB_LOGON_EMAIL_NAMES           0x2
  58. #define KERB_LOGON_UPDATE_STATISTICS     0x4
  59.  
  60. //
  61. // Use the same profile structure as MSV1_0
  62. //
  63.  
  64. typedef MSV1_0_INTERACTIVE_PROFILE KERB_INTERACTIVE_PROFILE, *PKERB_INTERACTIVE_PROFILE;
  65.  
  66.  
  67.  
  68. typedef enum _KERB_PROTOCOL_MESSAGE_TYPE {
  69.     KerbDebugRequestMessage = 0,
  70.     KerbQueryTicketCacheMessage,
  71.     KerbChangeMachinePasswordMessage,
  72.     KerbVerifyPacMessage,
  73.     KerbRetrieveTicketMessage
  74. } KERB_PROTOCOL_MESSAGE_TYPE, *PKERB_PROTOCOL_MESSAGE_TYPE;
  75.  
  76. //
  77. // Structure for a debuggin requequest
  78. //
  79.  
  80. #define KERB_DEBUG_REQ_BREAKPOINT       0x1
  81. #define KERB_DEBUG_REQ_CALL_PACK        0x2
  82. #define KERB_DEBUG_REQ_DATAGRAM         0x3
  83.  
  84. typedef struct _KERB_DEBUG_REQUEST {
  85.     KERB_PROTOCOL_MESSAGE_TYPE MessageType;
  86.     ULONG DebugRequest;
  87. } KERB_DEBUG_REQUEST, *PKERB_DEBUG_REQUEST;
  88.  
  89. //
  90. // Used both for retrieving tickets and for querying ticket cache
  91. //
  92.  
  93. typedef struct _KERB_QUERY_TKT_CACHE_REQUEST {
  94.     KERB_PROTOCOL_MESSAGE_TYPE MessageType;
  95.     LUID LogonId;
  96. } KERB_QUERY_TKT_CACHE_REQUEST, *PKERB_QUERY_TKT_CACHE_REQUEST;
  97.  
  98. typedef struct _KERB_TICKET_CACHE_INFO {
  99.     UNICODE_STRING ServerName;
  100.     TimeStamp EndTime;
  101.     TimeStamp RenewTime;
  102. } KERB_TICKET_CACHE_INFO, *PKERB_TICKET_CACHE_INFO;
  103.  
  104. typedef struct _KERB_QUERY_TKT_CACHE_RESPONSE {
  105.     KERB_PROTOCOL_MESSAGE_TYPE MessageType;
  106.     ULONG CountOfTickets;
  107.     KERB_TICKET_CACHE_INFO Tickets[ANYSIZE_ARRAY];
  108. } KERB_QUERY_TKT_CACHE_RESPONSE, *PKERB_QUERY_TKT_CACHE_RESPONSE;
  109.  
  110.  
  111.  
  112. //
  113. // This must match NT_OWF_PASSWORD_LENGTH
  114. //
  115.  
  116. #define KERB_MACH_PWD_LENGTH 16
  117.  
  118. typedef struct _KERB_CHANGE_MACH_PWD_REQUEST {
  119.     KERB_PROTOCOL_MESSAGE_TYPE MessageType;
  120.     UCHAR NewPassword[KERB_MACH_PWD_LENGTH];
  121. } KERB_CHANGE_MACH_PWD_REQUEST, *PKERB_CHANGE_MACH_PWD_REQUEST;
  122.  
  123. //
  124. // These messages are used by the kerberos package to verify that the PAC in a
  125. // ticket is valid. It is remoted from a workstation to a DC in the workstation's
  126. // domain. On failure there is no response message. On success there may be no
  127. // message or the same message may be used to send back a PAC updated with
  128. // local groups from the domain controller. The checksum is placed in the
  129. // final buffer first, followed by the signature.
  130. //
  131.  
  132. #include <pshpack1.h>
  133. typedef struct _KERB_VERIFY_PAC_REQUEST {
  134.     KERB_PROTOCOL_MESSAGE_TYPE MessageType;
  135.     ULONG ChecksumLength;
  136.     ULONG SignatureType;
  137.     ULONG SignatureLength;
  138.     UCHAR ChecksumAndSignature[ANYSIZE_ARRAY];
  139. } KERB_VERIFY_PAC_REQUEST, *PKERB_VERIFY_PAC_REQUEST;
  140. #include <poppack.h>
  141.  
  142.  
  143. #endif  // __KERBEROS_H__
  144.  
  145.  
  146.