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.

162 lines
4.1 KiB

  1. //#--------------------------------------------------------------
  2. //
  3. // File: procaccess.cpp
  4. //
  5. // Synopsis: Implementation of CProcAccess class methods
  6. //
  7. //
  8. // History: 10/20/97 MKarki Created
  9. //
  10. // Copyright (C) 1997-98 Microsoft Corporation
  11. // All rights reserved.
  12. //
  13. //----------------------------------------------------------------
  14. #include "radcommon.h"
  15. #include "procaccess.h"
  16. //+++-------------------------------------------------------------
  17. //
  18. // Function: CProcAccess
  19. //
  20. // Synopsis: This is CProcAccess class constructor
  21. //
  22. // Arguments: NONE
  23. //
  24. // Returns: NONE
  25. //
  26. //
  27. // History: MKarki Created 10/20/97
  28. //
  29. //----------------------------------------------------------------
  30. CProcAccess::CProcAccess()
  31. : m_pCPreValidator (NULL),
  32. m_pCHashMD5 (NULL),
  33. m_pCSendToPipe (NULL)
  34. {
  35. } // end of CProcAccess class constructor
  36. //+++-------------------------------------------------------------
  37. //
  38. // Function: CProcAccess
  39. //
  40. // Synopsis: This is CProcAccess class destructor
  41. //
  42. // Arguments: NONE
  43. //
  44. // Returns: NONE
  45. //
  46. //
  47. // History: MKarki Created 10/20/97
  48. //
  49. //----------------------------------------------------------------
  50. CProcAccess::~CProcAccess()
  51. {
  52. } // end of CProcAccess class destructor
  53. //+++-------------------------------------------------------------
  54. //
  55. // Function: Init
  56. //
  57. // Synopsis: This is CProcAccess class public initialization
  58. // method
  59. //
  60. // Arguments: NONE
  61. //
  62. // Returns: status
  63. //
  64. //
  65. // History: MKarki Created 10/20/97
  66. //
  67. //----------------------------------------------------------------
  68. BOOL
  69. CProcAccess::Init(
  70. CPreValidator *pCPreValidator,
  71. CHashMD5 *pCHashMD5,
  72. CSendToPipe *pCSendToPipe
  73. )
  74. {
  75. _ASSERT ((NULL != pCPreValidator) &&
  76. (NULL != pCHashMD5) &&
  77. (NULL != pCSendToPipe)
  78. );
  79. m_pCPreValidator = pCPreValidator;
  80. m_pCHashMD5 = pCHashMD5;
  81. m_pCSendToPipe = pCSendToPipe;
  82. return (TRUE);
  83. } // end of CProcAccess::Init method
  84. //+++-------------------------------------------------------------
  85. //
  86. // Function: ProcessInPacket
  87. //
  88. // Synopsis: This is CProcAccess class public method
  89. // which carries out the processing of an inbound
  90. // RADIUS packet - for now it just decrypts the
  91. // password
  92. //
  93. // Arguments:
  94. // [in] CPacketRadius*
  95. //
  96. // Returns: HRESULT - status
  97. //
  98. // History: MKarki Created 10/20/97
  99. //
  100. // Called By: CPreProcessor::StartProcessing public method
  101. //
  102. //----------------------------------------------------------------
  103. HRESULT
  104. CProcAccess::ProcessInPacket (
  105. CPacketRadius *pCPacketRadius
  106. )
  107. {
  108. // If the User-Password is present, ...
  109. PIASATTRIBUTE pwd = pCPacketRadius->GetUserPassword();
  110. if (pwd)
  111. {
  112. // ... then decrypt it.
  113. pCPacketRadius->cryptBuffer(
  114. FALSE,
  115. FALSE,
  116. pwd->Value.OctetString.lpValue,
  117. pwd->Value.OctetString.dwLength
  118. );
  119. }
  120. return m_pCSendToPipe->Process (pCPacketRadius);
  121. }
  122. //++--------------------------------------------------------------
  123. //
  124. // Function: ProcessOutPacket
  125. //
  126. // Synopsis: This is CProcAccess class public method
  127. // which carries out the processing of an outbound
  128. // RADIUS packet - for now it just encrypts the
  129. // password
  130. //
  131. //
  132. // Arguments:
  133. // [in] CPacketRadius*
  134. //
  135. // Returns: HRESULT - status
  136. //
  137. //
  138. // History: MKarki Created 10/20/97
  139. //
  140. // Called By:
  141. //
  142. //----------------------------------------------------------------
  143. HRESULT
  144. CProcAccess::ProcessOutPacket (
  145. CPacketRadius *pCPacketRadius
  146. )
  147. {
  148. return (S_OK);
  149. } // end of CProcAccess::ProcessOutPacket method