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.

82 lines
3.0 KiB

  1. // length of the salt to append to password
  2. #define PASSWORD_SALT_LEN 16
  3. // Primitive functions not shown
  4. #define OLD_HMAC_VERSION 0x01
  5. #define NEW_HMAC_VERSION 0x02
  6. // externally used functions
  7. BOOL FProvEncryptData(
  8. LPCWSTR szUser, // in
  9. LPCWSTR szMasterKey, // in
  10. BYTE rgbPwd[], // in, must be A_SHA_DIGEST_LEN
  11. PBYTE* ppbMyData, // in out
  12. DWORD* pcbMyData); // in out
  13. BOOL FProvDecryptData(
  14. LPCWSTR szUser, // in
  15. LPCWSTR szMasterKey, // in
  16. BYTE rgbPwd[], // in, must be A_SHA_DIGEST_LEN
  17. PBYTE* ppbData, // in out
  18. DWORD* pcbData); // in out
  19. BOOL FCheckPWConfirm(
  20. LPCWSTR szUser, // in
  21. LPCWSTR szMasterKey, // in
  22. BYTE rgbPwd[]); // in
  23. BOOL FPasswordChangeNotify(
  24. LPCWSTR szUser, // in
  25. LPCWSTR szPasswordName,// in
  26. BYTE rgbOldPwd[], // in, must be A_SHA_DIGEST_LEN
  27. DWORD cbOldPwd, // in
  28. BYTE rgbNewPwd[], // in, must be A_SHA_DIGEST_LEN
  29. DWORD cbNewPwd); // in
  30. // performs MAC with location data, making data immovable
  31. BOOL FHMACGeographicallySensitiveData(
  32. LPCWSTR szUser, // in
  33. LPCWSTR szPasswordName, // in
  34. DWORD dwMACVersion, // handle old, new MACs
  35. BYTE rgbPwd[], // in, must be A_SHA_DIGEST_LEN
  36. const GUID* pguidType, // in
  37. const GUID* pguidSubtype, // in
  38. LPCWSTR szItem, // in, may be NULL
  39. PBYTE pbBuf, // in
  40. DWORD cbBuf, // in
  41. BYTE rgbHMAC[]); // out, must be A_SHA_DIGEST_LEN
  42. // given pwd, salt, and ptr to master key buffer,
  43. // decrypts and checks MAC on master key
  44. BOOL FMyDecryptMK(
  45. BYTE rgbSalt[],
  46. DWORD cbSalt,
  47. BYTE rgbPwd[A_SHA_DIGEST_LEN],
  48. BYTE rgbConfirm[A_SHA_DIGEST_LEN],
  49. PBYTE* ppbMK,
  50. DWORD* pcbMK);
  51. BOOL
  52. FMyDecryptMKEx(
  53. BYTE rgbSalt[],
  54. DWORD cbSalt,
  55. BYTE rgbPwd[A_SHA_DIGEST_LEN],
  56. BYTE rgbConfirm[A_SHA_DIGEST_LEN],
  57. PBYTE* ppbMK,
  58. DWORD* pcbMK,
  59. BOOL *pfResetSecurityState
  60. );
  61. // given pwd, salt, and Master Key buffer, MACs and Encrypts Master Key buffer
  62. BOOL FMyEncryptMK(
  63. BYTE rgbSalt[],
  64. DWORD cbSalt,
  65. BYTE rgbPwd[A_SHA_DIGEST_LEN],
  66. BYTE rgbConfirm[A_SHA_DIGEST_LEN],
  67. PBYTE* ppbMK,
  68. DWORD* pcbMK);
  69. // France check
  70. BOOL FIsEncryptionPermitted();