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.

101 lines
2.8 KiB

  1. // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil -*- (for GNU Emacs)
  2. //
  3. // Copyright (c) 1985-2000 Microsoft Corporation
  4. //
  5. // This file is part of the Microsoft Research IPv6 Network Protocol Stack.
  6. // You should have received a copy of the Microsoft End-User License Agreement
  7. // for this software along with this release; see the file "license.txt".
  8. // If not, please see http://www.research.microsoft.com/msripv6/license.htm,
  9. // or write to Microsoft Research, One Microsoft Way, Redmond, WA 98052-6399.
  10. //
  11. // Abstract:
  12. //
  13. // Null authentication algorithm. For test purposes.
  14. //
  15. #include "oscfg.h"
  16. #include "ndis.h"
  17. #include "ip6imp.h"
  18. #include "ip6def.h"
  19. #include "ipsec.h"
  20. #include "security.h"
  21. #include "null.h"
  22. //* NullKeyPrep - preprocess raw keying data into directly usuable form.
  23. //
  24. // This routine is called to convert raw keying information into the most
  25. // convienient form for later processing. For the null algorithm, we just
  26. // return 128 zero bytes.
  27. //
  28. void
  29. NullKeyPrep(
  30. uchar *RawKey, // Raw keying information.
  31. uint RawKeySize, // Size of above in bytes.
  32. uchar *Key) // Resulting 128 bytes of preprocessed key info.
  33. {
  34. UNREFERENCED_PARAMETER(RawKey);
  35. UNREFERENCED_PARAMETER(RawKeySize);
  36. //
  37. // Zero key size bytes at the location designated by our caller.
  38. //
  39. memset(Key, 0, NULL_KEY_SIZE);
  40. }
  41. //* NullInit - prepare to process data.
  42. //
  43. // We don't need to maintain any context in order to do nothing, so
  44. // this isn't very exciting.
  45. //
  46. void
  47. NullInit(
  48. void *Context, // Context info maintained across operations.
  49. uchar *Key) // Keying information.
  50. {
  51. UNREFERENCED_PARAMETER(Key);
  52. //
  53. // Just to test the code a bit, zero the context field.
  54. //
  55. memset(Context, 0, NULL_CONTEXT_SIZE);
  56. }
  57. //* NullOp - Process a chunk of data.
  58. //
  59. // NullOp is a No-Op.
  60. //
  61. void
  62. NullOp(
  63. void *Context, // Context info maintained across operations.
  64. uchar *Key, // Keying information.
  65. uchar *Data, // Data to process.
  66. uint Len) // Amount of above in bytes.
  67. {
  68. UNREFERENCED_PARAMETER(Context);
  69. UNREFERENCED_PARAMETER(Key);
  70. UNREFERENCED_PARAMETER(Data);
  71. UNREFERENCED_PARAMETER(Len);
  72. }
  73. //* NullFinal - close off processing current data and return result.
  74. //
  75. // Our result is always zero.
  76. //
  77. void
  78. NullFinal(
  79. void *Context, // Context info maintained across operations.
  80. uchar *Key, // Keying information.
  81. uchar *Result) // Where to put result of this process.
  82. {
  83. UNREFERENCED_PARAMETER(Context);
  84. UNREFERENCED_PARAMETER(Key);
  85. //
  86. // Zero result size bytes at the location designated by our caller.
  87. //
  88. memset(Result, 0, NULL_RESULT_SIZE);
  89. }