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.

86 lines
2.2 KiB

  1. /*-----------------------------------------------------------------------------
  2. * Copyright (C) Microsoft Corporation, 1995 - 1996.
  3. * All rights reserved.
  4. *
  5. * Owner :ramas
  6. * Date :5/03/97
  7. * description : Main Crypto functions for TLS1
  8. *----------------------------------------------------------------------------*/
  9. #ifndef _TLS1KEY_H_
  10. #define _TLS1KEY_H_
  11. SP_STATUS
  12. SPBuildTls1FinalFinish(PSPContext pContext, PSPBuffer pBuffer, BOOL fClient);
  13. SP_STATUS
  14. Tls1ComputeMac(
  15. PSPContext pContext,
  16. BOOL fReadMac,
  17. PSPBuffer pClean,
  18. CHAR cContentType,
  19. PBYTE pbMac,
  20. DWORD cbMac);
  21. void
  22. Tls1BuildMasterKeys(
  23. PSPContext pContext,
  24. PUCHAR pbPreMaster,
  25. DWORD cbPreMaster
  26. );
  27. SP_STATUS
  28. Tls1MakeMasterKeyBlock(PSPContext pContext);
  29. SP_STATUS
  30. Tls1MakeWriteSessionKeys(PSPContext pContext);
  31. SP_STATUS
  32. Tls1MakeReadSessionKeys(PSPContext pContext);
  33. #define TLS1_LABEL_SERVER_WRITE_KEY "server write key"
  34. #define TLS1_LABEL_CLIENT_WRITE_KEY "client write key"
  35. #define CB_TLS1_WRITEKEY 16
  36. #define TLS1_LABEL_MASTERSECRET "master secret"
  37. #define CB_TLS1_MASTERSECRET 13
  38. #define TLS1_LABEL_KEYEXPANSION "key expansion"
  39. #define CB_TLS1_KEYEXPANSION 13
  40. #define TLS1_LABEL_IVBLOCK "IV block"
  41. #define CB_TLS1_IVBLOCK 8
  42. #define TLS1_LABEL_CLIENTFINISHED "client finished"
  43. #define TLS1_LABEL_SERVERFINISHED "server finished"
  44. #define CB_TLS1_LABEL_FINISHED 15
  45. #define CB_TLS1_VERIFYDATA 12
  46. #define TLS1_LABEL_EAP_KEYS "client EAP encryption"
  47. #define CB_TLS1_LABEL_EAP_KEYS 21
  48. #define CBMD5DIGEST 16
  49. #define CBSHADIGEST 20
  50. #define CBBLOCKSIZE 64 //same for MD5 and SHA
  51. #define CHIPAD 0x36
  52. #define CHOPAD 0x5c
  53. static VOID
  54. ComputeTls1ExportIV(
  55. PSPContext pContext,
  56. BOOL fClientWriteIV,
  57. PBYTE pbIV,
  58. PDWORD pcbIV);
  59. BOOL PRF(
  60. PBYTE pbSecret,
  61. DWORD cbSecret,
  62. PBYTE pbLabel,
  63. DWORD cbLabel,
  64. PBYTE pbSeed,
  65. DWORD cbSeed,
  66. PBYTE pbKeyOut, //Buffer to copy the result...
  67. DWORD cbKeyOut //# of bytes of key length they want as output.
  68. );
  69. #endif //_TLS1KEY_H_