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.

100 lines
2.6 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1997
  6. //
  7. // File: mitutil.h
  8. //
  9. // Contents: Prototypes & structures for MIT KDC support
  10. //
  11. //
  12. // History: 4-March-1997 Created MikeSw
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __MITUTIL_H__
  16. #define __MITUTIL_H__
  17. typedef struct _KERB_MIT_SERVER_LIST {
  18. LONG ServerCount;
  19. LONG LastServerUsed;
  20. PUNICODE_STRING ServerNames;
  21. } KERB_MIT_SERVER_LIST, *PKERB_MIT_SERVER_LIST;
  22. typedef struct _KERB_MIT_REALM {
  23. KERBEROS_LIST_ENTRY Next;
  24. ULONG Flags;
  25. ULONG ApReqChecksumType;
  26. ULONG PreAuthType;
  27. ULONG RealmNameCount;
  28. UNICODE_STRING RealmName;
  29. PUNICODE_STRING AlternateRealmNames;
  30. KERB_MIT_SERVER_LIST KdcNames;
  31. KERB_MIT_SERVER_LIST KpasswdNames;
  32. TimeStamp LastLookup;
  33. } KERB_MIT_REALM, *PKERB_MIT_REALM;
  34. #define KERB_MIT_REALM_SEND_ADDRESS 0x0001
  35. #define KERB_MIT_REALM_TCP_SUPPORTED 0x0002
  36. #define KERB_MIT_REALM_TRUSTED_FOR_DELEGATION 0x0004
  37. #define KERB_MIT_REALM_DOES_CANONICALIZE 0x0008
  38. // DNS lookup flags
  39. #define KERB_MIT_REALM_KDC_LOOKUP 0x00010000
  40. #define KERB_MIT_REALM_KPWD_LOOKUP 0x00020000
  41. #define DNS_LOOKUP_TIMEOUT 120
  42. #define DNS_TCP "_tcp."
  43. #define DNS_UDP "_udp."
  44. #define DNS_KERBEROS "_kerberos."
  45. #define DNS_KPASSWD "_kpasswd."
  46. #define DNS_MSKDC "_kerberos._tcp.dc._msdcs."
  47. #define DNS_MAX_PREFIX 128 // udp + kerberos char count
  48. #define MAX_SRV_RECORDS 50 // maximum server records
  49. #define KERB_DOMAINS_KEY TEXT("System\\CurrentControlSet\\Control\\Lsa\\Kerberos\\Domains")
  50. #define KERB_DOMAIN_KDC_NAMES_VALUE TEXT("KdcNames")
  51. #define KERB_DOMAIN_KPASSWD_NAMES_VALUE TEXT("KpasswdNames")
  52. #define KERB_DOMAIN_ALT_NAMES_VALUE TEXT("AlternateDomainNames")
  53. #define KERB_DOMAIN_FLAGS_VALUE TEXT("RealmFlags")
  54. #define KERB_DOMAIN_AP_REQ_CSUM_VALUE TEXT("ApReqChecksumType")
  55. #define KERB_DOMAIN_PREAUTH_VALUE TEXT("PreAuthType")
  56. BOOLEAN
  57. KerbLookupMitRealm(
  58. IN PUNICODE_STRING RealmName,
  59. OUT OPTIONAL PKERB_MIT_REALM* MitRealm,
  60. OUT OPTIONAL PBOOLEAN UsedAlternateName
  61. );
  62. NTSTATUS
  63. KerbInitializeMitRealmList(
  64. VOID
  65. );
  66. VOID
  67. KerbUninitializeMitRealmList(
  68. VOID
  69. );
  70. VOID
  71. KerbFreeServerNames(
  72. PKERB_MIT_SERVER_LIST ServerList
  73. );
  74. BOOLEAN
  75. KerbLookupMitRealmWithSrvLookup(
  76. PUNICODE_STRING RealmName,
  77. PKERB_MIT_REALM * MitRealm,
  78. BOOLEAN Kpasswd,
  79. BOOLEAN UseTcp
  80. );
  81. #endif // __MITUTIL_H__