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.

68 lines
2.0 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. SP_STATUS
  22. Tls1MakeWriteSessionKeys(PSPContext pContext);
  23. SP_STATUS
  24. Tls1MakeReadSessionKeys(PSPContext pContext);
  25. #define TLS1_LABEL_SERVER_WRITE_KEY "server write key"
  26. #define TLS1_LABEL_CLIENT_WRITE_KEY "client write key"
  27. #define CB_TLS1_WRITEKEY 16
  28. #define TLS1_LABEL_MASTERSECRET "master secret"
  29. #define CB_TLS1_MASTERSECRET 13
  30. #define TLS1_LABEL_KEYEXPANSION "key expansion"
  31. #define CB_TLS1_KEYEXPANSION 13
  32. #define TLS1_LABEL_IVBLOCK "IV block"
  33. #define CB_TLS1_IVBLOCK 8
  34. #define TLS1_LABEL_CLIENTFINISHED "client finished"
  35. #define TLS1_LABEL_SERVERFINISHED "server finished"
  36. #define CB_TLS1_LABEL_FINISHED 15
  37. #define CB_TLS1_VERIFYDATA 12
  38. #define TLS1_LABEL_EAP_KEYS "client EAP encryption"
  39. #define CB_TLS1_LABEL_EAP_KEYS 21
  40. #define CBMD5DIGEST 16
  41. #define CBSHADIGEST 20
  42. #define CBBLOCKSIZE 64 //same for MD5 and SHA
  43. #define CHIPAD 0x36
  44. #define CHOPAD 0x5c
  45. BOOL PRF(
  46. PBYTE pbSecret,
  47. DWORD cbSecret,
  48. PBYTE pbLabel,
  49. DWORD cbLabel,
  50. PBYTE pbSeed,
  51. DWORD cbSeed,
  52. PBYTE pbKeyOut, //Buffer to copy the result...
  53. DWORD cbKeyOut //# of bytes of key length they want as output.
  54. );
  55. #endif //_TLS1KEY_H_