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.

74 lines
2.1 KiB

  1. //
  2. // Microsoft Windows Media Technologies
  3. // Copyright (C) Microsoft Corporation, 1999 - 2001. All rights reserved.
  4. //
  5. #ifndef _CSECURECHANNELCLIENT_H_2AD99356_6FD2_11d3_8497_00C04F79DBC0
  6. #define _CSECURECHANNELCLIENT_H_2AD99356_6FD2_11d3_8497_00C04F79DBC0
  7. #include "wtypes.h"
  8. #ifdef USE_X509
  9. #include "rsa.h"
  10. #endif
  11. #include "des.h"
  12. #ifdef USE_X509
  13. #include "x509cert.h"
  14. #endif
  15. #include "sac.h"
  16. class CSecureChannelClient
  17. {
  18. public:
  19. CSecureChannelClient();
  20. ~CSecureChannelClient();
  21. HRESULT SetCertificate(DWORD dwFlags,
  22. BYTE *pbAppCert,
  23. DWORD dwCertLen,
  24. BYTE *pbAppPVK,
  25. DWORD dwPVKLen);
  26. void SetInterface(IComponentAuthenticate *pComponentAuth);
  27. HRESULT Authenticate(DWORD dwProtocolID);
  28. HRESULT EncryptParam(BYTE *pbData,
  29. DWORD dwDataLen);
  30. HRESULT DecryptParam(BYTE *pbData,
  31. DWORD dwDataLen);
  32. HRESULT MACInit(HMAC *phMAC);
  33. HRESULT MACUpdate(HMAC hMAC,
  34. BYTE *pbData,
  35. DWORD dwDataLen);
  36. HRESULT MACFinal(HMAC hMAC,
  37. BYTE abData[SAC_MAC_LEN]);
  38. HRESULT GetAppSec(DWORD *pdwLocalAppSec, DWORD *pdwRemoteAppSec);
  39. HRESULT SetSessionKey(BYTE *pbSPSessionKey);
  40. HRESULT GetSessionKey(BYTE *pbSPSessionKey);
  41. HRESULT GetRemoteAppCert(BYTE *pbAppCert, DWORD* pdwCertLen);
  42. BOOL fIsAuthenticated();
  43. private:
  44. BOOL m_fAuthenticated;
  45. BYTE *m_pbAppCert;
  46. DWORD m_dwCertLen;
  47. BYTE *m_pbRemoteCert;
  48. DWORD m_dwRemoteCertLen;
  49. BYTE *m_pbAppPVK;
  50. DWORD m_dwPVKLen;
  51. BYTE *m_pbSessionKey;
  52. DWORD m_dwSessionKeyLen;
  53. BOOL m_TableInit;
  54. DESTable m_DesTable;
  55. IComponentAuthenticate *m_pAuth;
  56. DWORD m_dwCertFlags;
  57. #ifdef USE_X509
  58. CX509Cert m_CertObj;
  59. #endif
  60. MACINFO aMacInfo[20];
  61. BYTE m_abMacKey[64];
  62. BOOL m_fMacKeyInit;
  63. CRITICAL_SECTION m_CS;
  64. HRESULT Protocol1();
  65. HRESULT Protocol2();
  66. };
  67. #endif // _CSECURECHANNELCLIENT_H_2AD99356-6FD2-11d3-8497-00C04F79DBC0