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.

159 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 2001 Microsoft Corporation
  3. All rights reserved
  4. Module Name:
  5. krbutils.hxx
  6. Abstract:
  7. utils
  8. Author:
  9. Larry Zhu (LZhu) December 1, 2001 Created
  10. Environment:
  11. User Mode -Win32
  12. Revision History:
  13. --*/
  14. #ifndef KRB_UTILS_HXX
  15. #define KRB_UTILS_HXX
  16. #include <krb5.h>
  17. #include <krb5p.h>
  18. #include <kerberr.h>
  19. #include <kerbcomm.h>
  20. VOID
  21. KerbFreeRealm(
  22. IN PKERB_REALM pRealm
  23. );
  24. VOID
  25. KerbFreePrincipalName(
  26. IN PKERB_PRINCIPAL_NAME pName
  27. );
  28. VOID
  29. KerbFreeData(
  30. IN ULONG PduValue,
  31. IN PVOID pData
  32. );
  33. EXTERN_C VOID ASN1CALL KRB5_Module_Startup(VOID);
  34. KERBERR
  35. KerbInitAsn(
  36. IN OUT ASN1encoding_t * pEnc,
  37. IN OUT ASN1decoding_t * pDec
  38. );
  39. VOID
  40. KerbTermAsn(
  41. IN ASN1encoding_t pEnc,
  42. IN ASN1decoding_t pDec
  43. );
  44. KERBERR
  45. KerbEncryptDataEx(
  46. OUT PKERB_ENCRYPTED_DATA pEncryptedData,
  47. IN ULONG cbDataSize,
  48. IN PUCHAR Data,
  49. IN ULONG KeyVersion,
  50. IN ULONG UsageFlags,
  51. IN PKERB_ENCRYPTION_KEY pKey
  52. );
  53. KERBERR
  54. KerbAllocateEncryptionBuffer(
  55. IN ULONG EncryptionType,
  56. IN ULONG cbBufferSize,
  57. OUT PUINT pcbEncryptionBufferSize,
  58. OUT PBYTE* pEncryptionBuffer
  59. );
  60. KERBERR
  61. KerbAllocateEncryptionBufferWrapper(
  62. IN ULONG EncryptionType,
  63. IN ULONG cbBufferSize,
  64. OUT ULONG* pcbEncryptionBufferSize,
  65. OUT PBYTE* pEncryptionBuffer
  66. );
  67. KERBERR
  68. KerbGetEncryptionOverhead(
  69. IN ULONG Algorithm,
  70. OUT PULONG pcbOverhead,
  71. OUT OPTIONAL PULONG pcbBlockSize
  72. );
  73. KERBERR NTAPI
  74. KerbPackData(
  75. IN PVOID Data,
  76. IN ULONG PduValue,
  77. OUT PULONG pcbDataSize,
  78. OUT PUCHAR * MarshalledData
  79. );
  80. KERBERR
  81. KerbConvertUnicodeStringToRealm(
  82. OUT PKERB_REALM pRealm,
  83. IN PUNICODE_STRING pString
  84. );
  85. KERBERR
  86. KerbUnicodeStringToKerbString(
  87. OUT PSTRING pKerbString,
  88. IN PUNICODE_STRING pString
  89. );
  90. KERBERR
  91. KerbConvertKdcNameToPrincipalName(
  92. OUT PKERB_PRINCIPAL_NAME pPrincipalName,
  93. IN PKERB_INTERNAL_NAME pKdcName
  94. );
  95. ULONG
  96. KerbConvertUlongToFlagUlong(
  97. IN ULONG Flag
  98. );
  99. VOID
  100. KerbConvertLargeIntToGeneralizedTime(
  101. OUT PKERB_TIME pClientTime,
  102. OUT OPTIONAL INT* pClientUsec,
  103. IN PTimeStamp pTimeStamp
  104. );
  105. NTSTATUS
  106. KerbMapKerbError(
  107. IN KERBERR KerbError
  108. );
  109. KERBERR NTAPI
  110. KerbUnpackData(
  111. IN PUCHAR pData,
  112. IN ULONG cbDataSize,
  113. IN ULONG PduValue,
  114. OUT PVOID * pDecodedData
  115. );
  116. PSTR
  117. KerbAllocUtf8StrFromUnicodeString(
  118. IN PUNICODE_STRING pUnicodeString
  119. );
  120. EXTERN_C
  121. NTSTATUS NTAPI
  122. CDLocateCSystem(
  123. ULONG EncryptionType,
  124. PCRYPTO_SYSTEM* pCryptoSystem
  125. );
  126. #endif // #ifndef KRB_UTILS_HXX