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.

133 lines
2.9 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (c) Microsoft Corporation 1992 - 1996
  6. //
  7. // File: kerbcred.h
  8. //
  9. // Contents: structures for kerberos primary and supplemental credentials
  10. //
  11. //
  12. // History: 20-Aug-1996 MikeSw Created
  13. //
  14. //------------------------------------------------------------------------
  15. #ifndef __KERBCRED_H__
  16. #define __KERBCRED_H__
  17. //
  18. // Kerberos primary credentials store keys suitable for different
  19. // encryption types.
  20. //
  21. #ifndef _KRB5_Module_H_
  22. typedef struct _KERB_RPC_OCTET_STRING {
  23. unsigned long length;
  24. #ifdef MIDL_PASS
  25. [size_is(length)]
  26. #endif // MIDL_PASS
  27. unsigned char *value;
  28. } KERB_RPC_OCTET_STRING;
  29. typedef struct _KERB_ENCRYPTION_KEY {
  30. long keytype;
  31. KERB_RPC_OCTET_STRING keyvalue;
  32. } KERB_ENCRYPTION_KEY;
  33. #endif // _KRB5_Module_H_
  34. typedef struct _KERB_KEY_DATA {
  35. UNICODE_STRING Salt;
  36. KERB_ENCRYPTION_KEY Key;
  37. } KERB_KEY_DATA, *PKERB_KEY_DATA;
  38. typedef struct _KERB_STORED_CREDENTIAL {
  39. USHORT Revision;
  40. USHORT Flags;
  41. USHORT CredentialCount;
  42. USHORT OldCredentialCount;
  43. UNICODE_STRING DefaultSalt;
  44. #ifdef MIDL_PASS
  45. [size_is(CredentialCount + OldCredentialCount)]
  46. KERB_KEY_DATA Credentials[*];
  47. #else
  48. KERB_KEY_DATA Credentials[ANYSIZE_ARRAY];
  49. #endif // MIDL_PASS
  50. } KERB_STORED_CREDENTIAL, *PKERB_STORED_CREDENTIAL;
  51. #define KERB_PRIMARY_CRED_OWF_ONLY 2
  52. #define KERB_PRIMARY_CRED_REVISION 3
  53. //
  54. // Flags for setting account keys
  55. //
  56. #define KERB_SET_KEYS_REPLACE 0x1
  57. //
  58. // KERB_STORED_CREDENTIALS are stored in the DS (blob), so
  59. // they've got to be stored in 32 bit format, for W2k and
  60. // 32bit DC compatibility. 7/6/2000 - TS
  61. //
  62. #define KERB_KEY_DATA32_SIZE 20
  63. #define KERB_STORED_CREDENTIAL32_SIZE 16
  64. #pragma pack(4)
  65. typedef struct _KERB_ENCRYPTION_KEY32 {
  66. LONG keytype;
  67. ULONG keyvaluelength; // KERB_RPC_OCTET_STRING32
  68. ULONG keyvaluevalue;
  69. } KERB_ENCRYPTION_KEY32;
  70. typedef struct _KERB_KEY_DATA32 {
  71. UNICODE_STRING32 Salt;
  72. KERB_ENCRYPTION_KEY32 Key; // KERB_ENCRYPTION_KEY32
  73. } KERB_KEY_DATA32, *PKERB_KEY_DATA32;
  74. typedef struct _KERB_STORED_CREDENTIAL32 {
  75. USHORT Revision;
  76. USHORT Flags;
  77. USHORT CredentialCount;
  78. USHORT OldCredentialCount;
  79. UNICODE_STRING32 DefaultSalt;
  80. #ifdef MIDL_PASS
  81. [size_is(CredentialCount + OldCredentialCount)]
  82. KERB_KEY_DATA32 Credentials[*]; // KERB_KEY_DATA32
  83. #else
  84. KERB_KEY_DATA32 Credentials[ANYSIZE_ARRAY];
  85. #endif // MIDL_PASS
  86. } KERB_STORED_CREDENTIAL32, *PKERB_STORED_CREDENTIAL32;
  87. #pragma pack()
  88. #ifdef _WIN64
  89. NTSTATUS
  90. KdcPack32BitStoredCredential(
  91. IN PKERB_STORED_CREDENTIAL Cred64,
  92. OUT PKERB_STORED_CREDENTIAL32 * ppCred32,
  93. OUT PULONG pCredSize
  94. );
  95. NTSTATUS
  96. KdcUnpack32BitStoredCredential(
  97. IN PKERB_STORED_CREDENTIAL32 Cred32,
  98. IN OUT PKERB_STORED_CREDENTIAL * ppCred64,
  99. IN OUT PULONG CredLength
  100. );
  101. #endif // WIN64
  102. #endif // __KERBCRED_H__