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.

136 lines
3.7 KiB

  1. /////////////////////////////////////////////////////////////////////////////
  2. // FILE : ssl3.h //
  3. // DESCRIPTION : //
  4. // AUTHOR : //
  5. // HISTORY : //
  6. // Dec 2 1996 jeffspel Create //
  7. // //
  8. // Copyright (C) 1993 Microsoft Corporation All Rights Reserved //
  9. /////////////////////////////////////////////////////////////////////////////
  10. #ifndef __SSL3_H__
  11. #define __SSL3_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #define EXPORTABLE_KEYLEN 5
  16. #define EXPORTABLE_SALTLEN 11
  17. #define RC_KEYLEN 16
  18. #define MAX_PREMASTER_LEN 48
  19. #define MAX_RANDOM_LEN 256
  20. #define TLS_MASTER_LEN 48
  21. // definition of a Secure Channel hash structure
  22. typedef struct _SCH_KeyData
  23. {
  24. BYTE rgbPremaster[MAX_PREMASTER_LEN];
  25. DWORD cbPremaster;
  26. BYTE rgbClientRandom[MAX_RANDOM_LEN];
  27. DWORD cbClientRandom;
  28. BYTE rgbServerRandom[MAX_RANDOM_LEN];
  29. DWORD cbServerRandom;
  30. BYTE *pbCertData;
  31. DWORD cbCertData;
  32. BYTE rgbClearData[MAX_RANDOM_LEN];
  33. DWORD cbClearData;
  34. ALG_ID EncAlgid;
  35. ALG_ID HashAlgid;
  36. DWORD cbEnc;
  37. DWORD cbEncMac;
  38. DWORD cbHash;
  39. DWORD cbIV;
  40. BOOL fFinished;
  41. BOOL dwFlags;
  42. } SCH_KEY, *PSCH_KEY;
  43. // definition of a Secure Channel hash structure
  44. typedef struct _SCH_HashData
  45. {
  46. ALG_ID ProtocolAlgid;
  47. ALG_ID EncAlgid;
  48. ALG_ID HashAlgid;
  49. DWORD cbEnc;
  50. DWORD cbEncMac;
  51. DWORD cbHash;
  52. DWORD cbIV;
  53. BYTE rgbClientRandom[MAX_RANDOM_LEN];
  54. DWORD cbClientRandom;
  55. BYTE rgbServerRandom[MAX_RANDOM_LEN];
  56. DWORD cbServerRandom;
  57. BYTE *pbCertData;
  58. DWORD cbCertData;
  59. BYTE rgbClearData[MAX_RANDOM_LEN];
  60. DWORD cbClearData;
  61. BYTE rgbFinal[MAX_RANDOM_LEN];
  62. DWORD cbFinal;
  63. BOOL dwFlags;
  64. } SCH_HASH, *PSCH_HASH;
  65. // definition of a TLS1 PRF hash structure
  66. typedef struct _PRF_HashData
  67. {
  68. BYTE rgbLabel[MAX_RANDOM_LEN];
  69. DWORD cbLabel;
  70. BYTE rgbSeed[MAX_RANDOM_LEN];
  71. DWORD cbSeed;
  72. BYTE rgbMasterKey[TLS_MASTER_LEN];
  73. } PRF_HASH;
  74. // strings for deriving PCT1 keys
  75. #define PCT1_C_WRT "cw"
  76. #define PCT1_C_WRT_LEN 2
  77. #define PCT1_S_WRT "svw"
  78. #define PCT1_S_WRT_LEN 3
  79. #define PCT1_C_MAC "cmac"
  80. #define PCT1_C_MAC_LEN 4
  81. #define PCT1_S_MAC "svmac"
  82. #define PCT1_S_MAC_LEN 5
  83. void FreeSChHash(
  84. PSCH_HASH pSChHash
  85. );
  86. void FreeSChKey(
  87. PSCH_KEY pSChKey
  88. );
  89. extern DWORD
  90. SCHSetKeyParam(
  91. IN PNTAGUserList pTmpUser,
  92. IN OUT PNTAGKeyList pKey,
  93. IN DWORD dwParam,
  94. IN CONST BYTE *pbData);
  95. extern DWORD
  96. SChGenMasterKey(
  97. PNTAGKeyList pKey,
  98. PSCH_HASH pSChHash);
  99. extern DWORD
  100. SecureChannelDeriveKey(
  101. PNTAGUserList pTmpUser,
  102. PNTAGHashList pHash,
  103. ALG_ID Algid,
  104. DWORD dwFlags,
  105. HCRYPTKEY *phKey);
  106. extern DWORD
  107. SetPRFHashParam(
  108. PRF_HASH *pPRFHash,
  109. DWORD dwParam,
  110. CONST BYTE *pbData);
  111. extern DWORD
  112. CalculatePRF(
  113. PRF_HASH *pPRFHash,
  114. BYTE *pbData,
  115. DWORD *pcbData);
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119. #endif // __SSL3_H__