home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / rfc / rfc1334 < prev    next >
Text File  |  1992-10-21  |  33KB  |  900 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                           B. Lloyd
  8. Request for Comments: 1334                                           L&A
  9.                                                               W. Simpson
  10.                                                               Daydreamer
  11.                                                             October 1992
  12.  
  13.  
  14.                       PPP Authentication Protocols
  15.  
  16. Status of this Memo
  17.  
  18.    This RFC specifies an IAB standards track protocol for the Internet
  19.    community, and requests discussion and suggestions for improvements.
  20.    Please refer to the current edition of the "IAB Official Protocol
  21.    Standards" for the standardization state and status of this protocol.
  22.    Distribution of this memo is unlimited.
  23.  
  24. Abstract
  25.  
  26.    The Point-to-Point Protocol (PPP) [1] provides a standard method of
  27.    encapsulating Network Layer protocol information over point-to-point
  28.    links.  PPP also defines an extensible Link Control Protocol, which
  29.    allows negotiation of an Authentication Protocol for authenticating
  30.    its peer before allowing Network Layer protocols to transmit over the
  31.    link.
  32.  
  33.    This document defines two protocols for Authentication: the Password
  34.    Authentication Protocol and the Challenge-Handshake Authentication
  35.    Protocol.  This memo is the product of the Point-to-Point Protocol
  36.    Working Group of the Internet Engineering Task Force (IETF).
  37.    Comments on this memo should be submitted to the ietf-ppp@ucdavis.edu
  38.    mailing list.
  39.  
  40. Table of Contents
  41.  
  42.    1.  Introduction ...............................................    2
  43.    1.1 Specification Requirements .................................    2
  44.    1.2 Terminology ................................................    3
  45.    2. Password Authentication Protocol ............................    3
  46.    2.1 Configuration Option Format ................................    4
  47.    2.2 Packet Format ..............................................    5
  48.    2.2.1 Authenticate-Request .....................................    5
  49.    2.2.2 Authenticate-Ack and Authenticate-Nak ....................    7
  50.    3. Challenge-Handshake Authentication Protocol..................    8
  51.    3.1 Configuration Option Format ................................    9
  52.    3.2 Packet Format ..............................................   10
  53.    3.2.1 Challenge and Response ...................................   11
  54.    3.2.2 Success and Failure ......................................   13
  55.  
  56.  
  57.  
  58. Lloyd & Simpson                                                 [Page 1]
  59.  
  60. RFC 1334                   PPP Authentication               October 1992
  61.  
  62.  
  63.    SECURITY CONSIDERATIONS ........................................   14
  64.    REFERENCES .....................................................   15
  65.    ACKNOWLEDGEMENTS ...............................................   16
  66.    CHAIR'S ADDRESS ................................................   16
  67.    AUTHOR'S ADDRESS ...............................................   16
  68.  
  69. 1.  Introduction
  70.  
  71.    PPP has three main components:
  72.  
  73.       1. A method for encapsulating datagrams over serial links.
  74.  
  75.       2. A Link Control Protocol (LCP) for establishing, configuring,
  76.          and testing the data-link connection.
  77.  
  78.       3. A family of Network Control Protocols (NCPs) for establishing
  79.          and configuring different network-layer protocols.
  80.  
  81.    In order to establish communications over a point-to-point link, each
  82.    end of the PPP link must first send LCP packets to configure the data
  83.    link during Link Establishment phase.  After the link has been
  84.    established, PPP provides for an optional Authentication phase before
  85.    proceeding to the Network-Layer Protocol phase.
  86.  
  87.    By default, authentication is not mandatory.  If authentication of
  88.    the link is desired, an implementation MUST specify the
  89.    Authentication-Protocol Configuration Option during Link
  90.    Establishment phase.
  91.  
  92.    These authentication protocols are intended for use primarily by
  93.    hosts and routers that connect to a PPP network server via switched
  94.    circuits or dial-up lines, but might be applied to dedicated links as
  95.    well.  The server can use the identification of the connecting host
  96.    or router in the selection of options for network layer negotiations.
  97.  
  98.    This document defines the PPP authentication protocols.  The Link
  99.    Establishment and Authentication phases, and the Authentication-
  100.    Protocol Configuration Option, are defined in The Point-to-Point
  101.    Protocol (PPP) [1].
  102.  
  103. 1.1.  Specification Requirements
  104.  
  105.    In this document, several words are used to signify the requirements
  106.    of the specification.  These words are often capitalized.
  107.  
  108.    MUST
  109.       This word, or the adjective "required", means that the definition
  110.       is an absolute requirement of the specification.
  111.  
  112.  
  113.  
  114. Lloyd & Simpson                                                 [Page 2]
  115.  
  116. RFC 1334                   PPP Authentication               October 1992
  117.  
  118.  
  119.    MUST NOT
  120.       This phrase means that the definition is an absolute prohibition
  121.       of the specification.
  122.  
  123.    SHOULD
  124.       This word, or the adjective "recommended", means that there may
  125.       exist valid reasons in particular circumstances to ignore this
  126.       item, but the full implications should be understood and carefully
  127.       weighed before choosing a different course.
  128.  
  129.    MAY
  130.       This word, or the adjective "optional", means that this item is
  131.       one of an allowed set of alternatives.  An implementation which
  132.       does not include this option MUST be prepared to interoperate with
  133.       another implementation which does include the option.
  134.  
  135. 1.2.  Terminology
  136.  
  137.    This document frequently uses the following terms:
  138.  
  139.    authenticator
  140.       The end of the link requiring the authentication.  The
  141.       authenticator specifies the authentication protocol to be used in
  142.       the Configure-Request during Link Establishment phase.
  143.  
  144.    peer
  145.       The other end of the point-to-point link; the end which is being
  146.       authenticated by the authenticator.
  147.  
  148.    silently discard
  149.       This means the implementation discards the packet without further
  150.       processing.  The implementation SHOULD provide the capability of
  151.       logging the error, including the contents of the silently
  152.       discarded packet, and SHOULD record the event in a statistics
  153.       counter.
  154.  
  155. 2.  Password Authentication Protocol
  156.  
  157.    The Password Authentication Protocol (PAP) provides a simple method
  158.    for the peer to establish its identity using a 2-way handshake.  This
  159.    is done only upon initial link establishment.
  160.  
  161.    After the Link Establishment phase is complete, an Id/Password pair
  162.    is repeatedly sent by the peer to the authenticator until
  163.    authentication is acknowledged or the connection is terminated.
  164.  
  165.    PAP is not a strong authentication method.  Passwords are sent over
  166.    the circuit "in the clear", and there is no protection from playback
  167.  
  168.  
  169.  
  170. Lloyd & Simpson                                                 [Page 3]
  171.  
  172. RFC 1334                   PPP Authentication               October 1992
  173.  
  174.  
  175.    or repeated trial and error attacks.  The peer is in control of the
  176.    frequency and timing of the attempts.
  177.  
  178.    Any implementations which include a stronger authentication method
  179.    (such as CHAP, described below) MUST offer to negotiate that method
  180.    prior to PAP.
  181.  
  182.    This authentication method is most appropriately used where a
  183.    plaintext password must be available to simulate a login at a remote
  184.    host.  In such use, this method provides a similar level of security
  185.    to the usual user login at the remote host.
  186.  
  187.       Implementation Note: It is possible to limit the exposure of the
  188.       plaintext password to transmission over the PPP link, and avoid
  189.       sending the plaintext password over the entire network.  When the
  190.       remote host password is kept as a one-way transformed value, and
  191.       the algorithm for the transform function is implemented in the
  192.       local server, the plaintext password SHOULD be locally transformed
  193.       before comparison with the transformed password from the remote
  194.       host.
  195.  
  196. 2.1.  Configuration Option Format
  197.  
  198.    A summary of the Authentication-Protocol Configuration Option format
  199.    to negotiate the Password Authentication Protocol is shown below.
  200.    The fields are transmitted from left to right.
  201.  
  202.     0                   1                   2                   3
  203.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  204.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  205.    |     Type      |    Length     |     Authentication-Protocol   |
  206.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  207.  
  208.    Type
  209.  
  210.       3
  211.  
  212.    Length
  213.  
  214.       4
  215.  
  216.    Authentication-Protocol
  217.  
  218.       c023 (hex) for Password Authentication Protocol.
  219.  
  220.    Data
  221.  
  222.       There is no Data field.
  223.  
  224.  
  225.  
  226. Lloyd & Simpson                                                 [Page 4]
  227.  
  228. RFC 1334                   PPP Authentication               October 1992
  229.  
  230.  
  231. 2.2.  Packet Format
  232.  
  233.    Exactly one Password Authentication Protocol packet is encapsulated
  234.    in the Information field of a PPP Data Link Layer frame where the
  235.    protocol field indicates type hex c023 (Password Authentication
  236.    Protocol).  A summary of the PAP packet format is shown below.  The
  237.    fields are transmitted from left to right.
  238.  
  239.     0                   1                   2                   3
  240.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  241.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  242.    |     Code      |  Identifier   |            Length             |
  243.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  244.    |    Data ...
  245.    +-+-+-+-+
  246.  
  247.    Code
  248.  
  249.       The Code field is one octet and identifies the type of PAP packet.
  250.       PAP Codes are assigned as follows:
  251.  
  252.          1       Authenticate-Request
  253.          2       Authenticate-Ack
  254.          3       Authenticate-Nak
  255.  
  256.    Identifier
  257.  
  258.       The Identifier field is one octet and aids in matching requests
  259.       and replies.
  260.  
  261.    Length
  262.  
  263.       The Length field is two octets and indicates the length of the PAP
  264.       packet including the Code, Identifier, Length and Data fields.
  265.       Octets outside the range of the Length field should be treated as
  266.       Data Link Layer padding and should be ignored on reception.
  267.  
  268.    Data
  269.  
  270.       The Data field is zero or more octets.  The format of the Data
  271.       field is determined by the Code field.
  272.  
  273. 2.2.1.  Authenticate-Request
  274.  
  275.    Description
  276.  
  277.       The Authenticate-Request packet is used to begin the Password
  278.       Authentication Protocol.  The link peer MUST transmit a PAP packet
  279.  
  280.  
  281.  
  282. Lloyd & Simpson                                                 [Page 5]
  283.  
  284. RFC 1334                   PPP Authentication               October 1992
  285.  
  286.  
  287.       with the Code field set to 1 (Authenticate-Request) during the
  288.       Authentication phase.  The Authenticate-Request packet MUST be
  289.       repeated until a valid reply packet is received, or an optional
  290.       retry counter expires.
  291.  
  292.       The authenticator SHOULD expect the peer to send an Authenticate-
  293.       Request packet.  Upon reception of an Authenticate-Request packet,
  294.       some type of Authenticate reply (described below) MUST be
  295.       returned.
  296.  
  297.          Implementation Note: Because the Authenticate-Ack might be
  298.          lost, the authenticator MUST allow repeated Authenticate-
  299.          Request packets after completing the Authentication phase.
  300.          Protocol phase MUST return the same reply Code returned when
  301.          the Authentication phase completed (the message portion MAY be
  302.          different).  Any Authenticate-Request packets received during
  303.          any other phase MUST be silently discarded.
  304.  
  305.          When the Authenticate-Nak is lost, and the authenticator
  306.          terminates the link, the LCP Terminate-Request and Terminate-
  307.          Ack provide an alternative indication that authentication
  308.          failed.
  309.  
  310.    A summary of the Authenticate-Request packet format is shown below.
  311.    The fields are transmitted from left to right.
  312.  
  313.     0                   1                   2                   3
  314.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  315.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  316.    |     Code      |  Identifier   |            Length             |
  317.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  318.    | Peer-ID Length|  Peer-Id ...
  319.    +-+-+-+-+-+-+-+-+-+-+-+-+
  320.    | Passwd-Length |  Password  ...
  321.    +-+-+-+-+-+-+-+-+-+-+-+-+-+
  322.  
  323.    Code
  324.  
  325.       1 for Authenticate-Request.
  326.  
  327.    Identifier
  328.  
  329.       The Identifier field is one octet and aids in matching requests
  330.       and replies.  The Identifier field MUST be changed each time an
  331.       Authenticate-Request packet is issued.
  332.  
  333.  
  334.  
  335.  
  336.  
  337.  
  338. Lloyd & Simpson                                                 [Page 6]
  339.  
  340. RFC 1334                   PPP Authentication               October 1992
  341.  
  342.  
  343.    Peer-ID-Length
  344.  
  345.       The Peer-ID-Length field is one octet and indicates the length of
  346.       the Peer-ID field.
  347.  
  348.    Peer-ID
  349.  
  350.       The Peer-ID field is zero or more octets and indicates the name of
  351.       the peer to be authenticated.
  352.  
  353.    Passwd-Length
  354.  
  355.       The Passwd-Length field is one octet and indicates the length of
  356.       the Password field.
  357.  
  358.    Password
  359.  
  360.       The Password field is zero or more octets and indicates the
  361.       password to be used for authentication.
  362.  
  363. 2.2.2.  Authenticate-Ack and Authenticate-Nak
  364.  
  365.    Description
  366.  
  367.       If the Peer-ID/Password pair received in an Authenticate-Request
  368.       is both recognizable and acceptable, then the authenticator MUST
  369.       transmit a PAP packet with the Code field set to 2 (Authenticate-
  370.       Ack).
  371.  
  372.       If the Peer-ID/Password pair received in a Authenticate-Request is
  373.       not recognizable or acceptable, then the authenticator MUST
  374.       transmit a PAP packet with the Code field set to 3 (Authenticate-
  375.       Nak), and SHOULD take action to terminate the link.
  376.  
  377.    A summary of the Authenticate-Ack and Authenticate-Nak packet format
  378.    is shown below.  The fields are transmitted from left to right.
  379.  
  380.     0                   1                   2                   3
  381.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  382.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  383.    |     Code      |  Identifier   |            Length             |
  384.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  385.    |  Msg-Length   |  Message  ...
  386.    +-+-+-+-+-+-+-+-+-+-+-+-+-
  387.  
  388.    Code
  389.  
  390.       2 for Authenticate-Ack;
  391.  
  392.  
  393.  
  394. Lloyd & Simpson                                                 [Page 7]
  395.  
  396. RFC 1334                   PPP Authentication               October 1992
  397.  
  398.  
  399.       3 for Authenticate-Nak.
  400.  
  401.    Identifier
  402.  
  403.       The Identifier field is one octet and aids in matching requests
  404.       and replies.  The Identifier field MUST be copied from the
  405.       Identifier field of the Authenticate-Request which caused this
  406.       reply.
  407.  
  408.    Msg-Length
  409.  
  410.       The Msg-Length field is one octet and indicates the length of the
  411.       Message field.
  412.  
  413.    Message
  414.  
  415.       The Message field is zero or more octets, and its contents are
  416.       implementation dependent.  It is intended to be human readable,
  417.       and MUST NOT affect operation of the protocol.  It is recommended
  418.       that the message contain displayable ASCII characters 32 through
  419.       126 decimal.  Mechanisms for extension to other character sets are
  420.       the topic of future research.
  421.  
  422. 3.  Challenge-Handshake Authentication Protocol
  423.  
  424.    The Challenge-Handshake Authentication Protocol (CHAP) is used to
  425.    periodically verify the identity of the peer using a 3-way handshake.
  426.    This is done upon initial link establishment, and MAY be repeated
  427.    anytime after the link has been established.
  428.  
  429.    After the Link Establishment phase is complete, the authenticator
  430.    sends a "challenge" message to the peer.  The peer responds with a
  431.    value calculated using a "one-way hash" function.  The authenticator
  432.    checks the response against its own calculation of the expected hash
  433.    value.  If the values match, the authentication is acknowledged;
  434.    otherwise the connection SHOULD be terminated.
  435.  
  436.    CHAP provides protection against playback attack through the use of
  437.    an incrementally changing identifier and a variable challenge value.
  438.    The use of repeated challenges is intended to limit the time of
  439.    exposure to any single attack.  The authenticator is in control of
  440.    the frequency and timing of the challenges.
  441.  
  442.    This authentication method depends upon a "secret" known only to the
  443.    authenticator and that peer.  The secret is not sent over the link.
  444.    This method is most likely used where the same secret is easily
  445.    accessed from both ends of the link.
  446.  
  447.  
  448.  
  449.  
  450. Lloyd & Simpson                                                 [Page 8]
  451.  
  452. RFC 1334                   PPP Authentication               October 1992
  453.  
  454.  
  455.       Implementation Note: CHAP requires that the secret be available in
  456.       plaintext form.  To avoid sending the secret over other links in
  457.       the network, it is recommended that the challenge and response
  458.       values be examined at a central server, rather than each network
  459.       access server.  Otherwise, the secret SHOULD be sent to such
  460.       servers in a reversably encrypted form.
  461.  
  462.    The CHAP algorithm requires that the length of the secret MUST be at
  463.    least 1 octet.  The secret SHOULD be at least as large and
  464.    unguessable as a well-chosen password.  It is preferred that the
  465.    secret be at least the length of the hash value for the hashing
  466.    algorithm chosen (16 octets for MD5).  This is to ensure a
  467.    sufficiently large range for the secret to provide protection against
  468.    exhaustive search attacks.
  469.  
  470.    The one-way hash algorithm is chosen such that it is computationally
  471.    infeasible to determine the secret from the known challenge and
  472.    response values.
  473.  
  474.    The challenge value SHOULD satisfy two criteria: uniqueness and
  475.    unpredictability.  Each challenge value SHOULD be unique, since
  476.    repetition of a challenge value in conjunction with the same secret
  477.    would permit an attacker to reply with a previously intercepted
  478.    response.  Since it is expected that the same secret MAY be used to
  479.    authenticate with servers in disparate geographic regions, the
  480.    challenge SHOULD exhibit global and temporal uniqueness.  Each
  481.    challenge value SHOULD also be unpredictable, least an attacker trick
  482.    a peer into responding to a predicted future challenge, and then use
  483.    the response to masquerade as that peer to an authenticator.
  484.    Although protocols such as CHAP are incapable of protecting against
  485.    realtime active wiretapping attacks, generation of unique
  486.    unpredictable challenges can protect against a wide range of active
  487.    attacks.
  488.  
  489.    A discussion of sources of uniqueness and probability of divergence
  490.    is included in the Magic-Number Configuration Option [1].
  491.  
  492. 3.1.  Configuration Option Format
  493.  
  494.    A summary of the Authentication-Protocol Configuration Option format
  495.    to negotiate the Challenge-Handshake Authentication Protocol is shown
  496.    below.  The fields are transmitted from left to right.
  497.  
  498.  
  499.  
  500.  
  501.  
  502.  
  503.  
  504.  
  505.  
  506. Lloyd & Simpson                                                 [Page 9]
  507.  
  508. RFC 1334                   PPP Authentication               October 1992
  509.  
  510.  
  511.     0                   1                   2                   3
  512.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  513.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  514.    |     Type      |    Length     |     Authentication-Protocol   |
  515.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  516.    |   Algorithm   |
  517.    +-+-+-+-+-+-+-+-+
  518.  
  519.    Type
  520.  
  521.       3
  522.  
  523.    Length
  524.  
  525.       5
  526.  
  527.    Authentication-Protocol
  528.  
  529.       c223 (hex) for Challenge-Handshake Authentication Protocol.
  530.  
  531.    Algorithm
  532.  
  533.       The Algorithm field is one octet and indicates the one-way hash
  534.       method to be used.  The most up-to-date values of the CHAP
  535.       Algorithm field are specified in the most recent "Assigned
  536.       Numbers" RFC [2].  Current values are assigned as follows:
  537.  
  538.          0-4     unused (reserved)
  539.          5       MD5 [3]
  540.  
  541. 3.2.  Packet Format
  542.  
  543.    Exactly one Challenge-Handshake Authentication Protocol packet is
  544.    encapsulated in the Information field of a PPP Data Link Layer frame
  545.    where the protocol field indicates type hex c223 (Challenge-Handshake
  546.    Authentication Protocol).  A summary of the CHAP packet format is
  547.    shown below.  The fields are transmitted from left to right.
  548.  
  549.     0                   1                   2                   3
  550.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  551.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  552.    |     Code      |  Identifier   |            Length             |
  553.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  554.    |    Data ...
  555.    +-+-+-+-+
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562. Lloyd & Simpson                                                [Page 10]
  563.  
  564. RFC 1334                   PPP Authentication               October 1992
  565.  
  566.  
  567.    Code
  568.  
  569.       The Code field is one octet and identifies the type of CHAP
  570.       packet.  CHAP Codes are assigned as follows:
  571.  
  572.          1       Challenge
  573.          2       Response
  574.          3       Success
  575.          4       Failure
  576.  
  577.    Identifier
  578.  
  579.       The Identifier field is one octet and aids in matching challenges,
  580.       responses and replies.
  581.  
  582.    Length
  583.  
  584.       The Length field is two octets and indicates the length of the
  585.       CHAP packet including the Code, Identifier, Length and Data
  586.       fields.  Octets outside the range of the Length field should be
  587.       treated as Data Link Layer padding and should be ignored on
  588.       reception.
  589.  
  590.    Data
  591.  
  592.       The Data field is zero or more octets.  The format of the Data
  593.       field is determined by the Code field.
  594.  
  595. 3.2.1.  Challenge and Response
  596.  
  597.    Description
  598.  
  599.       The Challenge packet is used to begin the Challenge-Handshake
  600.       Authentication Protocol.  The authenticator MUST transmit a CHAP
  601.       packet with the Code field set to 1 (Challenge).  Additional
  602.       Challenge packets MUST be sent until a valid Response packet is
  603.       received, or an optional retry counter expires.
  604.  
  605.       A Challenge packet MAY also be transmitted at any time during the
  606.       Network-Layer Protocol phase to ensure that the connection has not
  607.       been altered.
  608.  
  609.       The peer SHOULD expect Challenge packets during the Authentication
  610.       phase and the Network-Layer Protocol phase.  Whenever a Challenge
  611.       packet is received, the peer MUST transmit a CHAP packet with the
  612.       Code field set to 2 (Response).
  613.  
  614.       Whenever a Response packet is received, the authenticator compares
  615.  
  616.  
  617.  
  618. Lloyd & Simpson                                                [Page 11]
  619.  
  620. RFC 1334                   PPP Authentication               October 1992
  621.  
  622.  
  623.       the Response Value with its own calculation of the expected value.
  624.       Based on this comparison, the authenticator MUST send a Success or
  625.       Failure packet (described below).
  626.  
  627.          Implementation Note: Because the Success might be lost, the
  628.          authenticator MUST allow repeated Response packets after
  629.          completing the Authentication phase.  To prevent discovery of
  630.          alternative Names and Secrets, any Response packets received
  631.          having the current Challenge Identifier MUST return the same
  632.          reply Code returned when the Authentication phase completed
  633.          (the message portion MAY be different).  Any Response packets
  634.          received during any other phase MUST be silently discarded.
  635.  
  636.          When the Failure is lost, and the authenticator terminates the
  637.          link, the LCP Terminate-Request and Terminate-Ack provide an
  638.          alternative indication that authentication failed.
  639.  
  640.    A summary of the Challenge and Response packet format is shown below.
  641.    The fields are transmitted from left to right.
  642.  
  643.     0                   1                   2                   3
  644.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  645.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  646.    |     Code      |  Identifier   |            Length             |
  647.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  648.    |  Value-Size   |  Value ...
  649.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  650.    |  Name ...
  651.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  652.  
  653.    Code
  654.  
  655.       1 for Challenge;
  656.  
  657.       2 for Response.
  658.  
  659.    Identifier
  660.  
  661.       The Identifier field is one octet.  The Identifier field MUST be
  662.       changed each time a Challenge is sent.
  663.  
  664.       The Response Identifier MUST be copied from the Identifier field
  665.       of the Challenge which caused the Response.
  666.  
  667.    Value-Size
  668.  
  669.       This field is one octet and indicates the length of the Value
  670.       field.
  671.  
  672.  
  673.  
  674. Lloyd & Simpson                                                [Page 12]
  675.  
  676. RFC 1334                   PPP Authentication               October 1992
  677.  
  678.  
  679.    Value
  680.  
  681.       The Value field is one or more octets.  The most significant octet
  682.       is transmitted first.
  683.  
  684.       The Challenge Value is a variable stream of octets.  The
  685.       importance of the uniqueness of the Challenge Value and its
  686.       relationship to the secret is described above.  The Challenge
  687.       Value MUST be changed each time a Challenge is sent.  The length
  688.       of the Challenge Value depends upon the method used to generate
  689.       the octets, and is independent of the hash algorithm used.
  690.  
  691.       The Response Value is the one-way hash calculated over a stream of
  692.       octets consisting of the Identifier, followed by (concatenated
  693.       with) the "secret", followed by (concatenated with) the Challenge
  694.       Value.  The length of the Response Value depends upon the hash
  695.       algorithm used (16 octets for MD5).
  696.  
  697.    Name
  698.  
  699.       The Name field is one or more octets representing the
  700.       identification of the system transmitting the packet.  There are
  701.       no limitations on the content of this field.  For example, it MAY
  702.       contain ASCII character strings or globally unique identifiers in
  703.       ASN.1 syntax.  The Name should not be NUL or CR/LF terminated.
  704.       The size is determined from the Length field.
  705.  
  706.       Since CHAP may be used to authenticate many different systems, the
  707.       content of the name field(s) may be used as a key to locate the
  708.       proper secret in a database of secrets.  This also makes it
  709.       possible to support more than one name/secret pair per system.
  710.  
  711. 3.2.2.  Success and Failure
  712.  
  713.    Description
  714.  
  715.       If the Value received in a Response is equal to the expected
  716.       value, then the implementation MUST transmit a CHAP packet with
  717.       the Code field set to 3 (Success).
  718.  
  719.       If the Value received in a Response is not equal to the expected
  720.       value, then the implementation MUST transmit a CHAP packet with
  721.       the Code field set to 4 (Failure), and SHOULD take action to
  722.       terminate the link.
  723.  
  724.    A summary of the Success and Failure packet format is shown below.
  725.    The fields are transmitted from left to right.
  726.  
  727.  
  728.  
  729.  
  730. Lloyd & Simpson                                                [Page 13]
  731.  
  732. RFC 1334                   PPP Authentication               October 1992
  733.  
  734.  
  735.     0                   1                   2                   3
  736.     0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  737.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  738.    |     Code      |  Identifier   |            Length             |
  739.    +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  740.    |  Message  ...
  741.    +-+-+-+-+-+-+-+-+-+-+-+-+-
  742.  
  743.    Code
  744.  
  745.       3 for Success;
  746.  
  747.       4 for Failure.
  748.  
  749.    Identifier
  750.  
  751.       The Identifier field is one octet and aids in matching requests
  752.       and replies.  The Identifier field MUST be copied from the
  753.       Identifier field of the Response which caused this reply.
  754.  
  755.    Message
  756.  
  757.       The Message field is zero or more octets, and its contents are
  758.       implementation dependent.  It is intended to be human readable,
  759.       and MUST NOT affect operation of the protocol.  It is recommended
  760.       that the message contain displayable ASCII characters 32 through
  761.       126 decimal.  Mechanisms for extension to other character sets are
  762.       the topic of future research.  The size is determined from the
  763.       Length field.
  764.  
  765. Security Considerations
  766.  
  767.       Security issues are the primary topic of this RFC.
  768.  
  769.       The interaction of the authentication protocols within PPP are
  770.       highly implementation dependent.  This is indicated by the use of
  771.       SHOULD throughout the document.
  772.  
  773.       For example, upon failure of authentication, some implementations
  774.       do not terminate the link.  Instead, the implementation limits the
  775.       kind of traffic in the Network-Layer Protocols to a filtered
  776.       subset, which in turn allows the user opportunity to update
  777.       secrets or send mail to the network administrator indicating a
  778.       problem.
  779.  
  780.       There is no provision for re-tries of failed authentication.
  781.       However, the LCP state machine can renegotiate the authentication
  782.       protocol at any time, thus allowing a new attempt.  It is
  783.  
  784.  
  785.  
  786. Lloyd & Simpson                                                [Page 14]
  787.  
  788. RFC 1334                   PPP Authentication               October 1992
  789.  
  790.  
  791.       recommended that any counters used for authentication failure not
  792.       be reset until after successful authentication, or subsequent
  793.       termination of the failed link.
  794.  
  795.       There is no requirement that authentication be full duplex or that
  796.       the same protocol be used in both directions.  It is perfectly
  797.       acceptable for different protocols to be used in each direction.
  798.       This will, of course, depend on the specific protocols negotiated.
  799.  
  800.       In practice, within or associated with each PPP server, there is a
  801.       database which associates "user" names with authentication
  802.       information ("secrets").  It is not anticipated that a particular
  803.       named user would be authenticated by multiple methods.  This would
  804.       make the user vulnerable to attacks which negotiate the least
  805.       secure method from among a set (such as PAP rather than CHAP).
  806.       Instead, for each named user there should be an indication of
  807.       exactly one method used to authenticate that user name.  If a user
  808.       needs to make use of different authentication method under
  809.       different circumstances, then distinct user names SHOULD be
  810.       employed, each of which identifies exactly one authentication
  811.       method.
  812.  
  813.       Passwords and other secrets should be stored at the respective
  814.       ends such that access to them is as limited as possible.  Ideally,
  815.       the secrets should only be accessible to the process requiring
  816.       access in order to perform the authentication.
  817.  
  818.       The secrets should be distributed with a mechanism that limits the
  819.       number of entities that handle (and thus gain knowledge of) the
  820.       secret.  Ideally, no unauthorized person should ever gain
  821.       knowledge of the secrets.  It is possible to achieve this with
  822.       SNMP Security Protocols [4], but such a mechanism is outside the
  823.       scope of this specification.
  824.  
  825.       Other distribution methods are currently undergoing research and
  826.       experimentation.  The SNMP Security document also has an excellent
  827.       overview of threats to network protocols.
  828.  
  829. References
  830.  
  831.    [1] Simpson, W., "The Point-to-Point Protocol (PPP)", RFC 1331,
  832.        Daydreamer, May 1992.
  833.  
  834.    [2] Reynolds, J., and J. Postel, "Assigned Numbers", RFC 1340,
  835.        USC/Information Sciences Institute, July 1992.
  836.  
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Lloyd & Simpson                                                [Page 15]
  843.  
  844. RFC 1334                   PPP Authentication               October 1992
  845.  
  846.  
  847.    [3] Rivest, R., and S. Dusse, "The MD5 Message-Digest Algorithm", MIT
  848.        Laboratory for Computer Science and RSA Data Security, Inc.  RFC
  849.        1321, April 1992.
  850.  
  851.    [4] Galvin, J., McCloghrie, K., and J. Davin, "SNMP Security
  852.        Protocols", Trusted Information Systems, Inc., Hughes LAN
  853.        Systems, Inc., MIT Laboratory for Computer Science, RFC 1352,
  854.        July 1992.
  855.  
  856. Acknowledgments
  857.  
  858.    Some of the text in this document is taken from RFC 1172, by Drew
  859.    Perkins of Carnegie Mellon University, and by Russ Hobby of the
  860.    University of California at Davis.
  861.  
  862.    Special thanks to Dave Balenson, Steve Crocker, James Galvin, and
  863.    Steve Kent, for their extensive explanations and suggestions.  Now,
  864.    if only we could get them to agree with each other.
  865.  
  866. Chair's Address
  867.  
  868.    The working group can be contacted via the current chair:
  869.  
  870.       Brian Lloyd
  871.       Lloyd & Associates
  872.       3420 Sudbury Road
  873.       Cameron Park, California 95682
  874.  
  875.       Phone: (916) 676-1147
  876.  
  877.       EMail: brian@lloyd.com
  878.  
  879. Author's Address
  880.  
  881.    Questions about this memo can also be directed to:
  882.  
  883.       William Allen Simpson
  884.       Daydreamer
  885.       Computer Systems Consulting Services
  886.       P O Box 6205
  887.       East Lansing, MI  48826-6205
  888.  
  889.       EMail: Bill.Simpson@um.cc.umich.edu
  890.  
  891.  
  892.  
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Lloyd & Simpson                                                [Page 16]
  899.  
  900.