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.

119 lines
2.7 KiB

  1. /*++
  2. Copyright (c) 1997-2001 Microsoft Corporation
  3. Module Name:
  4. ah.h
  5. Abstract:
  6. Contains ESP specific structures
  7. Author:
  8. Sanjay Anand (SanjayAn) 11-November-1997
  9. ChunYe
  10. Environment:
  11. Kernel mode
  12. Revision History:
  13. --*/
  14. #ifndef _ESP_
  15. #define _ESP_
  16. typedef struct _CONF_STATE_BUFFER {
  17. union {
  18. DESTable desTable;
  19. DES3TABLE des3Table;
  20. };
  21. } CONF_STATE_BUFFER, *PCONF_STATE_BUFFER;
  22. typedef VOID
  23. (*PCONF_ALGO_INIT) (
  24. PVOID pState,
  25. PUCHAR pKey
  26. );
  27. typedef NTSTATUS
  28. (*PCONF_ALGO_ENCRYPT) (
  29. PVOID pState,
  30. PUCHAR pOut,
  31. PUCHAR pIn,
  32. PUCHAR pIV
  33. );
  34. VOID esp_nullinit (PVOID, PUCHAR);
  35. NTSTATUS esp_nullencrypt (PVOID, PUCHAR, PUCHAR, PUCHAR);
  36. NTSTATUS esp_nulldecrypt (PVOID, PUCHAR, PUCHAR, PUCHAR);
  37. VOID esp_desinit (PVOID, PVOID);
  38. NTSTATUS esp_desencrypt (PVOID, PUCHAR, PUCHAR, PUCHAR);
  39. NTSTATUS esp_desdecrypt (PVOID, PUCHAR, PUCHAR, PUCHAR);
  40. VOID esp_3_desinit (PVOID, PVOID);
  41. NTSTATUS esp_3_desencrypt (PVOID, PUCHAR, PUCHAR, PUCHAR);
  42. NTSTATUS esp_3_desdecrypt (PVOID, PUCHAR, PUCHAR, PUCHAR);
  43. //
  44. // Array of function ptrs for the ESP confidentiality algorithms
  45. //
  46. typedef struct _confid_algorithm {
  47. PCONF_ALGO_INIT init; // ptr to init fn for alg.
  48. PCONF_ALGO_ENCRYPT encrypt; // ptr to encrypt fn for alg
  49. PCONF_ALGO_ENCRYPT decrypt; // ptr to encrypt fn for alg
  50. ULONG blocklen; // Length (in u_int8s) of output
  51. // data. MUST be a multiple of 4
  52. } CONFID_ALGO, *PCONFID_ALGO;
  53. #define NUM_CONF_ALGOS (sizeof(conf_algorithms)/sizeof(CONFID_ALGO)-1)
  54. IPRcvBuf *
  55. CopyToRcvBuf(
  56. IN IPRcvBuf *DestBuf,
  57. IN PUCHAR SrcBuf,
  58. IN ULONG Size,
  59. IN PULONG StartOffset
  60. );
  61. NTSTATUS
  62. IPSecEncryptBuffer(
  63. IN PVOID pData,
  64. IN PNDIS_BUFFER *ppNewMdl,
  65. IN PSA_TABLE_ENTRY pSA,
  66. IN PNDIS_BUFFER pPadBuf,
  67. OUT PULONG pPadLen,
  68. IN ULONG PayloadType,
  69. IN ULONG Index,
  70. IN PUCHAR feedback
  71. );
  72. NTSTATUS
  73. IPSecDecryptBuffer(
  74. IN PVOID pData,
  75. IN PSA_TABLE_ENTRY pSA,
  76. OUT PUCHAR pPadLen,
  77. OUT PUCHAR pPayloadType,
  78. IN ULONG Index,
  79. IN ULONG EspOffset
  80. );
  81. NTSTATUS
  82. IPSecFindAndSetMdlByOffset(IN IPRcvBuf *pData,
  83. IN ULONG Offset,
  84. OUT IPRcvBuf **OutMdl,
  85. OUT PUCHAR *savePtr,
  86. OUT PLONG saveLen);
  87. #endif _ESP_