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.

89 lines
2.9 KiB

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