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.

93 lines
2.3 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. //
  35. // Zero key size bytes at the location designated by our caller.
  36. //
  37. memset(Key, 0, NULL_KEY_SIZE);
  38. }
  39. //* NullInit - prepare to process data.
  40. //
  41. // We don't need to maintain any context in order to do nothing, so
  42. // this isn't very exciting.
  43. //
  44. void
  45. NullInit(
  46. void *Context, // Context info maintained across operations.
  47. uchar *Key) // Keying information.
  48. {
  49. //
  50. // Just to test the code a bit, zero the context field.
  51. //
  52. memset(Context, 0, NULL_CONTEXT_SIZE);
  53. }
  54. //* NullOp - Process a chunk of data.
  55. //
  56. // NullOp is a No-Op.
  57. //
  58. void
  59. NullOp(
  60. void *Context, // Context info maintained across operations.
  61. uchar *Key, // Keying information.
  62. uchar *Data, // Data to process.
  63. uint Len) // Amount of above in bytes.
  64. {
  65. }
  66. //* NullFinal - close off processing current data and return result.
  67. //
  68. // Our result is always zero.
  69. //
  70. void
  71. NullFinal(
  72. void *Context, // Context info maintained across operations.
  73. uchar *Key, // Keying information.
  74. uchar *Result) // Where to put result of this process.
  75. {
  76. //
  77. // Zero result size bytes at the location designated by our caller.
  78. //
  79. memset(Result, 0, NULL_RESULT_SIZE);
  80. }