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.

171 lines
4.7 KiB

  1. //+-----------------------------------------------------------------------
  2. //
  3. // File: kerbsupp.h
  4. //
  5. // Contents: prototypes for kerberos support routines
  6. //
  7. //
  8. // History:
  9. //
  10. //------------------------------------------------------------------------
  11. #ifndef _INC_KERBSUPP_
  12. #define _INC_KERBSUPP_
  13. #include <intkerb.h>
  14. #include <tickets.h>
  15. #include <crypto.h>
  16. #include <samrpc.h>
  17. //
  18. // Global time constants
  19. //
  20. const TimeStamp tsInfinity = {0xFFFFFFFF, 0x7FFFFFFF};
  21. const TimeStamp tsZero = {0, 0};
  22. const LONG lInfinity = 0x7FFFFFFF;
  23. // Prototypes
  24. #ifdef __cplusplus
  25. class CAuthenticatorList;
  26. class CLogonAccount;
  27. //
  28. // Contains domain account policies that are required for checking logon
  29. // restrictions.
  30. //
  31. typedef struct _LogonPolicies {
  32. TimeStamp MaxPasswordAge;
  33. } LogonPolicies, *PLogonPolicies;
  34. SECURITY_STATUS NTAPI
  35. KerbCheckTicket(IN PKerbTicket pktTicket,
  36. IN PEncryptedData pedAuth,
  37. IN const KerbKey& kKey,
  38. IN OUT CAuthenticatorList& alAuthenList,
  39. IN const TimeStamp& tsSkew,
  40. IN const PWCHAR pwzServiceName,
  41. OUT PKerbInternalTicket pkitTicket,
  42. OUT PKerbInternalAuthenticator pkiaAuth,
  43. OUT PKerbKey pkSessionKey );
  44. SECURITY_STATUS NTAPI
  45. CheckLogonRestrictions( IN SAMPR_HANDLE UserHandle,
  46. IN const TimeStamp& tsNow,
  47. IN const SECURITY_STRING& sMachineName,
  48. IN PLogonPolicies LogonData,
  49. OUT PULONG pcLogonSeconds );
  50. #endif // ifdef __cplusplus
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54. SECURITY_STATUS NTAPI
  55. KerbPackTicket( PKerbInternalTicket pkitTicket,
  56. PKerbKey pkKey,
  57. ULONG dwEncrType,
  58. PKerbTicket * ppktTicket);
  59. SECURITY_STATUS NTAPI
  60. KerbUnpackTicket(PKerbTicket, PKerbKey, PKerbInternalTicket);
  61. SECURITY_STATUS NTAPI
  62. KerbMakeKey(PKerbKey);
  63. SECURITY_STATUS NTAPI
  64. KerbRandomFill(PUCHAR, ULONG);
  65. SECURITY_STATUS NTAPI
  66. KerbCreateAuthenticator(IN PKerbKey pkKey,
  67. IN DWORD dwEncrType,
  68. IN DWORD dwSeq,
  69. IN PUNICODE_STRING ClientName,
  70. IN PUNICODE_STRING ClientDomainName,
  71. IN PTimeStamp ptsTime,
  72. IN PKerbKey pkSubKey,
  73. IN OUT PULONG pcbAuthenIn,
  74. OUT PEncryptedData* ppedAuthenticator );
  75. SECURITY_STATUS NTAPI
  76. KerbUnpackAuthenticator(PKerbInternalTicket, PEncryptedData, PKerbInternalAuthenticator);
  77. SECURITY_STATUS NTAPI
  78. KerbPackKDCReply(PKerbKDCReply, PKerbKey, ULONG, PEncryptedData *);
  79. SECURITY_STATUS NTAPI
  80. KerbUnpackKDCReply(PEncryptedData, PKerbKey, PKerbKDCReply);
  81. SECURITY_STATUS NTAPI
  82. KerbFreeTicket( PKerbInternalTicket pkitTicket );
  83. SECURITY_STATUS NTAPI
  84. KerbFreeAuthenticator( PKerbInternalAuthenticator pkiaAuth );
  85. SECURITY_STATUS NTAPI
  86. KerbFreeKDCReply( PKerbKDCReply pkrReply );
  87. void NTAPI
  88. KerbHashPassword(PSECURITY_STRING, PKerbKey);
  89. SECURITY_STATUS NTAPI
  90. KIEncryptData(PEncryptedData, ULONG, ULONG, PKerbKey);
  91. SECURITY_STATUS NTAPI
  92. KIDecryptData(PEncryptedData, PKerbKey);
  93. void * KerbSafeAlloc(unsigned long);
  94. void KerbSafeFree(void *);
  95. typedef struct _KerbScatterBlock {
  96. ULONG cbData;
  97. PUCHAR pbData;
  98. } KerbScatterBlock, * PKerbScatterBlock;
  99. #ifdef __CRYPTDLL_H__
  100. SECURITY_STATUS NTAPI
  101. KICheckSum( PUCHAR pbData,
  102. ULONG cbData,
  103. PCheckSumFunction pcsfSum,
  104. PCheckSum pcsCheckSum);
  105. SECURITY_STATUS NTAPI
  106. KICheckSumVerify( PUCHAR pbBuffer,
  107. ULONG cbBuffer,
  108. PCheckSum pcsCheck);
  109. SECURITY_STATUS NTAPI
  110. KIScatterEncrypt( PUCHAR pbHeader,
  111. ULONG cBlocks,
  112. PKerbScatterBlock psbList,
  113. PCryptoSystem pcsCrypt,
  114. PCheckSumFunction pcsfSum,
  115. PKerbKey pkKey);
  116. SECURITY_STATUS NTAPI
  117. KIScatterDecrypt( PUCHAR pbHeader,
  118. ULONG cBlocks,
  119. PKerbScatterBlock psbList,
  120. PCryptoSystem pcsCrypt,
  121. PCheckSumFunction pcsfSum,
  122. PKerbKey pkKey);
  123. #endif // using CRYPTDLL.h defines
  124. #ifdef __cplusplus
  125. } // extern "C"
  126. #endif
  127. #endif // _INC_KERBSUPP_