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.

141 lines
3.6 KiB

  1. //****************************************************************************
  2. //
  3. // Microsoft Remote Access Service
  4. //
  5. // Copyright (C) Microsoft Corporation
  6. //
  7. // Description: This file contains all structure and constant definitions for
  8. // the subauthentication package used by ARAP, MD5 and SFM
  9. //
  10. //****************************************************************************
  11. #ifndef _RASSFMSUBAUTH_
  12. #define _RASSFMSUBAUTH_
  13. //
  14. // Get id for our subauthentication package - MSV1_0_SUBAUTHENTICATION_DLL_RAS
  15. //
  16. #include <ntmsv1_0.h>
  17. //
  18. // Defines for those protocols that need subauthentication at the PDC
  19. //
  20. enum RAS_SUBAUTH_PROTO
  21. {
  22. RAS_SUBAUTH_PROTO_ARAP = 1,
  23. RAS_SUBAUTH_PROTO_MD5CHAP = 2,
  24. RAS_SUBAUTH_PROTO_MD5CHAP_EX = 3,
  25. RAS_SUBAUTH_PROTO_UNKNOWN = 99
  26. };
  27. typedef enum RAS_SUBAUTH_PROTO RAS_SUBAUTH_PROTO;
  28. typedef struct _RAS_SUBAUTH_INFO
  29. {
  30. RAS_SUBAUTH_PROTO ProtocolType;
  31. DWORD DataSize;
  32. UCHAR Data[1];
  33. } RAS_SUBAUTH_INFO, *PRAS_SUBAUTH_INFO;
  34. #define CHAP_RESPONSE_SIZE 16
  35. //
  36. // The RAS_SUBAUTH_INFO 'Data' for ProtocolType RAS_SUBAUTH_PROTO_MD5CHAP.
  37. //
  38. typedef struct
  39. _MD5CHAP_SUBAUTH_INFO
  40. {
  41. // The packet sequence number of the challenge sent to peer. PPP CHAP
  42. // includes this in the hashed information.
  43. //
  44. UCHAR uchChallengeId;
  45. // The challenge sent to peer.
  46. //
  47. UCHAR uchChallenge[ 16 ];
  48. // The challenge response received from peer.
  49. //
  50. UCHAR uchResponse[CHAP_RESPONSE_SIZE];
  51. }
  52. MD5CHAP_SUBAUTH_INFO;
  53. //
  54. // The RAS_SUBAUTH_INFO 'Data' for ProtocolType RAS_SUBAUTH_PROTO_MD5CHAP_EX.
  55. //
  56. typedef struct _MD5CHAP_EX_SUBAUTH_INFO
  57. {
  58. // The packet sequence number of the challenge sent to peer. PPP CHAP
  59. // includes this in the hashed information.
  60. //
  61. UCHAR uchChallengeId;
  62. // The challenge response received from peer.
  63. //
  64. UCHAR uchResponse[CHAP_RESPONSE_SIZE];
  65. // The challenge sent to peer.
  66. //
  67. UCHAR uchChallenge[ 1 ];
  68. } MD5CHAP_EX_SUBAUTH_INFO;
  69. #define MAX_ARAP_USER_NAMELEN 32
  70. #define MAX_MAC_PWD_LEN 8
  71. #define ARAP_SUBAUTH_LOGON_PKT 1
  72. #define ARAP_SUBAUTH_CHGPWD_PKT 2
  73. #define SFM_SUBAUTH_CHGPWD_PKT 3
  74. #define SFM_SUBAUTH_LOGON_PKT 4
  75. #define SFM_2WAY_SUBAUTH_LOGON_PKT ARAP_SUBAUTH_LOGON_PKT
  76. typedef struct _ARAP_CHALLENGE
  77. {
  78. DWORD high;
  79. DWORD low;
  80. } ARAP_CHALLENGE, *PARAP_CHALLENGE;
  81. typedef struct _ARAP_SUBAUTH_REQ
  82. {
  83. DWORD PacketType;
  84. union
  85. {
  86. struct
  87. {
  88. DWORD fGuestLogon;
  89. DWORD NTChallenge1;
  90. DWORD NTChallenge2;
  91. DWORD MacResponse1;
  92. DWORD MacResponse2;
  93. DWORD MacChallenge1;
  94. DWORD MacChallenge2;
  95. DWORD NTResponse1;
  96. DWORD NTResponse2;
  97. LARGE_INTEGER PasswdCreateDate;
  98. LARGE_INTEGER PasswdExpireDate;
  99. } Logon;
  100. struct
  101. {
  102. WCHAR UserName[MAX_ARAP_USER_NAMELEN+1];
  103. UCHAR OldMunge[MAX_ARAP_USER_NAMELEN+1];
  104. UCHAR NewMunge[MAX_ARAP_USER_NAMELEN+1];
  105. } ChgPwd;
  106. };
  107. } ARAP_SUBAUTH_REQ, *PARAP_SUBAUTH_REQ;
  108. //
  109. // NOTE: make sure this structure size doesn't exceed 16 because of our
  110. // workaround in using SessionKey of MSV1_0_VALIDATION_INFO structure
  111. //
  112. typedef struct _ARAP_SUBAUTH_RESP
  113. {
  114. DWORD Result;
  115. ARAP_CHALLENGE Response;
  116. } ARAP_SUBAUTH_RESP, *PARAP_SUBAUTH_RESP;
  117. #endif