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.

113 lines
2.8 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1999
  3. Module Name:
  4. mschapp - MS-CHAP Password Change API
  5. Abstract:
  6. These APIs correspond to the MS-CHAP RFC -2433 sections 9 and 10. In order
  7. to develop an MS-CHAP RAS server that works with an NT domain, these APIs
  8. are required.
  9. The MS-CHAP change password APIs are exposed through a DLL that is obtained
  10. from PSS. This DLL is not distributed with NT4.0 or Win2000. It is up to
  11. the ISV to install this with their product. The DLL name is MSCHAPP.DLL.
  12. Only wide (Unicode) versions of these apis will be available. These are the
  13. 2 callable APIs:
  14. * MSChapSrvChangePassword
  15. * MsChapSrvChangePassword2
  16. Author:
  17. Doug Barlow (dbarlow) 10/12/1999
  18. Remarks:
  19. Per original definition by John Brezak
  20. Notes:
  21. ?Notes?
  22. --*/
  23. #ifndef _MSCHAPP_H_
  24. #define _MSCHAPP_H_
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. //
  29. // The following definitions are copied from the crypt.h internal header
  30. // file. The definitions are duplicated here to simplify linkages.
  31. //
  32. #ifndef _NTCRYPT_
  33. #define CYPHER_BLOCK_LENGTH 8
  34. typedef struct _CYPHER_BLOCK {
  35. CHAR data[CYPHER_BLOCK_LENGTH];
  36. } CYPHER_BLOCK;
  37. typedef struct _LM_OWF_PASSWORD {
  38. CYPHER_BLOCK data[2];
  39. } LM_OWF_PASSWORD;
  40. typedef LM_OWF_PASSWORD * PLM_OWF_PASSWORD;
  41. typedef LM_OWF_PASSWORD NT_OWF_PASSWORD;
  42. typedef NT_OWF_PASSWORD * PNT_OWF_PASSWORD;
  43. //#endif
  44. #define SAM_MAX_PASSWORD_LENGTH (256)
  45. typedef struct _SAMPR_ENCRYPTED_USER_PASSWORD {
  46. UCHAR Buffer[ (SAM_MAX_PASSWORD_LENGTH * 2) + 4 ];
  47. } SAMPR_ENCRYPTED_USER_PASSWORD, *PSAMPR_ENCRYPTED_USER_PASSWORD;
  48. typedef struct _ENCRYPTED_LM_OWF_PASSWORD {
  49. CYPHER_BLOCK data[2];
  50. } ENCRYPTED_LM_OWF_PASSWORD;
  51. typedef ENCRYPTED_LM_OWF_PASSWORD * PENCRYPTED_LM_OWF_PASSWORD;
  52. typedef ENCRYPTED_LM_OWF_PASSWORD ENCRYPTED_NT_OWF_PASSWORD;
  53. typedef ENCRYPTED_NT_OWF_PASSWORD * PENCRYPTED_NT_OWF_PASSWORD;
  54. #endif
  55. //
  56. // Change a password.
  57. //
  58. extern NTSTATUS WINAPI
  59. MSChapSrvChangePassword(
  60. IN LPWSTR ServerName,
  61. IN LPWSTR UserName,
  62. IN BOOLEAN LmOldPresent,
  63. IN PLM_OWF_PASSWORD LmOldOwfPassword,
  64. IN PLM_OWF_PASSWORD LmNewOwfPassword,
  65. IN PNT_OWF_PASSWORD NtOldOwfPassword,
  66. IN PNT_OWF_PASSWORD NtNewOwfPassword);
  67. //
  68. // Change a password using mutual encryption.
  69. //
  70. extern NTSTATUS WINAPI
  71. MSChapSrvChangePassword2(
  72. IN LPWSTR ServerName,
  73. IN LPWSTR UserName,
  74. IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldNt,
  75. IN PENCRYPTED_NT_OWF_PASSWORD OldNtOwfPasswordEncryptedWithNewNt,
  76. IN BOOLEAN LmPresent,
  77. IN PSAMPR_ENCRYPTED_USER_PASSWORD NewPasswordEncryptedWithOldLm,
  78. IN PENCRYPTED_LM_OWF_PASSWORD OldLmOwfPasswordEncryptedWithNewLmOrNt);
  79. #ifdef __cplusplus
  80. }
  81. #endif
  82. #endif // _MSCHAPP_H_