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.

1139 lines
33 KiB

  1. Network Working Group S. Cobb
  2. Informational Memo Microsoft
  3. Revision 1.3 March 1997
  4. Microsoft PPP CHAP Extensions
  5. Status of this Memo
  6. This document has no official Internet Engineering Task Force
  7. status. It is submitted as an example of one vendor's working
  8. solution to several authentication issues not yet standardized by
  9. the Point-to-Point Working Group.
  10. The protocol described is implemented in Microsoft Windows NT 3.5
  11. and 3.51 and in Microsoft Windows95. Differences between the
  12. platforms are noted in the text. This information, plus that in
  13. the references, is believed sufficient to implement an
  14. interoperating peer.
  15. Distribution of this memo is unlimited.
  16. Abstract
  17. The Point-to-Point Protocol (PPP) [1] provides a standard method
  18. for transporting multi-protocol datagrams over point-to-point
  19. links. PPP defines an extensible Link Control Protocol and a
  20. family of Network Control Protocols (NCPs) for establishing and
  21. configuring different network-layer protocols.
  22. This document describes Microsoft's PPP CHAP dialect (MS-CHAP),
  23. which extends the user authentication functionality provided on
  24. Windows networks to remote workstations. MS-CHAP is closely
  25. derived from the PPP Challenge/Handshake Authentication Protocol
  26. described in RFC 1334 [2], which the reader should have at hand.
  27. History
  28. Rev 1.21: (Sect 6) Fix error in implicit challenge description
  29. Rev 1.22: (Sect 7) Fix error in sub-field table ordering
  30. Rev 1.3: (Sect 10) Added hash example section
  31. Cobb [Page 1]
  32. Memo Microsoft PPP CHAP Extensions March 1997
  33. Table Of Contents
  34. 1. Introduction................................................3
  35. 2. LCP Configuration...........................................4
  36. 3. Challenge Packet............................................4
  37. 4. Response Packet.............................................4
  38. 5. Success Packet..............................................8
  39. 6. Failure Packet..............................................8
  40. 7. Change Password Packet (version 1)..........................9
  41. 8. Change Password Packet (version 2).........................12
  42. 9. Negotiation Examples.......................................16
  43. 10. Hash Example...............................................16
  44. REFERENCES.....................................................18
  45. CHAIR'S ADDRESS................................................19
  46. AUTHOR'S ADDRESS...............................................19
  47. Cobb [Page 2]
  48. Memo Microsoft PPP CHAP Extensions March 1997
  49. 1. Introduction
  50. Microsoft created MS-CHAP to authenticate remote Windows
  51. workstations, providing the functionality to which LAN-based users
  52. are accustomed.
  53. The closest fit available in standard PPP is CHAP which is
  54. primarily used for mutual secure authentication between WAN-aware
  55. routers. Unfortunately, CHAP is not widely used in support of
  56. remote workstations where providers commonly require an insecure
  57. text login session in place of PPP authentication protocols. To
  58. date, several remote workstation issues have not been adequately
  59. addressed in CHAP. MS-CHAP addresses these issues and also
  60. integrates the encryption and hashing algorithms used on Windows
  61. networks.
  62. Where possible, MS-CHAP is consistent with standard CHAP, and the
  63. differences are easily modularized. Microsoft implements MS-CHAP
  64. as extensions to it's standard CHAP code base. Briefly,
  65. differences between MS-CHAP and standard CHAP are:
  66. * MS-CHAP is enabled by negotiating CHAP Algorithm 0x80 in LCP
  67. option 3, Authentication Protocol.
  68. * The MS-CHAP Response packet is in a format designed for
  69. compatibility with Microsoft Windows NT 3.5 and 3.51,
  70. Microsoft Windows95, and Microsoft LAN Manager 2.x networking
  71. products. The MS-CHAP format does not require the
  72. authenticator to store a clear or reversibly encrypted
  73. password.
  74. * MS-CHAP provides an authenticator controlled authentication
  75. retry mechanism.
  76. * MS-CHAP provides an authenticator controlled change password
  77. mechanism.
  78. * MS-CHAP defines a set of reason-for-failure codes returned in
  79. the Failure packet Message field.
  80. Cobb [Page 3]
  81. Memo Microsoft PPP CHAP Extensions March 1997
  82. 2. LCP Configuration
  83. The LCP configuration for MS-CHAP is identical to that for
  84. standard CHAP, except that the Algorithm field has value 0x80,
  85. rather than the MD5 value 0x05. Non-MS-CHAP-aware implementations
  86. that correctly implement LCP Config-Rej have no problem dealing
  87. with this non-standard option.
  88. Microsoft currently negotiates authentication only on the
  89. server->workstation configuration. Mutual authentication may be
  90. supported in the future.
  91. 3. Challenge Packet
  92. The MS-CHAP Challenge packet is identical in format to the
  93. standard CHAP Challenge packet.
  94. MS-CHAP authenticators send an 8-octet challenge Value field. It
  95. is not necessary for peers to duplicate Microsoft's algorithm for
  96. selecting the 8-octet value, but the CHAP guidelines on randomness
  97. should be observed.
  98. Microsoft authenticators do not currently provide information in
  99. the Name field. This may change in the future.
  100. 4. Response Packet
  101. The MS-CHAP Response packet is identical in format to the standard
  102. CHAP Response packet. However, the Value field is sub-formatted
  103. differently as follows:
  104. 24 octets: LAN Manager compatible challenge response
  105. 24 octets: Windows NT compatible challenge response
  106. 1 octet : "Use Windows NT compatible challenge response" flag
  107. The LAN Manager compatible challenge response is an encoded
  108. function of the password and the received challenge as output by
  109. the pseudo-code routine LmChallengeResponse below. LAN Manager
  110. passwords are limited to 14 case-insensitive OEM characters.
  111. Cobb [Page 4]
  112. Memo Microsoft PPP CHAP Extensions March 1997
  113. LmChallengeResponse(
  114. IN 8-octet Challenge,
  115. IN 0-to-14-oem-char Password,
  116. OUT 24-octet Response )
  117. {
  118. LmPasswordHash(
  119. Password,
  120. giving PasswordHash )
  121. ChallengeResponse(
  122. Challenge,
  123. PasswordHash,
  124. giving Response )
  125. }
  126. LmPasswordHash(
  127. IN 0-to-14-oem-char Password,
  128. OUT 16-octet PasswordHash )
  129. {
  130. Set UcasePassword to the uppercased Password
  131. Zero pad UcasePassword to 14 characters
  132. DesHash(
  133. 1st 7-octets of UcasePassword,
  134. giving 1st 8-octets of PasswordHash )
  135. DesHash(
  136. 2nd 7-octets of UcasePassword,
  137. giving 2nd 8-octets of PasswordHash )
  138. }
  139. DesHash(
  140. IN 7-octet Clear,
  141. OUT 8-octet Cypher )
  142. {
  143. Make Cypher an irreversibly encrypted form of Clear by
  144. encrypting known text [6] using Clear as the secret key,
  145. that is...
  146. DesEncrypt(
  147. StdText,
  148. Clear,
  149. giving Cypher )
  150. }
  151. Cobb [Page 5]
  152. Memo Microsoft PPP CHAP Extensions March 1997
  153. DesEncrypt(
  154. IN 8-octet Clear,
  155. IN 7-octet Key,
  156. OUT 8-octet Cypher )
  157. {
  158. Use the DES encryption algorithm [3] to encrypt Clear into
  159. Cypher such that Cypher can only be decrypted back to
  160. Clear by providing Key. Note that the DES algorithm takes
  161. as input a 64-bit stream where the 8th, 16th, 24th, etc
  162. bits are parity bits ignored by the encrypting algorithm.
  163. Unless you write your own DES to accept 56-bit input
  164. without parity, you will need to insert the parity bits
  165. yourself.
  166. }
  167. ChallengeResponse(
  168. IN 8-octet Challenge,
  169. IN 16-octet PasswordHash,
  170. OUT 24-octet Response )
  171. {
  172. Set ZPasswordHash to PasswordHash zero padded to 21 octets
  173. DesEncrypt(
  174. Challenge,
  175. 1st 7-octets of ZPasswordHash,
  176. giving 1st 8-octets of Response )
  177. DesEncrypt(
  178. Challenge,
  179. 2nd 7-octets of ZPasswordHash,
  180. giving 2nd 8-octets of Response )
  181. DesEncrypt(
  182. Challenge,
  183. 3rd 7-octets of ZPasswordHash,
  184. giving 3rd 8-octets of Response )
  185. }
  186. The Windows NT compatible challenge response is an encoded
  187. function of the password and the received challenge as output by
  188. the NtChallengeResponse routine below. The Windows NT password is
  189. a string of 0 to (theoretically) 256 case-sensitive Unicode
  190. characters. Current versions of Windows NT limit passwords to 14
  191. characters, mainly for compatibility reasons, though this may
  192. change in the future.
  193. Cobb [Page 6]
  194. Memo Microsoft PPP CHAP Extensions March 1997
  195. NtChallengeResponse(
  196. IN 8-octet Challenge,
  197. IN 0-to-256-unicode-char Password,
  198. OUT 24-octet Response )
  199. {
  200. NtPasswordHash(
  201. Password,
  202. giving PasswordHash )
  203. ChallengeResponse(
  204. Challenge,
  205. PasswordHash,
  206. giving Response )
  207. }
  208. NtPasswordHash(
  209. IN 0-to-256-unicode-char Password,
  210. OUT 16-octet PasswordHash )
  211. {
  212. Use the MD4 algorithm [4] to irreversibly hash Password
  213. into PasswordHash. Only the password is hashed without
  214. including any terminating 0.
  215. }
  216. The "use Windows NT compatible challenge response" flag, if 1,
  217. indicates that the Windows NT response is provided and should be
  218. used in preference to the LAN Manager response. The LAN Manager
  219. response will still be used if the account does not have a Windows
  220. NT password hash, e.g. if the password has not been changed since
  221. the account was uploaded from a LAN Manager 2.x account database.
  222. The LAN Manager response need not be provided (set to 0's) if the
  223. implementation expects all user accounts to be stored only in
  224. fresh Windows NT account databases or ones where all uploaded
  225. passwords have been changed. However, doing so may sacrifice
  226. downward compatibility with non-Windows-NT servers.
  227. If the flag is 0, the Windows NT response is ignored and the LAN
  228. Manager response is used. If the password is LAN Manager
  229. compatible, interoperability may be achieved without providing the
  230. Windows NT challenge response (set to 0's), and providing only the
  231. LAN Manager response. This is what Microsoft Windows95 does,
  232. though this may change in the future. Doing so may sacrifice
  233. interoperability with OEM-specific versions of Windows NT designed
  234. for maximum security in Windows-NT-only networks.
  235. Implementors seeking the broadest possible interoperability are
  236. advised to supply both responses when the password is LAN Manager
  237. compatible. This is what Microsoft Windows NT does.
  238. Cobb [Page 7]
  239. Memo Microsoft PPP CHAP Extensions March 1997
  240. The Name field identifies the authenticatee's user account name.
  241. The Windows NT domain name may prefix the user's account name in
  242. the typical Windows NT format, e.g. "redmond\stevec" where
  243. "redmond" is a Windows NT domain containing the user account
  244. "stevec". If a domain is not provided, the backslash should also
  245. be omitted, e.g. "stevec".
  246. 5. Success Packet
  247. The Success packet is identical in format to the standard CHAP
  248. Success packet.
  249. 6. Failure Packet
  250. The Failure packet is identical in format to the standard CHAP
  251. Failure packet. There is, however, formatted text stored in the
  252. Message field which, contrary to the standard CHAP rules, does
  253. affect the protocol. The Message field format is:
  254. "E=eeeeeeeeee R=r C=cccccccccccccccc V=vvvvvvvvvv"
  255. where
  256. The "eeeeeeeeee" is the decimal error code (need not be 10
  257. digits) corresponding to one of those listed below, though
  258. implementations should deal with codes not on this list
  259. gracefully.
  260. 646 ERROR_RESTRICTED_LOGON_HOURS
  261. 647 ERROR_ACCT_DISABLED
  262. 648 ERROR_PASSWD_EXPIRED
  263. 649 ERROR_NO_DIALIN_PERMISSION
  264. 691 ERROR_AUTHENTICATION_FAILURE
  265. 709 ERROR_CHANGING_PASSWORD
  266. The "r" is a flag set to "1" if a retry is allowed, and "0" if
  267. not. When authenticator sets this flag to "1" it disables
  268. short timeouts, expecting the authenticatee to prompt the user
  269. for new credentials and resubmit the response.
  270. The "cccccccccccccccc" is 16 hex digits representing an ASCII
  271. representation of a new challenge value. This field is
  272. optional. If it is not sent, authenticator expects the
  273. resubmitted response to be calculated based on the previous
  274. challenge value plus decimal 23 in the first octet, i.e. the
  275. one immediately following the Value Size field. Windows95
  276. authenticators may send this field. Windows NT authenticators
  277. do not, but may in the future. Both systems implement
  278. authenticatee support of this field.
  279. Cobb [Page 8]
  280. Memo Microsoft PPP CHAP Extensions March 1997
  281. The "vvvvvvvvvv" is the decimal version code (need not be 10
  282. digits) indicating the MS-CHAP protocol version supported on
  283. the server. Currently, this is interesting only in selecting
  284. a Change Password packet type. If the field is not present
  285. the version should be assumed 1.
  286. Implementations should accept but ignore additional text they do
  287. not recognize.
  288. 7. Change Password Packet (version 1)
  289. The version 1 Change Password packet does not appear in standard
  290. CHAP. It allows the authenticatee to change the password on the
  291. account specified in the previous Response packet. The version 1
  292. Change Password packet should be sent only if the authenticator
  293. reports ERROR_PASSWD_EXPIRED (E=648) in the Message field of the
  294. Failure packet.
  295. This packet type is supported by Windows NT 3.5 and 3.51. It is
  296. not supported by Windows95, though this may change in the future.
  297. See also Change Password Packet (version 2).
  298. The format of this packet is as follows:
  299. 1 octet : Code (=5)
  300. 1 octet : Identifier
  301. 2 octets: Length (=72)
  302. 16 octets: Encrypted LAN Manager Old password Hash
  303. 16 octets: Encrypted LAN Manager New Password Hash
  304. 16 octets: Encrypted Windows NT Old Password Hash
  305. 16 octets: Encrypted Windows NT New Password Hash
  306. 2 octets: Password Length
  307. 2 octets: Flags
  308. Code
  309. 5
  310. Identifier
  311. The Identifier field is one octet and aids in matching
  312. requests and replies. The value is the Identifier of the
  313. received Failure packet to which this packet responds plus 1.
  314. Length
  315. 72
  316. Cobb [Page 9]
  317. Memo Microsoft PPP CHAP Extensions March 1997
  318. Encrypted LAN Manager New Password Hash
  319. Encrypted LAN Manager Old Password Hash
  320. These fields contain the LAN Manager password hash of the new
  321. and old passwords encrypted with an 8-octet key value [6], as
  322. output by the pseudo-code routine LmEncryptedPasswordHash
  323. below.
  324. LmEncryptedPasswordHash(
  325. IN 0-to-14-oem-char Password,
  326. IN 8-octet KeyValue,
  327. OUT 16-octet Cypher )
  328. {
  329. LmPasswordHash(
  330. Password,
  331. giving PasswordHash )
  332. PasswordHashEncryptedWithBlock(
  333. PasswordHash,
  334. KeyValue,
  335. giving Cypher )
  336. }
  337. PasswordHashEncryptedWithBlock(
  338. IN 16-octet PasswordHash,
  339. IN 7-octet Block,
  340. OUT 16-octet Cypher )
  341. {
  342. DesEncrypt(
  343. 1st 8-octets PasswordHash,
  344. 1st 7-octets Block,
  345. giving 1st 8-octets Cypher )
  346. DesEncrypt(
  347. 2nd 8-octets PasswordHash,
  348. 1st 7-octets Block,
  349. giving 2nd 8-octets Cypher )
  350. }
  351. Encrypted Windows NT New Password Hash
  352. Encrypted Windows NT Old Password Hash
  353. These fields contain the Windows NT password hash of the new
  354. and old passwords encrypted with an 8-octet key value [6], as
  355. output by the pseudo-code routine NtEncryptedPasswordHash
  356. below.
  357. Cobb [Page 10]
  358. Memo Microsoft PPP CHAP Extensions March 1997
  359. NtEncryptedPasswordHash(
  360. IN 0-to-14-oem-char Password
  361. IN 8-octet Challenge
  362. OUT 16-octet Cypher )
  363. {
  364. NtPasswordHash(
  365. Password,
  366. giving PasswordHash )
  367. PasswordHashEncryptedWithBlock(
  368. PasswordHash,
  369. Challenge,
  370. giving Cypher )
  371. }
  372. Password Length
  373. The length in octets of the LAN Manager compatible form of the
  374. new password. If this value is less than or equal to 14 it is
  375. assumed that the encrypted LAN Manager password hash fields
  376. are valid. Otherwise, it is assumed these fields are not
  377. valid, in which case the Windows NT compatible passwords must
  378. be provided.
  379. Flags
  380. Bit field of option flags where 0 is the least significant bit
  381. of the 16-bit quantity:
  382. 0 : Set 1 indicates that the encrypted Windows NT
  383. hashed passwords are valid and should be used. If
  384. 0, the Windows NT fields are not used and the LAN
  385. Manager fields must be provided.
  386. For the broadest possible interoperability,
  387. implementations are encouraged to provide both the
  388. Windows NT and LAN Manager fields when the password
  389. is LAN Manager compatible. This is what Windows NT
  390. does.
  391. 1-15 : Reserved, always set 0.
  392. Cobb [Page 11]
  393. Memo Microsoft PPP CHAP Extensions March 1997
  394. 8. Change Password Packet (version 2)
  395. The version 2 Change Password packet does not appear in standard
  396. CHAP. It allows the authenticatee to change the password on the
  397. account specified in the previous Response packet. The version 2
  398. Change Password packet should be sent only if the authenticator
  399. reports ERROR_PASSWD_EXPIRED (E=648) and a version of 2 or more in
  400. the Message field of the Failure packet.
  401. This packet type is supported by Windows NT 3.51. It is not
  402. supported by Windows NT 3.5 or Windows95, though the latter may
  403. change in the future. The version 2 change password packet type
  404. is preferable to the version 1 type and should be offered and
  405. accepted where possible.
  406. The format of this packet is as follows:
  407. 1 octet : Code (=6)
  408. 1 octet : Identifier
  409. 2 octet : Length (=1070)
  410. 516 octets : Password Encrypted with Old NT Hash
  411. 16 octets : Old NT Hash Encrypted with New NT Hash
  412. 516 octets : Password Encrypted with Old LM Hash
  413. 16 octets : Old LM Hash Encrypted With New NT Hash
  414. 24 octets : LAN Manager compatible challenge response
  415. 24 octets : Windows NT compatible challenge response
  416. 2-octet : Flags
  417. Code
  418. 6
  419. Identifier
  420. The Identifier field is one octet and aids in matching
  421. requests and replies. The value is the Identifier of the
  422. received Failure packet to which this packet responds plus 1.
  423. Length
  424. 1118
  425. Password Encrypted with Old NT Hash
  426. This field contains the PWBLOCK form of the new Windows NT
  427. password encrypted with the old Windows NT password hash, as
  428. output by the NewPasswordEncryptedWithOldNtPasswordHash
  429. routine below:
  430. Cobb [Page 12]
  431. Memo Microsoft PPP CHAP Extensions March 1997
  432. datatype-PWBLOCK
  433. {
  434. 256-unicode-char Password
  435. 4-octets PasswordLength
  436. }
  437. NewPasswordEncryptedWithOldNtPasswordHash(
  438. IN 0-to-256-unicode-char NewPassword,
  439. IN 0-to-256-unicode-char OldPassword,
  440. OUT datatype-PWBLOCK EncryptedPwBlock )
  441. {
  442. NtPasswordHash(
  443. OldPassword,
  444. giving PasswordHash )
  445. EncryptPwBlockWithPasswordHash(
  446. NewPassword,
  447. PasswordHash,
  448. giving EncryptedPwBlock )
  449. }
  450. EncryptPwBlockWithPasswordHash(
  451. IN 0-to-256-unicode-char Password,
  452. IN 16-octet PasswordHash,
  453. OUT datatype-PWBLOCK PwBlock )
  454. {
  455. Fill ClearPwBlock with random octet values
  456. lstrcpyW( to ClearPwBlock.Password, from Password )
  457. ClearPwBlock.PasswordLength = lstrlenW( Password )
  458. Rc4Encrypt(
  459. ClearPwBlock,
  460. sizeof( ClearPwBlock ),
  461. PasswordHash,
  462. sizeof( PasswordHash ),
  463. giving PwBlock )
  464. }
  465. Rc4Encrypt(
  466. IN x-octet Clear,
  467. IN integer ClearLength,
  468. IN y-octet Key,
  469. IN integer KeyLength,
  470. OUT x-octet Cypher )
  471. {
  472. Use the RC4 encryption algorithm [5] to encrypt Clear of
  473. length ClearLength octets into a Cypher of the same length
  474. such that the Cypher can only be decrypted back to Clear
  475. by providing a Key of length KeyLength octets.
  476. }
  477. Cobb [Page 13]
  478. Memo Microsoft PPP CHAP Extensions March 1997
  479. Old NT Hash Encrypted with New NT Hash
  480. This field contains the old Windows NT password hash encrypted
  481. with the new Windows NT password hash, as output by the
  482. OldNtPasswordHashEncryptedWithNewNtPasswordHash routine below:
  483. OldNtPasswordHashEncryptedWithNewNtPasswordHash(
  484. IN 0-to-256-unicode-char NewPassword,
  485. IN 0-to-256-unicode-char OldPassword,
  486. OUT 16-octet EncryptedPasswordHash )
  487. {
  488. NtPasswordHash(
  489. OldPassword,
  490. giving OldPasswordHash )
  491. NtPasswordHash(
  492. NewPassword,
  493. giving NewPasswordHash )
  494. PasswordHashEncryptedWithBlock(
  495. OldPasswordHash,
  496. NewPasswordHash,
  497. giving EncrytptedPasswordHash )
  498. }
  499. Password Encrypted with Old LM Hash
  500. This field contains the PWBLOCK form of the new Windows NT
  501. password encrypted with the old LAN Manager password hash, as
  502. output by the NewPasswordEncryptedWithOldLmPasswordHash
  503. routine below:
  504. NewPasswordEncryptedWithOldLmPasswordHash(
  505. IN 0-to-256-unicode-char NewPassword,
  506. IN 0-to-256-unicode-char OldPassword,
  507. OUT datatype-PWBLOCK EncryptedPwBlock )
  508. {
  509. LmPasswordHash(
  510. OldPassword,
  511. giving PasswordHash )
  512. EncryptPwBlockWithPasswordHash(
  513. NewPassword,
  514. PasswordHash,
  515. giving EncryptedPwBlock )
  516. }
  517. Cobb [Page 14]
  518. Memo Microsoft PPP CHAP Extensions March 1997
  519. Old LM Hash Encrypted with New NT Hash
  520. This field contains the old LAN Manager password hash encrypted
  521. with the new Windows NT password hash, as output by the
  522. OldLmPasswordHashEncryptedWithNewNtPasswordHash routine below:
  523. OldLmPasswordHashEncryptedWithNewNtPasswordHash(
  524. IN 0-to-256-unicode-char NewPassword,
  525. IN 0-to-256-unicode-char OldPassword,
  526. OUT 16-octet EncryptedPasswordHash )
  527. {
  528. LmPasswordHash(
  529. OldPassword,
  530. giving OldPasswordHash )
  531. NtPasswordHash(
  532. NewPassword,
  533. giving NewPasswordHash )
  534. PasswordHashEncryptedWithBlock(
  535. OldPasswordHash,
  536. NewPasswordHash,
  537. giving EncrytptedPasswordHash )
  538. }
  539. LAN Manager compatible challenge response
  540. Windows NT compatible challenge response
  541. The challenge response fields as described in the Response
  542. packet description, but calculated on the new password and the
  543. same challenge used in the last response.
  544. Flags
  545. Bit field of option flags:
  546. 0 : The "use Windows NT compatible challenge response"
  547. flag as described in the Response packet.
  548. 1 : Set 1 indicates that the "Password Encrypted with
  549. Old LM Hash" and "Old LM Hash Encrypted With New NT
  550. Hash" fields are valid and should be used. Set 0
  551. indicates these fields are not valid.
  552. For the broadest possible interoperability,
  553. implementations are encouraged to provide both the
  554. Windows NT and LAN Manager fields when the password
  555. is LAN Manager compatible. This is what Windows NT
  556. does.
  557. 2-15 : Reserved, always set 0.
  558. Cobb [Page 15]
  559. Memo Microsoft PPP CHAP Extensions March 1997
  560. 9. Negotiation Examples
  561. Here are some examples of typical negotiations. The authenticatee
  562. is on the left and the authenticator is on the right.
  563. The packet sequence ID is incremented on each authentication retry
  564. Response and on the change password response. All cases where the
  565. packet sequence ID is updated are noted below.
  566. Response retry is never allowed after either Change Password.
  567. Change Password may occur after Response retry. The implied
  568. challenge form is shown in the examples, though all cases of
  569. "first challenge+23" should be replaced by the
  570. "C=cccccccccccccccc" challenge if authenticator supplies it in the
  571. Failure packet.
  572. Successful authentication
  573. <- Challenge
  574. Response ->
  575. <- Success
  576. Failed authentication with no retry allowed
  577. <- Challenge
  578. Response ->
  579. <- Failure (E=691 R=0)
  580. Successful authentication after retry
  581. <- Challenge
  582. Response ->
  583. <- Failure (E=691 R=1), disable short timeout
  584. Response (++ID) to first challenge+23 ->
  585. <- Success
  586. Failed hack attack with 3 attempts allowed
  587. <- Challenge
  588. Response ->
  589. <- Failure (E=691 R=1), disable short timeout
  590. Response (++ID) to first challenge+23 ->
  591. <- Failure (E=691 R=1), disable short timeout
  592. Response (++ID) to first challenge+23+23 ->
  593. <- Failure (E=691 R=0)
  594. Cobb [Page 16]
  595. Memo Microsoft PPP CHAP Extensions March 1997
  596. Successful authentication with password change
  597. <- Challenge
  598. Response ->
  599. <- Failure (E=648 R=0), disable short timeout
  600. ChangePassword (++ID) to first challenge ->
  601. <- Success
  602. Successful authentication with retry and password change
  603. <- Challenge
  604. Response ->
  605. <- Failure (E=691 R=1), disable short timeout
  606. Response (++ID) to first challenge+23 ->
  607. <- Failure (E=648 R=0), disable short timeout
  608. ChangePassword (++ID) to first challenge+23 ->
  609. <- Success
  610. 10. Hash Example
  611. Intermediate values for password "MyPw".
  612. 8-octet Challenge:
  613. 10 2D B5 DF 08 5D 30 41
  614. 0-to-14-oem-char LmPassword:
  615. 4D 59 50 57
  616. 16-octet LmPasswordHash:
  617. 75 BA 30 19 8E 6D 19 75 AA D3 B4 35 B5 14 04 EE
  618. 24-octet LmChallengeResponse:
  619. 91 88 1D 01 52 AB 0C 33 C5 24 13 5E C2 4A 95 EE
  620. 64 E2 3C DC 2D 33 34 7D
  621. 0-to-256-unicode-char NtPassword:
  622. 4D 00 79 00 50 00 77 00
  623. 16-octet NtPasswordHash:
  624. FC 15 6A F7 ED CD 6C 0E DD E3 33 7D 42 7F 4E AC
  625. 24-octet NtChallengeResponse:
  626. 4E 9D 3C 8F 9C FD 38 5D 5B F4 D3 24 67 91 95 6C
  627. A4 C3 51 AB 40 9A 3D 61
  628. Cobb [Page 17]
  629. Memo Microsoft PPP CHAP Extensions March 1997
  630. REFERENCES
  631. [1] Simpson, W., "The Point-to-Point Protocol (PPP)", RFC 1331,
  632. Daydreamer, May 1992
  633. [2] LLoyd, B and Simpson, W., "PPP Authentication Protocols",
  634. RFC 1334, L&A and Daydreamer respectively, Octobet 1992
  635. [3] "Data Encryption Standard (DES)" is Federal Information
  636. Processing Standard publication 46, National Institute of
  637. Standard and Techology.
  638. [4] Rivest, R., "MD4 Message Digest Algorithm", RFC 1320, MIT
  639. Laboratory for Computer Science and RSA Data Security, Inc.,
  640. April 1992.
  641. [5] RC4 is an encryption standard available from RSA Data Security
  642. Inc.
  643. [6] The 8-octet StdText string used in the LAN Manager compatible
  644. password hashing and the 8-octet KeyValue used in the Change
  645. Password (version 1) packet are not available for public
  646. distribution at this time. Contact the Microsoft Developer
  647. Relations group (at time of writing [email protected]) for
  648. details on obtaining these values. On this particular point
  649. the author can't help you.
  650. Cobb [Page 18]
  651. Memo Microsoft PPP CHAP Extensions March 1997
  652. CHAIR'S ADDRESS
  653. The working group can be contacted via the current chair:
  654. Fred Baker
  655. Email: [email protected]
  656. AUTHOR'S ADDRESS
  657. The author is a developer in Microsoft's Windows NT
  658. Internetworking group, which monitors the [email protected]
  659. discussions. Questions can also be directed as below, where email
  660. is preferred.
  661. Steve Cobb
  662. Microsoft Corporation
  663. One Microsoft Way
  664. Redmond, WA 98052-6399
  665. Email: [email protected]
  666. The author maintains an informal mailing list of persons
  667. interested in MS-CHAP and other news regarding Windows NT support
  668. for PPP authentication protocols. Send email if interested.
  669. Cobb [Page 19]