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.

51 lines
938 B

  1. #ifndef _AUTHENTICATION_H_
  2. #define _AUTHENTICATION_H_
  3. class CAuthentication
  4. {
  5. public:
  6. CAuthentication();
  7. ~CAuthentication();
  8. static CAuthentication* GetAuthentication();
  9. static PSTR GetMD5Result(PCSTR pszClearText);
  10. static PSTR GetMD5Result(PSTR pszChallengeInfo, PSTR pszPassword);
  11. static PSTR GetHMACMD5Result(PSTR pszChallengeInfo, PSTR pszPassword);
  12. private:
  13. static PSTR GetMD5Key(PSTR pszChallengeInfo, PSTR pszPassword);
  14. static CAuthentication* m_spAuthentication;
  15. };
  16. inline
  17. CAuthentication::CAuthentication()
  18. {
  19. // Make sure that the singleton object is not instantiated multiple times.
  20. _ASSERT(NULL == m_spAuthentication);
  21. m_spAuthentication = this;
  22. }
  23. inline
  24. CAuthentication::~CAuthentication()
  25. {
  26. m_spAuthentication = NULL;
  27. }
  28. inline CAuthentication*
  29. CAuthentication::GetAuthentication()
  30. {
  31. return m_spAuthentication;
  32. }
  33. #endif // _AUTHENTICATION_H_