home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2574.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  191.0 KB  |  4,819 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                      U. Blumenthal
  8. Request for Comments: 2574                     IBM T. J. Watson Research
  9. Obsoletes: 2274                                                B. Wijnen
  10. Category: Standards Track                      IBM T. J. Watson Research
  11.                                                               April 1999
  12.  
  13.  
  14.           User-based Security Model (USM) for version 3 of the
  15.               Simple Network Management Protocol (SNMPv3)
  16.  
  17. Status of this Memo
  18.  
  19.    This document specifies an Internet standards track protocol for the
  20.    Internet community, and requests discussion and suggestions for
  21.    improvements.  Please refer to the current edition of the "Internet
  22.    Official Protocol Standards" (STD 1) for the standardization state
  23.    and status of this protocol.  Distribution of this memo is unlimited.
  24.  
  25. Copyright Notice
  26.  
  27.    Copyright (C) The Internet Society (1999).  All Rights Reserved.
  28.  
  29. Abstract
  30.  
  31.    This document describes the User-based Security Model (USM) for SNMP
  32.    version 3 for use in the SNMP architecture [RFC2571].  It defines the
  33.    Elements of Procedure for providing SNMP message level security.
  34.    This document also includes a MIB for remotely monitoring/managing
  35.    the configuration parameters for this Security Model.
  36.  
  37. Table of Contents
  38.  
  39.    1.  Introduction                                                   3
  40.    1.1.  Threats                                                      4
  41.    1.2.  Goals and Constraints                                        5
  42.    1.3.  Security Services                                            6
  43.    1.4.  Module Organization                                          7
  44.    1.4.1.  Timeliness Module                                          7
  45.    1.4.2.  Authentication Protocol                                    8
  46.    1.4.3.  Privacy Protocol                                           8
  47.    1.5.  Protection against Message Replay, Delay and Redirection     8
  48.    1.5.1.  Authoritative SNMP engine                                  8
  49.    1.5.2.  Mechanisms                                                 9
  50.    1.6.  Abstract Service Interfaces                                 10
  51.    1.6.1.  User-based Security Model Primitives for Authentication   11
  52.    1.6.2.  User-based Security Model Primitives for Privacy          11
  53.    2.  Elements of the Model                                         12
  54.    2.1.  User-based Security Model Users                             12
  55.  
  56.  
  57.  
  58. Blumenthal & Wijnen         Standards Track                     [Page 1]
  59.  
  60. RFC 2574                     USM for SNMPv3                   April 1999
  61.  
  62.  
  63.    2.2.  Replay Protection                                           13
  64.    2.2.1.  msgAuthoritativeEngineID                                  13
  65.    2.2.2.  msgAuthoritativeEngineBoots and msgAuthoritativeEngineTime14
  66.    2.2.3.  Time Window                                               15
  67.    2.3.  Time Synchronization                                        15
  68.    2.4.  SNMP Messages Using this Security Model                     16
  69.    2.5.  Services provided by the User-based Security Model          17
  70.    2.5.1.  Services for Generating an Outgoing SNMP Message          17
  71.    2.5.2.  Services for Processing an Incoming SNMP Message          19
  72.    2.6.  Key Localization Algorithm.                                 21
  73.    3.  Elements of Procedure                                         21
  74.    3.1.  Generating an Outgoing SNMP Message                         22
  75.    3.2.  Processing an Incoming SNMP Message                         25
  76.    4.  Discovery                                                     30
  77.    5.  Definitions                                                   31
  78.    6.  HMAC-MD5-96 Authentication Protocol                           50
  79.    6.1.  Mechanisms                                                  50
  80.    6.1.1.  Digest Authentication Mechanism                           50
  81.    6.2.  Elements of the Digest Authentication Protocol              51
  82.    6.2.1.  Users                                                     51
  83.    6.2.2.  msgAuthoritativeEngineID                                  51
  84.    6.2.3.  SNMP Messages Using this Authentication Protocol          51
  85.    6.2.4.  Services provided by the HMAC-MD5-96 Authentication Module52
  86.    6.2.4.1.  Services for Generating an Outgoing SNMP Message        52
  87.    6.2.4.2.  Services for Processing an Incoming SNMP Message        53
  88.    6.3.  Elements of Procedure                                       53
  89.    6.3.1.  Processing an Outgoing Message                            54
  90.    6.3.2.  Processing an Incoming Message                            54
  91.    7.  HMAC-SHA-96 Authentication Protocol                           55
  92.    7.1.  Mechanisms                                                  55
  93.    7.1.1.  Digest Authentication Mechanism                           56
  94.    7.2.  Elements of the HMAC-SHA-96 Authentication Protocol         56
  95.    7.2.1.  Users                                                     56
  96.    7.2.2.  msgAuthoritativeEngineID                                  57
  97.    7.2.3.  SNMP Messages Using this Authentication Protocol          57
  98.    7.2.4.  Services provided by the HMAC-SHA-96 Authentication Module57
  99.    7.2.4.1.  Services for Generating an Outgoing SNMP Message        57
  100.    7.2.4.2.  Services for Processing an Incoming SNMP Message        58
  101.    7.3.  Elements of Procedure                                       59
  102.    7.3.1.  Processing an Outgoing Message                            59
  103.    7.3.2.  Processing an Incoming Message                            60
  104.    8.  CBC-DES Symmetric Encryption Protocol                         61
  105.    8.1.  Mechanisms                                                  61
  106.    8.1.1.  Symmetric Encryption Protocol                             61
  107.    8.1.1.1.  DES key and Initialization Vector.                      62
  108.    8.1.1.2.  Data Encryption.                                        63
  109.    8.1.1.3.  Data Decryption                                         63
  110.    8.2.  Elements of the DES Privacy Protocol                        63
  111.  
  112.  
  113.  
  114. Blumenthal & Wijnen         Standards Track                     [Page 2]
  115.  
  116. RFC 2574                     USM for SNMPv3                   April 1999
  117.  
  118.  
  119.    8.2.1.  Users                                                     63
  120.    8.2.2.  msgAuthoritativeEngineID                                  64
  121.    8.2.3.  SNMP Messages Using this Privacy Protocol                 64
  122.    8.2.4.  Services provided by the DES Privacy Module               64
  123.    8.2.4.1.  Services for Encrypting Outgoing Data                   64
  124.    8.2.4.2.  Services for Decrypting Incoming Data                   65
  125.    8.3.  Elements of Procedure.                                      66
  126.    8.3.1.  Processing an Outgoing Message                            66
  127.    8.3.2.  Processing an Incoming Message                            66
  128.    9.  Intellectual Property                                         67
  129.    10. Acknowledgements                                              67
  130.    11. Security Considerations                                       69
  131.    11.1. Recommended Practices                                       69
  132.    11.2. Defining Users                                              71
  133.    11.3. Conformance                                                 72
  134.    11.4. Use of Reports                                              72
  135.    11.5. Access to the SNMP-USER-BASED-SM-MIB                        72
  136.    12. References                                                    73
  137.    13. Editors' Addresses                                            75
  138.    A.1.  SNMP engine Installation Parameters                         76
  139.    A.2.  Password to Key Algorithm                                   78
  140.    A.2.1.  Password to Key Sample Code for MD5                       79
  141.    A.2.2.  Password to Key Sample Code for SHA                       80
  142.    A.3.  Password to Key Sample Results                              81
  143.    A.3.1.  Password to Key Sample Results using MD5                  81
  144.    A.3.2.  Password to Key Sample Results using SHA                  81
  145.    A.4.  Sample encoding of msgSecurityParameters                    82
  146.    A.5.  Sample keyChange Results                                    83
  147.    A.5.1.  Sample keyChange Results using MD5                        83
  148.    A.5.2.  Sample keyChange Results using SHA                        84
  149.    B.  Change Log                                                    85
  150.    C.  Full Copyright Statement                                      86
  151.  
  152. 1.  Introduction
  153.  
  154.    The Architecture for describing Internet Management Frameworks
  155.    [RFC2571] describes that an SNMP engine is composed of:
  156.  
  157.      1) a Dispatcher
  158.      2) a Message Processing Subsystem,
  159.      3) a Security Subsystem, and
  160.      4) an Access Control Subsystem.
  161.  
  162.    Applications make use of the services of these subsystems.
  163.  
  164.    It is important to understand the SNMP architecture and the
  165.    terminology of the architecture to understand where the Security
  166.    Model described in this document fits into the architecture and
  167.  
  168.  
  169.  
  170. Blumenthal & Wijnen         Standards Track                     [Page 3]
  171.  
  172. RFC 2574                     USM for SNMPv3                   April 1999
  173.  
  174.  
  175.    interacts with other subsystems within the architecture.  The reader
  176.    is expected to have read and understood the description of the SNMP
  177.    architecture, as defined in [RFC2571].
  178.  
  179.    This memo [RFC2274] describes the User-based Security Model as it is
  180.    used within the SNMP Architecture.  The main idea is that we use the
  181.    traditional concept of a user (identified by a userName) with which
  182.    to associate security information.
  183.  
  184.    This memo describes the use of HMAC-MD5-96 and HMAC-SHA-96 as the
  185.    authentication protocols and the use of CBC-DES as the privacy
  186.    protocol. The User-based Security Model however allows for other such
  187.    protocols to be used instead of or concurrent with these protocols.
  188.    Therefore, the description of HMAC-MD5-96, HMAC-SHA-96 and CBC-DES
  189.    are in separate sections to reflect their self-contained nature and
  190.    to indicate that they can be replaced or supplemented in the future.
  191.  
  192.    The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
  193.    "SHOULD", "SHOULD NOT", "RECOMMENDED",  "MAY", and "OPTIONAL" in this
  194.    document are to be interpreted as described in [RFC2119].
  195.  
  196. 1.1.  Threats
  197.  
  198.    Several of the classical threats to network protocols are applicable
  199.    to the network management problem and therefore would be applicable
  200.    to any SNMP Security Model.  Other threats are not applicable to the
  201.    network management problem.  This section discusses principal
  202.    threats, secondary threats, and threats which are of lesser
  203.    importance.
  204.  
  205.    The principal threats against which this SNMP Security Model should
  206.    provide protection are:
  207.  
  208.    - Modification of Information
  209.      The modification threat is the danger that some unauthorized entity
  210.      may alter in-transit SNMP messages generated on behalf of an
  211.      authorized principal in such a way as to effect unauthorized
  212.      management operations, including falsifying the value of an object.
  213.  
  214.    - Masquerade
  215.      The masquerade threat is the danger that management operations not
  216.      authorized for some user may be attempted by assuming the identity
  217.      of another user that has the appropriate authorizations.
  218.  
  219.    Two secondary threats are also identified.  The Security Model
  220.    defined in this memo provides limited protection against:
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Blumenthal & Wijnen         Standards Track                     [Page 4]
  227.  
  228. RFC 2574                     USM for SNMPv3                   April 1999
  229.  
  230.  
  231.    - Disclosure
  232.      The disclosure threat is the danger of eavesdropping on the
  233.      exchanges between managed agents and a management station.
  234.      Protecting against this threat may be required as a matter of local
  235.      policy.
  236.  
  237.    - Message Stream Modification
  238.      The SNMP protocol is typically based upon a connection-less
  239.      transport service which may operate over any sub-network service.
  240.      The re-ordering, delay or replay of messages can and does occur
  241.      through the natural operation of many such sub-network services.
  242.      The message stream modification threat is the danger that messages
  243.      may be maliciously re-ordered, delayed or replayed to an extent
  244.      which is greater than can occur through the natural operation of a
  245.      sub-network service, in order to effect unauthorized management
  246.      operations.
  247.  
  248.    There are at least two threats that an SNMP Security Model need not
  249.    protect against.  The security protocols defined in this memo do not
  250.    provide protection against:
  251.  
  252.    - Denial of Service
  253.      This SNMP Security Model does not attempt to address the broad
  254.      range of attacks by which service on behalf of authorized users is
  255.      denied.  Indeed, such denial-of-service attacks are in many cases
  256.      indistinguishable from the type of network failures with which any
  257.      viable network management protocol must cope as a matter of course.
  258.    - Traffic Analysis
  259.      This SNMP Security Model does not attempt to address traffic
  260.      analysis attacks.  Indeed, many traffic patterns are predictable -
  261.      devices may be managed on a regular basis by a relatively small
  262.      number of management applications - and therefore there is no
  263.      significant advantage afforded by protecting against traffic
  264.      analysis.
  265.  
  266. 1.2.  Goals and Constraints
  267.  
  268.    Based on the foregoing account of threats in the SNMP network
  269.    management environment, the goals of this SNMP Security Model are as
  270.    follows.
  271.  
  272.    1) Provide for verification that each received SNMP message has
  273.       not been modified during its transmission through the network.
  274.  
  275.    2) Provide for verification of the identity of the user on whose
  276.       behalf a received SNMP message claims to have been generated.
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Blumenthal & Wijnen         Standards Track                     [Page 5]
  283.  
  284. RFC 2574                     USM for SNMPv3                   April 1999
  285.  
  286.  
  287.    3) Provide for detection of received SNMP messages, which request
  288.       or contain management information, whose time of generation was
  289.       not recent.
  290.  
  291.    4) Provide, when necessary, that the contents of each received
  292.       SNMP message are protected from disclosure.
  293.  
  294.    In addition to the principal goal of supporting secure network
  295.    management, the design of this SNMP Security Model is also influenced
  296.    by the following constraints:
  297.  
  298.    1) When the requirements of effective management in times of
  299.       network stress are inconsistent with those of security, the design
  300.       should prefer the former.
  301.  
  302.    2) Neither the security protocol nor its underlying security
  303.       mechanisms should depend upon the ready availability of other
  304.       network services (e.g., Network Time Protocol (NTP) or key
  305.       management protocols).
  306.  
  307.    3) A security mechanism should entail no changes to the basic
  308.       SNMP network management philosophy.
  309.  
  310. 1.3.  Security Services
  311.  
  312.    The security services necessary to support the goals of this SNMP
  313.    Security Model are as follows:
  314.  
  315.    - Data Integrity
  316.      is the provision of the property that data has not been altered or
  317.      destroyed in an unauthorized manner, nor have data sequences been
  318.      altered to an extent greater than can occur non-maliciously.
  319.  
  320.    - Data Origin Authentication
  321.      is the provision of the property that the claimed identity of the
  322.      user on whose behalf received data was originated is corroborated.
  323.  
  324.    - Data Confidentiality
  325.      is the provision of the property that information is not made
  326.      available or disclosed to unauthorized individuals, entities, or
  327.      processes.
  328.  
  329.    - Message timeliness and limited replay protection
  330.      is the provision of the property that a message whose generation
  331.      time is outside of a specified time window is not accepted.  Note
  332.      that message reordering is not dealt with and can occur in normal
  333.      conditions too.
  334.  
  335.  
  336.  
  337.  
  338. Blumenthal & Wijnen         Standards Track                     [Page 6]
  339.  
  340. RFC 2574                     USM for SNMPv3                   April 1999
  341.  
  342.  
  343.    For the protocols specified in this memo, it is not possible to
  344.    assure the specific originator of a received SNMP message; rather, it
  345.    is the user on whose behalf the message was originated that is
  346.    authenticated.
  347.  
  348.    For these protocols, it not possible to obtain data integrity without
  349.    data origin authentication, nor is it possible to obtain data origin
  350.    authentication without data integrity.  Further, there is no
  351.    provision for data confidentiality without both data integrity and
  352.    data origin authentication.
  353.  
  354.    The security protocols used in this memo are considered acceptably
  355.    secure at the time of writing.  However, the procedures allow for new
  356.    authentication and privacy methods to be specified at a future time
  357.    if the need arises.
  358.  
  359. 1.4.  Module Organization
  360.  
  361.    The security protocols defined in this memo are split in three
  362.    different modules and each has its specific responsibilities such
  363.    that together they realize the goals and security services described
  364.    above:
  365.  
  366.    - The authentication module MUST provide for:
  367.  
  368.      - Data Integrity,
  369.  
  370.      - Data Origin Authentication
  371.  
  372.    - The timeliness module MUST provide for:
  373.  
  374.      - Protection against message delay or replay (to an extent
  375.        greater than can occur through normal operation)
  376.  
  377.    - The privacy module MUST provide for
  378.  
  379.      - Protection against disclosure of the message payload.
  380.  
  381.    The timeliness module is fixed for the User-based Security Model
  382.    while there is provision for multiple authentication and/or privacy
  383.    modules, each of which implements a specific authentication or
  384.    privacy protocol respectively.
  385.  
  386. 1.4.1.  Timeliness Module
  387.  
  388.    Section 3 (Elements of Procedure) uses the timeliness values in an
  389.    SNMP message to do timeliness checking.  The timeliness check is only
  390.    performed if authentication is applied to the message.  Since the
  391.  
  392.  
  393.  
  394. Blumenthal & Wijnen         Standards Track                     [Page 7]
  395.  
  396. RFC 2574                     USM for SNMPv3                   April 1999
  397.  
  398.  
  399.    complete message is checked for integrity, we can assume that the
  400.    timeliness values in a message that passes the authentication module
  401.    are trustworthy.
  402.  
  403. 1.4.2.  Authentication Protocol
  404.  
  405.    Section 6 describes the HMAC-MD5-96 authentication protocol which is
  406.    the first authentication protocol that MUST be supported with the
  407.    User-based Security Model.  Section 7 describes the HMAC-SHA-96
  408.    authentication protocol which is another authentication protocol that
  409.    SHOULD be supported with the User-based Security Model.  In the
  410.    future additional or replacement authentication protocols may be
  411.    defined as new needs arise.
  412.  
  413.    The User-based Security Model prescribes that, if authentication is
  414.    used, then the complete message is checked for integrity in the
  415.    authentication module.
  416.  
  417.    For a message to be authenticated, it needs to pass authentication
  418.    check by the authentication module and the timeliness check which is
  419.    a fixed part of this User-based Security model.
  420.  
  421. 1.4.3.  Privacy Protocol
  422.  
  423.    Section 8 describes the CBC-DES Symmetric Encryption Protocol which
  424.    is the first privacy protocol to be used with the User-based Security
  425.    Model.  In the future additional or replacement privacy protocols may
  426.    be defined as new needs arise.
  427.  
  428.    The User-based Security Model prescribes that the scopedPDU is
  429.    protected from disclosure when a message is sent with privacy.
  430.  
  431.    The User-based Security Model also prescribes that a message needs to
  432.    be authenticated if privacy is in use.
  433.  
  434. 1.5.  Protection against Message Replay, Delay and Redirection
  435.  
  436. 1.5.1.  Authoritative SNMP engine
  437.  
  438.    In order to protect against message replay, delay and redirection,
  439.    one of the SNMP engines involved in each communication is designated
  440.    to be the authoritative SNMP engine.  When an SNMP message contains a
  441.    payload which expects a response (those messages that contain a
  442.    Confirmed Class PDU [RFC2571]), then the receiver of such messages is
  443.    authoritative.  When an SNMP message contains a payload which does
  444.    not expect a response (those messages that contain an Unconfirmed
  445.    Class PDU [RFC2571]), then the sender of such a message is
  446.    authoritative.
  447.  
  448.  
  449.  
  450. Blumenthal & Wijnen         Standards Track                     [Page 8]
  451.  
  452. RFC 2574                     USM for SNMPv3                   April 1999
  453.  
  454.  
  455. 1.5.2.  Mechanisms
  456.  
  457.    The following mechanisms are used:
  458.  
  459.    1) To protect against the threat of message delay or replay (to an
  460.       extent greater than can occur through normal operation), a set of
  461.       timeliness indicators (for the authoritative SNMP engine) are
  462.       included in each message generated.  An SNMP engine evaluates the
  463.       timeliness indicators to determine if a received message is
  464.       recent.  An SNMP engine may evaluate the timeliness indicators to
  465.       ensure that a received message is at least as recent as the last
  466.       message it received from the same source.  A non-authoritative
  467.       SNMP engine uses received authentic messages to advance its notion
  468.       of the timeliness indicators at the remote authoritative source.
  469.  
  470.       An SNMP engine MUST also use a mechanism to match incoming
  471.       Responses to outstanding Requests and it MUST drop any Responses
  472.       that do not match an outstanding request. For example, a msgID can
  473.       be inserted in every message to cater for this functionality.
  474.  
  475.       These mechanisms provide for the detection of authenticated
  476.       messages whose time of generation was not recent.
  477.  
  478.       This protection against the threat of message delay or replay does
  479.       not imply nor provide any protection against unauthorized deletion
  480.       or suppression of messages.  Also, an SNMP engine may not be able
  481.       to detect message reordering if all the messages involved are sent
  482.       within the Time Window interval.  Other mechanisms defined
  483.       independently of the security protocol can also be used to detect
  484.       the re-ordering replay, deletion, or suppression of messages
  485.       containing Set operations (e.g., the MIB variable snmpSetSerialNo
  486.       [RFC1907]).
  487.  
  488.    2) Verification that a message sent to/from one authoritative SNMP
  489.       engine cannot be replayed to/as-if-from another authoritative SNMP
  490.       engine.
  491.  
  492.       Included in each message is an identifier unique to the
  493.       authoritative SNMP engine associated with the sender or intended
  494.       recipient of the message.
  495.  
  496.       A message containing an Unconfirmed Class PDU sent by an
  497.       authoritative SNMP engine to one non-authoritative SNMP engine can
  498.       potentially be replayed to another non-authoritative SNMP engine.
  499.       The latter non-authoritative SNMP engine might (if it knows about
  500.       the same userName with the same secrets at the authoritative SNMP
  501.       engine) as a result update its notion of timeliness indicators of
  502.       the authoritative SNMP engine, but that is not considered a
  503.  
  504.  
  505.  
  506. Blumenthal & Wijnen         Standards Track                     [Page 9]
  507.  
  508. RFC 2574                     USM for SNMPv3                   April 1999
  509.  
  510.  
  511.       threat.  In this case, A Report or Response message will be
  512.       discarded by the Message Processing Model, because there should
  513.       not be an outstanding Request message. A Trap will possibly be
  514.       accepted.  Again, that is not considered a threat, because the
  515.       communication was authenticated and timely. It is as if the
  516.       authoritative SNMP engine was configured to start sending Traps to
  517.       the second SNMP engine, which theoretically can happen without the
  518.       knowledge of the second SNMP engine anyway. Anyway, the second
  519.       SNMP engine may not expect to receive this Trap, but is allowed to
  520.       see the management information contained in it.
  521.  
  522.    3) Detection of messages which were not recently generated.
  523.  
  524.       A set of time indicators are included in the message, indicating
  525.       the time of generation.  Messages without recent time indicators
  526.       are not considered authentic.  In addition, an SNMP engine MUST
  527.       drop any Responses that do not match an outstanding request. This
  528.       however is the responsibility of the Message Processing Model.
  529.  
  530.    This memo allows the same user to be defined on multiple SNMP
  531.    engines.  Each SNMP engine maintains a value, snmpEngineID, which
  532.    uniquely identifies the SNMP engine.  This value is included in each
  533.    message sent to/from the SNMP engine that is authoritative (see
  534.    section 1.5.1).  On receipt of a message, an authoritative SNMP
  535.    engine checks the value to ensure that it is the intended recipient,
  536.    and a non-authoritative SNMP engine uses the value to ensure that the
  537.    message is processed using the correct state information.
  538.  
  539.    Each SNMP engine maintains two values, snmpEngineBoots and
  540.    snmpEngineTime, which taken together provide an indication of time at
  541.    that SNMP engine.  Both of these values are included in an
  542.    authenticated message sent to/received from that SNMP engine.  On
  543.    receipt, the values are checked to ensure that the indicated
  544.    timeliness value is within a Time Window of the current time.  The
  545.    Time Window represents an administrative upper bound on acceptable
  546.    delivery delay for protocol messages.
  547.  
  548.    For an SNMP engine to generate a message which an authoritative SNMP
  549.    engine will accept as authentic, and to verify that a message
  550.    received from that authoritative SNMP engine is authentic, such an
  551.    SNMP engine must first achieve timeliness synchronization with the
  552.    authoritative SNMP engine. See section 2.3.
  553.  
  554. 1.6.  Abstract Service Interfaces
  555.  
  556.    Abstract service interfaces have been defined to describe the
  557.    conceptual interfaces between the various subsystems within an SNMP
  558.    entity. Similarly a set of abstract service interfaces have been
  559.  
  560.  
  561.  
  562. Blumenthal & Wijnen         Standards Track                    [Page 10]
  563.  
  564. RFC 2574                     USM for SNMPv3                   April 1999
  565.  
  566.  
  567.    defined within the User-based Security Model (USM) to describe the
  568.    conceptual interfaces between the generic USM services and the self-
  569.    contained authentication and privacy services.
  570.  
  571.    These abstract service interfaces are defined by a set of primitives
  572.    that define the services provided and the abstract data elements that
  573.    must be passed when the services are invoked. This section lists the
  574.    primitives that have been defined for the User-based Security Model.
  575.  
  576. 1.6.1.  User-based Security Model Primitives for Authentication
  577.  
  578.    The User-based Security Model provides the following internal
  579.    primitives to pass data back and forth between the Security Model
  580.    itself and the authentication service:
  581.  
  582.    statusInformation =
  583.      authenticateOutgoingMsg(
  584.      IN   authKey                   -- secret key for authentication
  585.      IN   wholeMsg                  -- unauthenticated complete message
  586.      OUT  authenticatedWholeMsg     -- complete authenticated message
  587.           )
  588.  
  589.    statusInformation =
  590.      authenticateIncomingMsg(
  591.      IN   authKey                   -- secret key for authentication
  592.      IN   authParameters            -- as received on the wire
  593.      IN   wholeMsg                  -- as received on the wire
  594.      OUT  authenticatedWholeMsg     -- complete authenticated message
  595.           )
  596.  
  597. 1.6.2.  User-based Security Model Primitives for Privacy
  598.  
  599.    The User-based Security Model provides the following internal
  600.    primitives to pass data back and forth between the Security Model
  601.    itself and the privacy service:
  602.  
  603.    statusInformation =
  604.      encryptData(
  605.      IN    encryptKey               -- secret key for encryption
  606.      IN    dataToEncrypt            -- data to encrypt (scopedPDU)
  607.      OUT   encryptedData            -- encrypted data (encryptedPDU)
  608.      OUT   privParameters           -- filled in by service provider
  609.            )
  610.  
  611.    statusInformation =
  612.      decryptData(
  613.      IN    decryptKey               -- secret key for decrypting
  614.      IN    privParameters           -- as received on the wire
  615.  
  616.  
  617.  
  618. Blumenthal & Wijnen         Standards Track                    [Page 11]
  619.  
  620. RFC 2574                     USM for SNMPv3                   April 1999
  621.  
  622.  
  623.      IN    encryptedData            -- encrypted data (encryptedPDU)
  624.      OUT   decryptedData            -- decrypted data (scopedPDU)
  625.               )
  626.  
  627. 2.  Elements of the Model
  628.  
  629.    This section contains definitions required to realize the security
  630.    model defined by this memo.
  631.  
  632. 2.1.  User-based Security Model Users
  633.  
  634.    Management operations using this Security Model make use of a defined
  635.    set of user identities.  For any user on whose behalf management
  636.    operations are authorized at a particular SNMP engine, that SNMP
  637.    engine must have knowledge of that user.  An SNMP engine that wishes
  638.    to communicate with another SNMP engine must also have knowledge of a
  639.    user known to that engine, including knowledge of the applicable
  640.    attributes of that user.
  641.  
  642.    A user and its attributes are defined as follows:
  643.  
  644.    userName
  645.      A string representing the name of the user.
  646.  
  647.    securityName
  648.      A human-readable string representing the user in a format that is
  649.      Security Model independent.
  650.  
  651.    authProtocol
  652.      An indication of whether messages sent on behalf of this user can
  653.      be authenticated, and if so, the type of authentication protocol
  654.      which is used.  Two such protocols are defined in this memo:
  655.  
  656.        - the HMAC-MD5-96 authentication protocol.
  657.        - the HMAC-SHA-96 authentication protocol.
  658.  
  659.    authKey
  660.      If messages sent on behalf of this user can be authenticated,
  661.      the (private) authentication key for use with the authentication
  662.      protocol.  Note that a user's authentication key will normally
  663.      be different at different authoritative SNMP engines. The authKey
  664.      is not accessible via SNMP. The length requirements of the authKey
  665.      are defined by the authProtocol in use.
  666.  
  667.    authKeyChange and authOwnKeyChange
  668.      The only way to remotely update the authentication key.  Does
  669.      that in a secure manner, so that the update can be completed
  670.      without the need to employ privacy protection.
  671.  
  672.  
  673.  
  674. Blumenthal & Wijnen         Standards Track                    [Page 12]
  675.  
  676. RFC 2574                     USM for SNMPv3                   April 1999
  677.  
  678.  
  679.    privProtocol
  680.      An indication of whether messages sent on behalf of this user
  681.      can be protected from disclosure, and if so, the type of privacy
  682.      protocol which is used.  One such protocol is defined in this
  683.      memo: the CBC-DES Symmetric Encryption Protocol.
  684.  
  685.    privKey
  686.      If messages sent on behalf of this user can be en/decrypted,
  687.      the (private) privacy key for use with the privacy protocol.
  688.      Note that a user's privacy key will normally be different at
  689.      different authoritative SNMP engines. The privKey is not
  690.      accessible via SNMP. The length requirements of the privKey are
  691.      defined by the privProtocol in use.
  692.  
  693.    privKeyChange and privOwnKeyChange
  694.      The only way to remotely update the encryption key. Does that
  695.      in a secure manner, so that the update can be completed without
  696.      the need to employ privacy protection.
  697.  
  698. 2.2.  Replay Protection
  699.  
  700.    Each SNMP engine maintains three objects:
  701.  
  702.    - snmpEngineID, which (at least within an administrative domain)
  703.      uniquely and unambiguously identifies an SNMP engine.
  704.  
  705.    - snmpEngineBoots, which is a count of the number of times the
  706.      SNMP engine has re-booted/re-initialized since snmpEngineID
  707.      was last configured; and,
  708.  
  709.    - snmpEngineTime, which is the number of seconds since the
  710.      snmpEngineBoots counter was last incremented.
  711.  
  712.    Each SNMP engine is always authoritative with respect to these
  713.    objects in its own SNMP entity.  It is the responsibility of a
  714.    non-authoritative SNMP engine to synchronize with the
  715.    authoritative SNMP engine, as appropriate.
  716.  
  717.    An authoritative SNMP engine is required to maintain the values of
  718.    its snmpEngineID and snmpEngineBoots in non-volatile storage.
  719.  
  720. 2.2.1.  msgAuthoritativeEngineID
  721.  
  722.    The msgAuthoritativeEngineID value contained in an authenticated
  723.    message is used to defeat attacks in which messages from one SNMP
  724.    engine to another SNMP engine are replayed to a different SNMP
  725.    engine. It represents the snmpEngineID at the authoritative SNMP
  726.    engine involved in the exchange of the message.
  727.  
  728.  
  729.  
  730. Blumenthal & Wijnen         Standards Track                    [Page 13]
  731.  
  732. RFC 2574                     USM for SNMPv3                   April 1999
  733.  
  734.  
  735.    When an authoritative SNMP engine is first installed, it sets its
  736.    local value of snmpEngineID according to a enterprise-specific
  737.    algorithm (see the definition of the Textual Convention for
  738.    SnmpEngineID in the SNMP Architecture document [RFC2571]).
  739.  
  740. 2.2.2.  msgAuthoritativeEngineBoots and msgAuthoritativeEngineTime
  741.  
  742.    The msgAuthoritativeEngineBoots and msgAuthoritativeEngineTime
  743.    values contained in an authenticated message are used to defeat
  744.    attacks in which messages are replayed when they are no longer
  745.    valid.  They represent the snmpEngineBoots and snmpEngineTime
  746.    values at the authoritative SNMP engine involved in the exchange
  747.    of the message.
  748.  
  749.    Through use of snmpEngineBoots and snmpEngineTime, there is no
  750.    requirement for an SNMP engine to have a non-volatile clock which
  751.    ticks (i.e., increases with the passage of time) even when the
  752.    SNMP engine is powered off.  Rather, each time an SNMP engine
  753.    re-boots, it retrieves, increments, and then stores snmpEngineBoots
  754.    in non-volatile storage, and resets snmpEngineTime to zero.
  755.  
  756.    When an SNMP engine is first installed, it sets its local values
  757.    of snmpEngineBoots and snmpEngineTime to zero.  If snmpEngineTime
  758.    ever reaches its maximum value (2147483647), then snmpEngineBoots
  759.    is incremented as if the SNMP engine has re-booted and
  760.    snmpEngineTime is reset to zero and starts incrementing again.
  761.  
  762.    Each time an authoritative SNMP engine re-boots, any SNMP engines
  763.    holding that authoritative SNMP engine's values of snmpEngineBoots
  764.    and snmpEngineTime need to re-synchronize prior to sending
  765.    correctly authenticated messages to that authoritative SNMP engine
  766.    (see Section 2.3 for (re-)synchronization procedures).  Note,
  767.    however, that the procedures do provide for a notification to be
  768.    accepted as authentic by a receiving SNMP engine, when sent by an
  769.    authoritative SNMP engine which has re-booted since the receiving
  770.    SNMP engine last (re-)synchronized.
  771.  
  772.    If an authoritative SNMP engine is ever unable to determine its
  773.    latest snmpEngineBoots value, then it must set its snmpEngineBoots
  774.    value to 2147483647.
  775.  
  776.    Whenever the local value of snmpEngineBoots has the value 2147483647
  777.    it latches at that value and an authenticated message always causes
  778.    an notInTimeWindow authentication failure.
  779.  
  780.    In order to reset an SNMP engine whose snmpEngineBoots value has
  781.    reached the value 2147483647, manual intervention is required.
  782.    The engine must be physically visited and re-configured, either
  783.  
  784.  
  785.  
  786. Blumenthal & Wijnen         Standards Track                    [Page 14]
  787.  
  788. RFC 2574                     USM for SNMPv3                   April 1999
  789.  
  790.  
  791.    with a new snmpEngineID value, or with new secret values for the
  792.    authentication and privacy protocols of all users known to that
  793.    SNMP engine. Note that even if an SNMP engine re-boots once a second
  794.    that it would still take approximately 68 years before the max value
  795.    of 2147483647 would be reached.
  796.  
  797. 2.2.3.  Time Window
  798.  
  799.    The Time Window is a value that specifies the window of time in
  800.    which a message generated on behalf of any user is valid.  This
  801.    memo specifies that the same value of the Time Window, 150 seconds,
  802.    is used for all users.
  803.  
  804. 2.3.  Time Synchronization
  805.  
  806.    Time synchronization, required by a non-authoritative SNMP engine
  807.    in order to proceed with authentic communications, has occurred
  808.    when the non-authoritative SNMP engine has obtained a local notion
  809.    of the authoritative SNMP engine's values of snmpEngineBoots and
  810.    snmpEngineTime from the authoritative SNMP engine.  These values
  811.    must be (and remain) within the authoritative SNMP engine's Time
  812.    Window.  So the local notion of the authoritative SNMP engine's
  813.    values must be kept loosely synchronized with the values stored
  814.    at the authoritative SNMP engine.  In addition to keeping a local
  815.    copy of snmpEngineBoots and snmpEngineTime from the authoritative
  816.    SNMP engine, a non-authoritative SNMP engine must also keep one
  817.    local variable, latestReceivedEngineTime.  This value records the
  818.    highest value of snmpEngineTime that was received by the
  819.    non-authoritative SNMP engine from the authoritative SNMP engine
  820.    and is used to eliminate the possibility of replaying messages
  821.    that would prevent the non-authoritative SNMP engine's notion of
  822.    the snmpEngineTime from advancing.
  823.  
  824.    A non-authoritative SNMP engine must keep local notions of these
  825.    values
  826.    (snmpEngineBoots, snmpEngineTime and latestReceivedEngineTime)
  827.    for each authoritative SNMP engine with which it wishes to
  828.    communicate.  Since each authoritative SNMP engine is uniquely
  829.    and unambiguously identified by its value of snmpEngineID, the
  830.    non-authoritative SNMP engine may use this value as a key in
  831.    order to cache its local notions of these values.
  832.  
  833.    Time synchronization occurs as part of the procedures of receiving
  834.    an SNMP message (Section 3.2, step 7b). As such, no explicit time
  835.    synchronization procedure is required by a non-authoritative SNMP
  836.    engine.  Note, that whenever the local value of snmpEngineID is
  837.    changed (e.g., through discovery) or when secure communications
  838.    are first established with an authoritative SNMP engine, the local
  839.  
  840.  
  841.  
  842. Blumenthal & Wijnen         Standards Track                    [Page 15]
  843.  
  844. RFC 2574                     USM for SNMPv3                   April 1999
  845.  
  846.  
  847.    values of snmpEngineBoots and latestReceivedEngineTime should be
  848.    set to zero.  This will cause the time synchronization to occur
  849.    when the next authentic message is received.
  850.  
  851. 2.4.  SNMP Messages Using this Security Model
  852.  
  853.    The syntax of an SNMP message using this Security Model adheres
  854.    to the message format defined in the version-specific Message
  855.    Processing Model document (for example [RFC2572]).
  856.  
  857.    The field msgSecurityParameters in SNMPv3 messages has a data type
  858.    of OCTET STRING.  Its value is the BER serialization of the
  859.    following ASN.1 sequence:
  860.  
  861.    USMSecurityParametersSyntax DEFINITIONS IMPLICIT TAGS ::= BEGIN
  862.  
  863.       UsmSecurityParameters ::=
  864.           SEQUENCE {
  865.            -- global User-based security parameters
  866.               msgAuthoritativeEngineID     OCTET STRING,
  867.               msgAuthoritativeEngineBoots  INTEGER (0..2147483647),
  868.               msgAuthoritativeEngineTime   INTEGER (0..2147483647),
  869.               msgUserName                  OCTET STRING (SIZE(0..32)),
  870.            -- authentication protocol specific parameters
  871.               msgAuthenticationParameters  OCTET STRING,
  872.            -- privacy protocol specific parameters
  873.               msgPrivacyParameters         OCTET STRING
  874.           }
  875.    END
  876.  
  877.    The fields of this sequence are:
  878.  
  879.    - The msgAuthoritativeEngineID specifies the snmpEngineID of the
  880.      authoritative SNMP engine involved in the exchange of the message.
  881.  
  882.    - The msgAuthoritativeEngineBoots specifies the snmpEngineBoots value
  883.      at the authoritative SNMP engine involved in the exchange of the
  884.      message.
  885.  
  886.    - The msgAuthoritativeEngineTime specifies the snmpEngineTime value
  887.      at the authoritative SNMP engine involved in the exchange of the
  888.      message.
  889.  
  890.    - The msgUserName specifies the user (principal) on whose behalf the
  891.      message is being exchanged.  Note that a zero-length userName will
  892.      not match any user, but it can be used for snmpEngineID discovery.
  893.  
  894.  
  895.  
  896.  
  897.  
  898. Blumenthal & Wijnen         Standards Track                    [Page 16]
  899.  
  900. RFC 2574                     USM for SNMPv3                   April 1999
  901.  
  902.  
  903.    - The msgAuthenticationParameters are defined by the authentication
  904.      protocol in use for the message, as defined by the
  905.      usmUserAuthProtocol column in the user's entry in the usmUserTable.
  906.  
  907.    - The msgPrivacyParameters are defined by the privacy protocol in use
  908.      for the message, as defined by the usmUserPrivProtocol column in
  909.      the user's entry in the usmUserTable).
  910.  
  911.    See appendix A.4 for an example of the BER encoding of field
  912.    msgSecurityParameters.
  913.  
  914. 2.5.  Services provided by the User-based Security Model
  915.  
  916.    This section describes the services provided by the User-based
  917.    Security Model with their inputs and outputs.
  918.  
  919.    The services are described as primitives of an abstract service
  920.    interface and the inputs and outputs are described as abstract data
  921.    elements as they are passed in these abstract service primitives.
  922.  
  923. 2.5.1.  Services for Generating an Outgoing SNMP Message
  924.  
  925.    When the Message Processing (MP) Subsystem invokes the User-based
  926.    Security module to secure an outgoing SNMP message, it must use the
  927.    appropriate service as provided by the Security module.  These two
  928.    services are provided:
  929.  
  930.    1) A service to generate a Request message. The abstract service
  931.       primitive is:
  932.  
  933.       statusInformation =            -- success or errorIndication
  934.         generateRequestMsg(
  935.         IN   messageProcessingModel  -- typically, SNMP version
  936.         IN   globalData              -- message header, admin data
  937.         IN   maxMessageSize          -- of the sending SNMP entity
  938.         IN   securityModel           -- for the outgoing message
  939.         IN   securityEngineID        -- authoritative SNMP entity
  940.         IN   securityName            -- on behalf of this principal
  941.         IN   securityLevel           -- Level of Security requested
  942.         IN   scopedPDU               -- message (plaintext) payload
  943.         OUT  securityParameters      -- filled in by Security Module
  944.         OUT  wholeMsg                -- complete generated message
  945.         OUT  wholeMsgLength          -- length of generated message
  946.              )
  947.  
  948.    2) A service to generate a Response message. The abstract service
  949.       primitive is:
  950.  
  951.  
  952.  
  953.  
  954. Blumenthal & Wijnen         Standards Track                    [Page 17]
  955.  
  956. RFC 2574                     USM for SNMPv3                   April 1999
  957.  
  958.  
  959.       statusInformation =            -- success or errorIndication
  960.         generateResponseMsg(
  961.         IN   messageProcessingModel  -- typically, SNMP version
  962.         IN   globalData              -- message header, admin data
  963.         IN   maxMessageSize          -- of the sending SNMP entity
  964.         IN   securityModel           -- for the outgoing message
  965.         IN   securityEngineID        -- authoritative SNMP entity
  966.         IN   securityName            -- on behalf of this principal
  967.         IN   securityLevel           -- Level of Security requested
  968.         IN   scopedPDU               -- message (plaintext) payload
  969.         IN   securityStateReference  -- reference to security state
  970.                                      -- information from original
  971.                                      -- request
  972.         OUT  securityParameters      -- filled in by Security Module
  973.         OUT  wholeMsg                -- complete generated message
  974.         OUT  wholeMsgLength          -- length of generated message
  975.              )
  976.  
  977.    The abstract data elements passed as parameters in the abstract
  978.    service primitives are as follows:
  979.  
  980.     statusInformation
  981.       An indication of whether the encoding and securing of the message
  982.       was successful.  If not it is an indication of the problem.
  983.     messageProcessingModel
  984.       The SNMP version number for the message to be generated.  This
  985.       data is not used by the User-based Security module.
  986.     globalData
  987.       The message header (i.e., its administrative information). This
  988.       data is not used by the User-based Security module.
  989.     maxMessageSize
  990.       The maximum message size as included in the message.  This data is
  991.       not used by the User-based Security module.
  992.     securityParameters
  993.       These are the security parameters. They will be filled in by the
  994.       User-based Security module.
  995.  
  996.     securityModel
  997.       The securityModel in use. Should be User-based Security Model.
  998.       This data is not used by the User-based Security module.
  999.     securityName
  1000.       Together with the snmpEngineID it identifies a row in the
  1001.       usmUserTable that is to be used for securing the message.  The
  1002.       securityName has a format that is independent of the Security
  1003.       Model. In case of a response this parameter is ignored and the
  1004.       value from the cache is used.
  1005.  
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Blumenthal & Wijnen         Standards Track                    [Page 18]
  1011.  
  1012. RFC 2574                     USM for SNMPv3                   April 1999
  1013.  
  1014.  
  1015.     securityLevel
  1016.       The Level of Security from which the User-based Security module
  1017.       determines if the message needs to be protected from disclosure
  1018.       and if the message needs to be authenticated.
  1019.     securityEngineID
  1020.       The snmpEngineID of the authoritative SNMP engine to which a
  1021.       Request message is to be sent. In case of a response it is implied
  1022.       to be the processing SNMP engine's snmpEngineID and so if it is
  1023.       specified, then it is ignored.
  1024.     scopedPDU
  1025.       The message payload.  The data is opaque as far as the User-based
  1026.       Security Model is concerned.
  1027.     securityStateReference
  1028.       A handle/reference to cachedSecurityData to be used when securing
  1029.       an outgoing Response message.  This is the exact same
  1030.       handle/reference as it was generated by the User-based Security
  1031.       module when processing the incoming Request message to which this
  1032.       is the Response message.
  1033.     wholeMsg
  1034.       The fully encoded and secured message ready for sending on the
  1035.       wire.
  1036.     wholeMsgLength
  1037.       The length of the encoded and secured message (wholeMsg).
  1038.  
  1039.    Upon completion of the process, the User-based Security module
  1040.    returns statusInformation. If the process was successful, the
  1041.    completed message with privacy and authentication applied if such was
  1042.    requested by the specified securityLevel is returned. If the process
  1043.    was not successful, then an errorIndication is returned.
  1044.  
  1045. 2.5.2.  Services for Processing an Incoming SNMP Message
  1046.  
  1047.    When the Message Processing (MP) Subsystem invokes the User-based
  1048.    Security module to verify proper security of an incoming message, it
  1049.    must use the service provided for an incoming message. The abstract
  1050.    service primitive is:
  1051.  
  1052.    statusInformation =             -- errorIndication or success
  1053.                                    -- error counter OID/value if error
  1054.      processIncomingMsg(
  1055.      IN   messageProcessingModel   -- typically, SNMP version
  1056.      IN   maxMessageSize           -- of the sending SNMP entity
  1057.      IN   securityParameters       -- for the received message
  1058.      IN   securityModel            -- for the received message
  1059.      IN   securityLevel            -- Level of Security
  1060.      IN   wholeMsg                 -- as received on the wire
  1061.      IN   wholeMsgLength           -- length as received on the wire
  1062.      OUT  securityEngineID         -- authoritative SNMP entity
  1063.  
  1064.  
  1065.  
  1066. Blumenthal & Wijnen         Standards Track                    [Page 19]
  1067.  
  1068. RFC 2574                     USM for SNMPv3                   April 1999
  1069.  
  1070.  
  1071.      OUT  securityName             -- identification of the principal
  1072.      OUT  scopedPDU,               -- message (plaintext) payload
  1073.      OUT  maxSizeResponseScopedPDU -- maximum size of the Response PDU
  1074.      OUT  securityStateReference   -- reference to security state
  1075.           )                        -- information, needed for response
  1076.  
  1077.    The abstract data elements passed as parameters in the abstract
  1078.    service primitives are as follows:
  1079.  
  1080.     statusInformation
  1081.       An indication of whether the process was successful or not.  If
  1082.       not, then the statusInformation includes the OID and the value of
  1083.       the error counter that was incremented.
  1084.     messageProcessingModel
  1085.       The SNMP version number as received in the message.  This data is
  1086.       not used by the User-based Security module.
  1087.     maxMessageSize
  1088.       The maximum message size as included in the message.  The User-
  1089.       based Security module uses this value to calculate the
  1090.       maxSizeResponseScopedPDU.
  1091.     securityParameters
  1092.       These are the security parameters as received in the message.
  1093.     securityModel
  1094.       The securityModel in use.  Should be the User-based Security
  1095.       Model.  This data is not used by the User-based Security module.
  1096.     securityLevel
  1097.       The Level of Security from which the User-based Security module
  1098.       determines if the message needs to be protected from disclosure
  1099.       and if the message needs to be authenticated.
  1100.     wholeMsg
  1101.       The whole message as it was received.
  1102.     wholeMsgLength
  1103.       The length of the message as it was received (wholeMsg).
  1104.     securityEngineID
  1105.       The snmpEngineID that was extracted from the field
  1106.       msgAuthoritativeEngineID and that was used to lookup the secrets
  1107.       in the usmUserTable.
  1108.     securityName
  1109.       The security name representing the user on whose behalf the
  1110.       message was received.  The securityName has a format that is
  1111.       independent of the Security Model.
  1112.     scopedPDU
  1113.       The message payload.  The data is opaque as far as the User-based
  1114.       Security Model is concerned.
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.  
  1121.  
  1122. Blumenthal & Wijnen         Standards Track                    [Page 20]
  1123.  
  1124. RFC 2574                     USM for SNMPv3                   April 1999
  1125.  
  1126.  
  1127.     maxSizeResponseScopedPDU
  1128.       The maximum size of a scopedPDU to be included in a possible
  1129.       Response message.  The User-based Security module calculates this
  1130.       size based on the msgMaxSize (as received in the message) and the
  1131.       space required for the message header (including the
  1132.       securityParameters) for such a Response message.
  1133.     securityStateReference
  1134.       A handle/reference to cachedSecurityData to be used when securing
  1135.       an outgoing Response message.  When the Message Processing
  1136.       Subsystem calls the User-based Security module to generate a
  1137.       response to this incoming message it must pass this
  1138.       handle/reference.
  1139.  
  1140.    Upon completion of the process, the User-based Security module
  1141.    returns statusInformation and, if the process was successful, the
  1142.    additional data elements for further processing of the message.  If
  1143.    the process was not successful, then an errorIndication, possibly
  1144.    with a OID and value pair of an error counter that was incremented.
  1145.  
  1146. 2.6.  Key Localization Algorithm.
  1147.  
  1148.    A localized key is a secret key shared between a user U and one
  1149.    authoritative SNMP engine E.  Even though a user may have only one
  1150.    password and therefore one key for the whole network, the actual
  1151.    secrets shared between the user and each authoritative SNMP engine
  1152.    will be different. This is achieved by key localization [Localized-
  1153.    key].
  1154.  
  1155.    First, if a user uses a password, then the user's password is
  1156.    converted into a key Ku using one of the two algorithms described in
  1157.    Appendices A.2.1 and A.2.2.
  1158.  
  1159.    To convert key Ku into a localized key Kul of user U at the
  1160.    authoritative SNMP engine E, one appends the snmpEngineID of the
  1161.    authoritative SNMP engine to the key Ku and then appends the key Ku
  1162.    to the result, thus enveloping the snmpEngineID within the two copies
  1163.    of user's key Ku. Then one runs a secure hash function (which one
  1164.    depends on the authentication protocol defined for this user U at
  1165.    authoritative SNMP engine E; this document defines two authentication
  1166.    protocols with their associated algorithms based on MD5 and SHA). The
  1167.    output of the hash-function is the localized key Kul for user U at
  1168.    the authoritative SNMP engine E.
  1169.  
  1170. 3.  Elements of Procedure
  1171.  
  1172.    This section describes the security related procedures followed by an
  1173.    SNMP engine when processing SNMP messages according to the User-based
  1174.    Security Model.
  1175.  
  1176.  
  1177.  
  1178. Blumenthal & Wijnen         Standards Track                    [Page 21]
  1179.  
  1180. RFC 2574                     USM for SNMPv3                   April 1999
  1181.  
  1182.  
  1183. 3.1.  Generating an Outgoing SNMP Message
  1184.  
  1185.    This section describes the procedure followed by an SNMP engine
  1186.    whenever it generates a message containing a management operation
  1187.    (like a request, a response, a notification, or a report) on behalf
  1188.    of a user, with a particular securityLevel.
  1189.  
  1190.    1)  a) If any securityStateReference is passed (Response or Report
  1191.           message), then information concerning the user is extracted
  1192.           from the cachedSecurityData.  The cachedSecurityData can now
  1193.           be discarded.  The securityEngineID is set to the local
  1194.           snmpEngineID.  The securityLevel is set to the value specified
  1195.           by the calling module.
  1196.  
  1197.           Otherwise,
  1198.  
  1199.        b) based on the securityName, information concerning the user at
  1200.           the destination snmpEngineID, specified by the
  1201.           securityEngineID, is extracted from the Local Configuration
  1202.           Datastore (LCD, usmUserTable). If information about the user
  1203.           is absent from the LCD, then an error indication
  1204.           (unknownSecurityName) is returned to the calling module.
  1205.  
  1206.    2)  If the securityLevel specifies that the message is to be
  1207.        protected from disclosure, but the user does not support both an
  1208.        authentication and a privacy protocol then the message cannot be
  1209.        sent.  An error indication (unsupportedSecurityLevel) is returned
  1210.        to the calling module.
  1211.  
  1212.    3)  If the securityLevel specifies that the message is to be
  1213.        authenticated, but the user does not support an authentication
  1214.        protocol, then the message cannot be sent. An error indication
  1215.        (unsupportedSecurityLevel) is returned to the calling module.
  1216.  
  1217.    4)  a) If the securityLevel specifies that the message is to be
  1218.           protected from disclosure, then the octet sequence
  1219.           representing the serialized scopedPDU is encrypted according
  1220.           to the user's privacy protocol. To do so a call is made to the
  1221.           privacy module that implements the user's privacy protocol
  1222.           according to the abstract primitive:
  1223.  
  1224.           statusInformation =       -- success or failure
  1225.             encryptData(
  1226.             IN    encryptKey        -- user's localized privKey
  1227.             IN    dataToEncrypt     -- serialized scopedPDU
  1228.             OUT   encryptedData     -- serialized encryptedPDU
  1229.             OUT   privParameters    -- serialized privacy parameters
  1230.                   )
  1231.  
  1232.  
  1233.  
  1234. Blumenthal & Wijnen         Standards Track                    [Page 22]
  1235.  
  1236. RFC 2574                     USM for SNMPv3                   April 1999
  1237.  
  1238.  
  1239.           statusInformation
  1240.             indicates if the encryption process was successful or not.
  1241.           encryptKey
  1242.             the user's localized private privKey is the secret key that
  1243.             can be used by the encryption algorithm.
  1244.           dataToEncrypt
  1245.             the serialized scopedPDU is the data to be encrypted.
  1246.           encryptedData
  1247.             the encryptedPDU represents the encrypted scopedPDU,
  1248.             encoded as an OCTET STRING.
  1249.           privParameters
  1250.             the privacy parameters, encoded as an OCTET STRING.
  1251.  
  1252.           If the privacy module returns failure, then the message cannot
  1253.           be sent and an error indication (encryptionError) is returned
  1254.           to the calling module.
  1255.  
  1256.           If the privacy module returns success, then the returned
  1257.           privParameters are put into the msgPrivacyParameters field of
  1258.           the securityParameters and the encryptedPDU serves as the
  1259.           payload of the message being prepared.
  1260.  
  1261.           Otherwise,
  1262.  
  1263.        b) If the securityLevel specifies that the message is not to be
  1264.           be protected from disclosure, then a zero-length OCTET STRING
  1265.           is encoded into the msgPrivacyParameters field of the
  1266.           securityParameters and the plaintext scopedPDU serves as the
  1267.           payload of the message being prepared.
  1268.  
  1269.    5)  The securityEngineID is encoded as an OCTET STRING into the
  1270.        msgAuthoritativeEngineID field of the securityParameters.  Note
  1271.        that an empty (zero length) securityEngineID is OK for a Request
  1272.        message, because that will cause the remote (authoritative) SNMP
  1273.        engine to return a Report PDU with the proper securityEngineID
  1274.        included in the msgAuthoritativeEngineID in the
  1275.        securityParameters of that returned Report PDU.
  1276.  
  1277.    6)  a) If the securityLevel specifies that the message is to be
  1278.           authenticated, then the current values of snmpEngineBoots and
  1279.           snmpEngineTime corresponding to the securityEngineID from the
  1280.           LCD are used.
  1281.  
  1282.           Otherwise,
  1283.  
  1284.        b) If this is a Response or Report message, then the current
  1285.           value of snmpEngineBoots and snmpEngineTime corresponding to
  1286.           the local snmpEngineID from the LCD are used.
  1287.  
  1288.  
  1289.  
  1290. Blumenthal & Wijnen         Standards Track                    [Page 23]
  1291.  
  1292. RFC 2574                     USM for SNMPv3                   April 1999
  1293.  
  1294.  
  1295.           Otherwise,
  1296.  
  1297.        c) If this is a Request message, then a zero value is used for
  1298.           both snmpEngineBoots and snmpEngineTime. This zero value gets
  1299.           used if snmpEngineID is empty.
  1300.  
  1301.        The values are encoded as INTEGER respectively into the
  1302.        msgAuthoritativeEngineBoots and msgAuthoritativeEngineTime fields
  1303.        of the securityParameters.
  1304.  
  1305.    7)  The userName is encoded as an OCTET STRING into the msgUserName
  1306.        field of the securityParameters.
  1307.  
  1308.    8)  a) If the securityLevel specifies that the message is to be
  1309.           authenticated, the message is authenticated according to the
  1310.           user's authentication protocol. To do so a call is made to the
  1311.           authentication module that implements the user's
  1312.           authentication protocol according to the abstract service
  1313.           primitive:
  1314.  
  1315.           statusInformation =
  1316.             authenticateOutgoingMsg(
  1317.             IN  authKey               -- the user's localized authKey
  1318.             IN  wholeMsg              -- unauthenticated message
  1319.             OUT authenticatedWholeMsg -- authenticated complete message
  1320.                 )
  1321.  
  1322.           statusInformation
  1323.             indicates if authentication was successful or not.
  1324.           authKey
  1325.             the user's localized private authKey is the secret key that
  1326.             can be used by the authentication algorithm.
  1327.           wholeMsg
  1328.             the complete serialized message to be authenticated.
  1329.           authenticatedWholeMsg
  1330.             the same as the input given to the authenticateOutgoingMsg
  1331.             service, but with msgAuthenticationParameters properly
  1332.             filled in.
  1333.  
  1334.           If the authentication module returns failure, then the message
  1335.           cannot be sent and an error indication (authenticationFailure)
  1336.           is returned to the calling module.
  1337.  
  1338.           If the authentication module returns success, then the
  1339.           msgAuthenticationParameters field is put into the
  1340.           securityParameters and the authenticatedWholeMsg represents
  1341.           the serialization of the authenticated message being prepared.
  1342.  
  1343.  
  1344.  
  1345.  
  1346. Blumenthal & Wijnen         Standards Track                    [Page 24]
  1347.  
  1348. RFC 2574                     USM for SNMPv3                   April 1999
  1349.  
  1350.  
  1351.           Otherwise,
  1352.  
  1353.        b) If the securityLevel specifies that the message is not to be
  1354.           authenticated then a zero-length OCTET STRING is encoded into
  1355.           the msgAuthenticationParameters field of the
  1356.           securityParameters.  The wholeMsg is now serialized and then
  1357.           represents the unauthenticated message being prepared.
  1358.  
  1359.    9)  The completed message with its length is returned to the calling
  1360.        module with the statusInformation set to success.
  1361.  
  1362. 3.2.  Processing an Incoming SNMP Message
  1363.  
  1364.    This section describes the procedure followed by an SNMP engine
  1365.    whenever it receives a message containing a management operation on
  1366.    behalf of a user, with a particular securityLevel.
  1367.  
  1368.    To simplify the elements of procedure, the release of state
  1369.    information is not always explicitly specified. As a general rule, if
  1370.    state information is available when a message gets discarded, the
  1371.    state information should also be released.  Also, an error indication
  1372.    can return an OID and value for an incremented counter and optionally
  1373.    a value for securityLevel, and values for contextEngineID or
  1374.    contextName for the counter.  In addition, the securityStateReference
  1375.    data is returned if any such information is available at the point
  1376.    where the error is detected.
  1377.  
  1378.    1)  If the received securityParameters is not the serialization
  1379.        (according to the conventions of [RFC1906]) of an OCTET STRING
  1380.        formatted according to the UsmSecurityParameters defined in
  1381.        section 2.4, then the snmpInASNParseErrs counter [RFC1907] is
  1382.        incremented, and an error indication (parseError) is returned to
  1383.        the calling module.  Note that we return without the OID and
  1384.        value of the incremented counter, because in this case there is
  1385.        not enough information to generate a Report PDU.
  1386.  
  1387.    2)  The values of the security parameter fields are extracted from
  1388.        the securityParameters. The securityEngineID to be returned to
  1389.        the caller is the value of the msgAuthoritativeEngineID field.
  1390.        The cachedSecurityData is prepared and a securityStateReference
  1391.        is prepared to reference this data. Values to be cached are:
  1392.  
  1393.            msgUserName
  1394.  
  1395.    3)  If the value of the msgAuthoritativeEngineID field in the
  1396.        securityParameters is unknown then:
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Blumenthal & Wijnen         Standards Track                    [Page 25]
  1403.  
  1404. RFC 2574                     USM for SNMPv3                   April 1999
  1405.  
  1406.  
  1407.        a) a non-authoritative SNMP engine that performs discovery may
  1408.           optionally create a new entry in its Local Configuration
  1409.           Datastore (LCD) and continue processing;
  1410.  
  1411.           or
  1412.  
  1413.        b) the usmStatsUnknownEngineIDs counter is incremented, and
  1414.           an error indication (unknownEngineID) together with the
  1415.           OID and value of the incremented counter is returned to
  1416.           the calling module.
  1417.  
  1418.        Note in the event that a zero-length, or other illegally
  1419.        sized msgAuthoritativeEngineID is received, b) should be
  1420.        chosen to facilitate engineID discovery.
  1421.        Otherwise the choice between a) and b) is an implementation
  1422.        issue.
  1423.  
  1424.    4)  Information about the value of the msgUserName and
  1425.        msgAuthoritativeEngineID fields is extracted from the Local
  1426.        Configuration Datastore (LCD, usmUserTable).  If no information
  1427.        is available for the user, then the usmStatsUnknownUserNames
  1428.        counter is incremented and an error indication
  1429.        (unknownSecurityName) together with the OID and value of the
  1430.        incremented counter is returned to the calling module.
  1431.  
  1432.    5)  If the information about the user indicates that it does not
  1433.        support the securityLevel requested by the caller, then the
  1434.        usmStatsUnsupportedSecLevels counter is incremented and an
  1435.        error indication (unsupportedSecurityLevel) together with the
  1436.        OID and value of the incremented counter is returned to the
  1437.        calling module.
  1438.  
  1439.    6)  If the securityLevel specifies that the message is to be
  1440.        authenticated, then the message is authenticated according to
  1441.        the user's authentication protocol. To do so a call is made
  1442.        to the authentication module that implements the user's
  1443.        authentication protocol according to the abstract service
  1444.        primitive:
  1445.  
  1446.        statusInformation =          -- success or failure
  1447.          authenticateIncomingMsg(
  1448.          IN   authKey               -- the user's localized authKey
  1449.          IN   authParameters        -- as received on the wire
  1450.          IN   wholeMsg              -- as received on the wire
  1451.          OUT  authenticatedWholeMsg -- checked for authentication
  1452.                  )
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458. Blumenthal & Wijnen         Standards Track                    [Page 26]
  1459.  
  1460. RFC 2574                     USM for SNMPv3                   April 1999
  1461.  
  1462.  
  1463.        statusInformation
  1464.          indicates if authentication was successful or not.
  1465.        authKey
  1466.          the user's localized private authKey is the secret key that
  1467.          can be used by the authentication algorithm.
  1468.        wholeMsg
  1469.          the complete serialized message to be authenticated.
  1470.        authenticatedWholeMsg
  1471.          the same as the input given to the authenticateIncomingMsg
  1472.          service, but after authentication has been checked.
  1473.  
  1474.        If the authentication module returns failure, then the message
  1475.        cannot be trusted, so the usmStatsWrongDigests counter is
  1476.        incremented and an error indication (authenticationFailure)
  1477.        together with the OID and value of the incremented counter is
  1478.        returned to the calling module.
  1479.  
  1480.        If the authentication module returns success, then the message
  1481.        is authentic and can be trusted so processing continues.
  1482.  
  1483.    7)  If the securityLevel indicates an authenticated message, then
  1484.        the local values of snmpEngineBoots, snmpEngineTime
  1485.        and latestReceivedEngineTime
  1486.        corresponding to the value of the msgAuthoritativeEngineID
  1487.        field are extracted from the Local Configuration Datastore.
  1488.  
  1489.        a) If the extracted value of msgAuthoritativeEngineID is the
  1490.           same as the value of snmpEngineID of the processing SNMP
  1491.           engine (meaning this is the authoritative SNMP engine),
  1492.           then if any of the following conditions is true, then the
  1493.           message is considered to be outside of the Time Window:
  1494.  
  1495.            - the local value of snmpEngineBoots is 2147483647;
  1496.  
  1497.            - the value of the msgAuthoritativeEngineBoots field differs
  1498.              from the local value of snmpEngineBoots; or,
  1499.  
  1500.            - the value of the msgAuthoritativeEngineTime field differs
  1501.              from the local notion of snmpEngineTime by more than
  1502.              +/- 150 seconds.
  1503.  
  1504.           If the message is considered to be outside of the Time Window
  1505.           then the usmStatsNotInTimeWindows counter is incremented and
  1506.           an error indication (notInTimeWindow) together with the OID,
  1507.           the value of the incremented counter, and an indication that
  1508.           the error must be reported with a securityLevel of authNoPriv,
  1509.           is returned to the calling module
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Blumenthal & Wijnen         Standards Track                    [Page 27]
  1515.  
  1516. RFC 2574                     USM for SNMPv3                   April 1999
  1517.  
  1518.  
  1519.        b) If the extracted value of msgAuthoritativeEngineID is not the
  1520.           same as the value snmpEngineID of the processing SNMP engine
  1521.           (meaning this is not the authoritative SNMP engine), then:
  1522.  
  1523.           1) if at least one of the following conditions is true:
  1524.  
  1525.              - the extracted value of the msgAuthoritativeEngineBoots
  1526.                field is greater than the local notion of the value of
  1527.                snmpEngineBoots; or,
  1528.  
  1529.              - the extracted value of the msgAuthoritativeEngineBoots
  1530.                field is equal to the local notion of the value of
  1531.                snmpEngineBoots, and the extracted value of
  1532.                msgAuthoritativeEngineTime field is greater than the
  1533.                value of latestReceivedEngineTime,
  1534.  
  1535.              then the LCD entry corresponding to the extracted value
  1536.              of the msgAuthoritativeEngineID field is updated, by
  1537.              setting:
  1538.  
  1539.                 - the local notion of the value of snmpEngineBoots to
  1540.                   the value of the msgAuthoritativeEngineBoots field,
  1541.                 - the local notion of the value of snmpEngineTime to
  1542.                   the value of the msgAuthoritativeEngineTime field,
  1543.                   and
  1544.                 - the latestReceivedEngineTime to the value of the
  1545.                   value of the msgAuthoritativeEngineTime field.
  1546.  
  1547.           2) if any of the following conditions is true, then the
  1548.              message is considered to be outside of the Time Window:
  1549.  
  1550.              - the local notion of the value of snmpEngineBoots is
  1551.                2147483647;
  1552.  
  1553.              - the value of the msgAuthoritativeEngineBoots field is
  1554.                less than the local notion of the value of
  1555.                snmpEngineBoots; or,
  1556.  
  1557.              - the value of the msgAuthoritativeEngineBoots field is
  1558.                equal to the local notion of the value of
  1559.                snmpEngineBoots and the value of the
  1560.                msgAuthoritativeEngineTime field is more than 150
  1561.                seconds less than the local notion of the value of
  1562.                snmpEngineTime.
  1563.  
  1564.              If the message is considered to be outside of the Time
  1565.              Window then an error indication (notInTimeWindow) is
  1566.              returned to the calling module.
  1567.  
  1568.  
  1569.  
  1570. Blumenthal & Wijnen         Standards Track                    [Page 28]
  1571.  
  1572. RFC 2574                     USM for SNMPv3                   April 1999
  1573.  
  1574.  
  1575.              Note that this means that a too old (possibly replayed)
  1576.              message has been detected and is deemed unauthentic.
  1577.  
  1578.              Note that this procedure allows for the value of
  1579.              msgAuthoritativeEngineBoots in the message to be greater
  1580.              than the local notion of the value of snmpEngineBoots to
  1581.              allow for received messages to be accepted as authentic
  1582.              when received from an authoritative SNMP engine that has
  1583.              re-booted since the receiving SNMP engine last
  1584.              (re-)synchronized.
  1585.  
  1586.    8)  a) If the securityLevel indicates that the message was protected
  1587.           from disclosure, then the OCTET STRING representing the
  1588.           encryptedPDU is decrypted according to the user's privacy
  1589.           protocol to obtain an unencrypted serialized scopedPDU value.
  1590.           To do so a call is made to the privacy module that implements
  1591.           the user's privacy protocol according to the abstract
  1592.           primitive:
  1593.  
  1594.           statusInformation =       -- success or failure
  1595.             decryptData(
  1596.             IN    decryptKey        -- the user's localized privKey
  1597.             IN    privParameters    -- as received on the wire
  1598.             IN    encryptedData     -- encryptedPDU as received
  1599.             OUT   decryptedData     -- serialized decrypted scopedPDU
  1600.                   )
  1601.  
  1602.           statusInformation
  1603.             indicates if the decryption process was successful or not.
  1604.           decryptKey
  1605.             the user's localized private privKey is the secret key that
  1606.             can be used by the decryption algorithm.
  1607.           privParameters
  1608.             the msgPrivacyParameters, encoded as an OCTET STRING.
  1609.           encryptedData
  1610.             the encryptedPDU represents the encrypted scopedPDU, encoded
  1611.             as an OCTET STRING.
  1612.           decryptedData
  1613.             the serialized scopedPDU if decryption is successful.
  1614.  
  1615.           If the privacy module returns failure, then the message can
  1616.           not be processed, so the usmStatsDecryptionErrors counter is
  1617.           incremented and an error indication (decryptionError) together
  1618.           with the OID and value of the incremented counter is returned
  1619.           to the calling module.
  1620.  
  1621.  
  1622.  
  1623.  
  1624.  
  1625.  
  1626. Blumenthal & Wijnen         Standards Track                    [Page 29]
  1627.  
  1628. RFC 2574                     USM for SNMPv3                   April 1999
  1629.  
  1630.  
  1631.           If the privacy module returns success, then the decrypted
  1632.           scopedPDU is the message payload to be returned to the calling
  1633.           module.
  1634.  
  1635.           Otherwise,
  1636.  
  1637.        b) The scopedPDU component is assumed to be in plain text
  1638.           and is the message payload to be returned to the calling
  1639.           module.
  1640.  
  1641.    9)  The maxSizeResponseScopedPDU is calculated.  This is the
  1642.        maximum size allowed for a scopedPDU for a possible Response
  1643.        message.  Provision is made for a message header that allows the
  1644.        same securityLevel as the received Request.
  1645.  
  1646.    10) The securityName for the user is retrieved from the
  1647.        usmUserTable.
  1648.  
  1649.    11) The security data is cached as cachedSecurityData, so that a
  1650.        possible response to this message can and will use the same
  1651.        authentication and privacy secrets.  Information to be
  1652.        saved/cached is as follows:
  1653.  
  1654.           msgUserName,
  1655.           usmUserAuthProtocol, usmUserAuthKey
  1656.           usmUserPrivProtocol, usmUserPrivKey
  1657.  
  1658.    12) The statusInformation is set to success and a return is made to
  1659.        the calling module passing back the OUT parameters as specified
  1660.        in the processIncomingMsg primitive.
  1661.  
  1662. 4.  Discovery
  1663.  
  1664.    The User-based Security Model requires that a discovery process
  1665.    obtains sufficient information about other SNMP engines in order to
  1666.    communicate with them.  Discovery requires an non-authoritative SNMP
  1667.    engine to learn the authoritative SNMP engine's snmpEngineID value
  1668.    before communication may proceed.  This may be accomplished by
  1669.    generating a Request message with a securityLevel of noAuthNoPriv, a
  1670.    msgUserName of zero-length, a msgAuthoritativeEngineID value of zero
  1671.    length, and the varBindList left empty.  The response to this message
  1672.    will be a Report message containing the snmpEngineID of the
  1673.    authoritative SNMP engine as the value of the
  1674.    msgAuthoritativeEngineID field within the msgSecurityParameters
  1675.    field.  It contains a Report PDU with the usmStatsUnknownEngineIDs
  1676.    counter in the varBindList.
  1677.  
  1678.  
  1679.  
  1680.  
  1681.  
  1682. Blumenthal & Wijnen         Standards Track                    [Page 30]
  1683.  
  1684. RFC 2574                     USM for SNMPv3                   April 1999
  1685.  
  1686.  
  1687.    If authenticated communication is required, then the discovery
  1688.    process should also establish time synchronization with the
  1689.    authoritative SNMP engine.  This may be accomplished by sending an
  1690.    authenticated Request message with the value of
  1691.    msgAuthoritativeEngineID set to the newly learned snmpEngineID and
  1692.    with the values of msgAuthoritativeEngineBoots and
  1693.    msgAuthoritativeEngineTime set to zero.  For an authenticated Request
  1694.    message, a valid userName must be used in the msgUserName field.  The
  1695.    response to this authenticated message will be a Report message
  1696.    containing the up to date values of the authoritative SNMP engine's
  1697.    snmpEngineBoots and snmpEngineTime as the value of the
  1698.    msgAuthoritativeEngineBoots and msgAuthoritativeEngineTime fields
  1699.    respectively.  It also contains the usmStatsNotInTimeWindows counter
  1700.    in the varBindList of the Report PDU.  The time synchronization then
  1701.    happens automatically as part of the procedures in section 3.2 step
  1702.    7b. See also section 2.3.
  1703.  
  1704. 5.  Definitions
  1705.  
  1706. SNMP-USER-BASED-SM-MIB DEFINITIONS ::= BEGIN
  1707.  
  1708. IMPORTS
  1709.     MODULE-IDENTITY, OBJECT-TYPE,
  1710.     OBJECT-IDENTITY,
  1711.     snmpModules, Counter32                FROM SNMPv2-SMI
  1712.     TEXTUAL-CONVENTION, TestAndIncr,
  1713.     RowStatus, RowPointer,
  1714.     StorageType, AutonomousType           FROM SNMPv2-TC
  1715.     MODULE-COMPLIANCE, OBJECT-GROUP       FROM SNMPv2-CONF
  1716.     SnmpAdminString, SnmpEngineID,
  1717.     snmpAuthProtocols, snmpPrivProtocols  FROM SNMP-FRAMEWORK-MIB;
  1718.  
  1719. snmpUsmMIB MODULE-IDENTITY
  1720.     LAST-UPDATED "9901200000Z"            -- 20 Jan 1999, midnight
  1721.     ORGANIZATION "SNMPv3 Working Group"
  1722.     CONTACT-INFO "WG-email:   snmpv3@lists.tislabs.com
  1723.                   Subscribe:  majordomo@lists.tislabs.com
  1724.                               In msg body:  subscribe snmpv3
  1725.  
  1726.                   Chair:      Russ Mundy
  1727.                               Trusted Information Systems
  1728.                   postal:     3060 Washington Rd
  1729.                               Glenwood MD 21738
  1730.                               USA
  1731.                   email:      mundy@tislabs.com
  1732.                   phone:      +1-301-854-6889
  1733.  
  1734.                   Co-editor   Uri Blumenthal
  1735.  
  1736.  
  1737.  
  1738. Blumenthal & Wijnen         Standards Track                    [Page 31]
  1739.  
  1740. RFC 2574                     USM for SNMPv3                   April 1999
  1741.  
  1742.  
  1743.                               IBM T. J. Watson Research
  1744.                   postal:     30 Saw Mill River Pkwy,
  1745.                               Hawthorne, NY 10532
  1746.                               USA
  1747.                   email:      uri@watson.ibm.com
  1748.                   phone:      +1-914-784-7964
  1749.  
  1750.                   Co-editor:  Bert Wijnen
  1751.                               IBM T. J. Watson Research
  1752.                   postal:     Schagen 33
  1753.                               3461 GL Linschoten
  1754.                               Netherlands
  1755.                   email:      wijnen@vnet.ibm.com
  1756.                   phone:      +31-348-432-794
  1757.                  "
  1758.     DESCRIPTION  "The management information definitions for the
  1759.                   SNMP User-based Security Model.
  1760.                  "
  1761. --  Revision history
  1762.  
  1763.     REVISION     "9901200000Z"            -- 20 Jan 1999, midnight
  1764.     DESCRIPTION  "Clarifications, published as RFC2574"
  1765.  
  1766.     REVISION     "9711200000Z"            -- 20 Nov 1997, midnight
  1767.     DESCRIPTION  "Initial version, published as RFC2274"
  1768.  
  1769.     ::= { snmpModules 15 }
  1770.  
  1771. -- Administrative assignments ****************************************
  1772.  
  1773. usmMIBObjects     OBJECT IDENTIFIER ::= { snmpUsmMIB 1 }
  1774. usmMIBConformance OBJECT IDENTIFIER ::= { snmpUsmMIB 2 }
  1775.  
  1776. -- Identification of Authentication and Privacy Protocols ************
  1777.  
  1778. usmNoAuthProtocol OBJECT-IDENTITY
  1779.     STATUS        current
  1780.     DESCRIPTION  "No Authentication Protocol."
  1781.     ::= { snmpAuthProtocols 1 }
  1782.  
  1783. usmHMACMD5AuthProtocol OBJECT-IDENTITY
  1784.     STATUS        current
  1785.     DESCRIPTION  "The HMAC-MD5-96 Digest Authentication Protocol."
  1786.     REFERENCE    "- H. Krawczyk, M. Bellare, R. Canetti HMAC:
  1787.                     Keyed-Hashing for Message Authentication,
  1788.                     RFC2104, Feb 1997.
  1789.                   - Rivest, R., Message Digest Algorithm MD5, RFC1321.
  1790.                  "
  1791.  
  1792.  
  1793.  
  1794. Blumenthal & Wijnen         Standards Track                    [Page 32]
  1795.  
  1796. RFC 2574                     USM for SNMPv3                   April 1999
  1797.  
  1798.  
  1799.     ::= { snmpAuthProtocols 2 }
  1800.  
  1801. usmHMACSHAAuthProtocol OBJECT-IDENTITY
  1802.     STATUS        current
  1803.     DESCRIPTION  "The HMAC-SHA-96 Digest Authentication Protocol."
  1804.     REFERENCE    "- H. Krawczyk, M. Bellare, R. Canetti, HMAC:
  1805.                     Keyed-Hashing for Message Authentication,
  1806.                     RFC2104, Feb 1997.
  1807.                   - Secure Hash Algorithm. NIST FIPS 180-1.
  1808.                  "
  1809.     ::= { snmpAuthProtocols 3 }
  1810.  
  1811. usmNoPrivProtocol OBJECT-IDENTITY
  1812.     STATUS        current
  1813.     DESCRIPTION  "No Privacy Protocol."
  1814.     ::= { snmpPrivProtocols 1 }
  1815.  
  1816. usmDESPrivProtocol OBJECT-IDENTITY
  1817.     STATUS        current
  1818.     DESCRIPTION  "The CBC-DES Symmetric Encryption Protocol."
  1819.     REFERENCE    "- Data Encryption Standard, National Institute of
  1820.                     Standards and Technology.  Federal Information
  1821.                     Processing Standard (FIPS) Publication 46-1.
  1822.                     Supersedes FIPS Publication 46,
  1823.                     (January, 1977; reaffirmed January, 1988).
  1824.  
  1825.                   - Data Encryption Algorithm, American National
  1826.                     Standards Institute.  ANSI X3.92-1981,
  1827.                     (December, 1980).
  1828.  
  1829.                   - DES Modes of Operation, National Institute of
  1830.                     Standards and Technology.  Federal Information
  1831.                     Processing Standard (FIPS) Publication 81,
  1832.                     (December, 1980).
  1833.  
  1834.                   - Data Encryption Algorithm - Modes of Operation,
  1835.                     American National Standards Institute.
  1836.                     ANSI X3.106-1983, (May 1983).
  1837.                  "
  1838.     ::= { snmpPrivProtocols 2 }
  1839.  
  1840.  
  1841. -- Textual Conventions ***********************************************
  1842.  
  1843.  
  1844. KeyChange ::=     TEXTUAL-CONVENTION
  1845.    STATUS         current
  1846.    DESCRIPTION
  1847.  
  1848.  
  1849.  
  1850. Blumenthal & Wijnen         Standards Track                    [Page 33]
  1851.  
  1852. RFC 2574                     USM for SNMPv3                   April 1999
  1853.  
  1854.  
  1855.          "Every definition of an object with this syntax must identify
  1856.           a protocol P, a secret key K, and a hash algorithm H
  1857.           that produces output of L octets.
  1858.  
  1859.           The object's value is a manager-generated, partially-random
  1860.           value which, when modified, causes the value of the secret
  1861.           key K, to be modified via a one-way function.
  1862.  
  1863.           The value of an instance of this object is the concatenation
  1864.           of two components: first a 'random' component and then a
  1865.           'delta' component.
  1866.  
  1867.           The lengths of the random and delta components
  1868.           are given by the corresponding value of the protocol P;
  1869.           if P requires K to be a fixed length, the length of both the
  1870.           random and delta components is that fixed length; if P
  1871.           allows the length of K to be variable up to a particular
  1872.           maximum length, the length of the random component is that
  1873.           maximum length and the length of the delta component is any
  1874.           length less than or equal to that maximum length.
  1875.           For example, usmHMACMD5AuthProtocol requires K to be a fixed
  1876.           length of 16 octets and L - of 16 octets.
  1877.           usmHMACSHAAuthProtocol requires K to be a fixed length of
  1878.           20 octets and L - of 20 octets. Other protocols may define
  1879.           other sizes, as deemed appropriate.
  1880.  
  1881.           When a requester wants to change the old key K to a new
  1882.           key keyNew on a remote entity, the 'random' component is
  1883.           obtained from either a true random generator, or from a
  1884.           pseudorandom generator, and the 'delta' component is
  1885.           computed as follows:
  1886.  
  1887.            - a temporary variable is initialized to the existing value
  1888.              of K;
  1889.            - if the length of the keyNew is greater than L octets,
  1890.              then:
  1891.               - the random component is appended to the value of the
  1892.                 temporary variable, and the result is input to the
  1893.                 the hash algorithm H to produce a digest value, and
  1894.                 the temporary variable is set to this digest value;
  1895.               - the value of the temporary variable is XOR-ed with
  1896.                 the first (next) L-octets (16 octets in case of MD5)
  1897.                 of the keyNew to produce the first (next) L-octets
  1898.                 (16 octets in case of MD5) of the 'delta' component.
  1899.               - the above two steps are repeated until the unused
  1900.                 portion of the keyNew component is L octets or less,
  1901.            - the random component is appended to the value of the
  1902.              temporary variable, and the result is input to the
  1903.  
  1904.  
  1905.  
  1906. Blumenthal & Wijnen         Standards Track                    [Page 34]
  1907.  
  1908. RFC 2574                     USM for SNMPv3                   April 1999
  1909.  
  1910.  
  1911.              hash algorithm H to produce a digest value;
  1912.            - this digest value, truncated if necessary to be the same
  1913.              length as the unused portion of the keyNew, is XOR-ed
  1914.              with the unused portion of the keyNew to produce the
  1915.              (final portion of the) 'delta' component.
  1916.  
  1917.            For example, using MD5 as the hash algorithm H:
  1918.  
  1919.               iterations = (lenOfDelta - 1)/16; /* integer division */
  1920.               temp = keyOld;
  1921.               for (i = 0; i < iterations; i++) {
  1922.                   temp = MD5 (temp || random);
  1923.                   delta[i*16 .. (i*16)+15] =
  1924.                          temp XOR keyNew[i*16 .. (i*16)+15];
  1925.               }
  1926.               temp = MD5 (temp || random);
  1927.               delta[i*16 .. lenOfDelta-1] =
  1928.                      temp XOR keyNew[i*16 .. lenOfDelta-1];
  1929.  
  1930.           The 'random' and 'delta' components are then concatenated as
  1931.           described above, and the resulting octet string is sent to
  1932.           the recipient as the new value of an instance of this object.
  1933.  
  1934.           At the receiver side, when an instance of this object is set
  1935.           to a new value, then a new value of K is computed as follows:
  1936.  
  1937.            - a temporary variable is initialized to the existing value
  1938.              of K;
  1939.            - if the length of the delta component is greater than L
  1940.              octets, then:
  1941.               - the random component is appended to the value of the
  1942.                 temporary variable, and the result is input to the
  1943.                 hash algorithm H to produce a digest value, and the
  1944.                 temporary variable is set to this digest value;
  1945.               - the value of the temporary variable is XOR-ed with
  1946.                 the first (next) L-octets (16 octets in case of MD5)
  1947.                 of the delta component to produce the first (next)
  1948.                 L-octets (16 octets in case of MD5) of the new value
  1949.                 of K.
  1950.               - the above two steps are repeated until the unused
  1951.                 portion of the delta component is L octets or less,
  1952.            - the random component is appended to the value of the
  1953.              temporary variable, and the result is input to the
  1954.              hash algorithm H to produce a digest value;
  1955.            - this digest value, truncated if necessary to be the same
  1956.              length as the unused portion of the delta component, is
  1957.              XOR-ed with the unused portion of the delta component to
  1958.              produce the (final portion of the) new value of K.
  1959.  
  1960.  
  1961.  
  1962. Blumenthal & Wijnen         Standards Track                    [Page 35]
  1963.  
  1964. RFC 2574                     USM for SNMPv3                   April 1999
  1965.  
  1966.  
  1967.            For example, using MD5 as the hash algorithm H:
  1968.  
  1969.               iterations = (lenOfDelta - 1)/16; /* integer division */
  1970.               temp = keyOld;
  1971.               for (i = 0; i < iterations; i++) {
  1972.                   temp = MD5 (temp || random);
  1973.                   keyNew[i*16 .. (i*16)+15] =
  1974.                          temp XOR delta[i*16 .. (i*16)+15];
  1975.               }
  1976.               temp = MD5 (temp || random);
  1977.               keyNew[i*16 .. lenOfDelta-1] =
  1978.                      temp XOR delta[i*16 .. lenOfDelta-1];
  1979.  
  1980.           The value of an object with this syntax, whenever it is
  1981.           retrieved by the management protocol, is always the zero
  1982.           length string.
  1983.  
  1984.           Note that the keyOld and keyNew are the localized keys.
  1985.  
  1986.           Note that it is probably wise that when an SNMP entity sends
  1987.           a SetRequest to change a key, that it keeps a copy of the old
  1988.           key until it has confirmed that the key change actually
  1989.           succeeded.
  1990.          "
  1991.     SYNTAX       OCTET STRING
  1992.  
  1993.  
  1994. -- Statistics for the User-based Security Model **********************
  1995.  
  1996.  
  1997. usmStats         OBJECT IDENTIFIER ::= { usmMIBObjects 1 }
  1998.  
  1999.  
  2000. usmStatsUnsupportedSecLevels OBJECT-TYPE
  2001.     SYNTAX       Counter32
  2002.     MAX-ACCESS   read-only
  2003.     STATUS       current
  2004.     DESCRIPTION "The total number of packets received by the SNMP
  2005.                  engine which were dropped because they requested a
  2006.                  securityLevel that was unknown to the SNMP engine
  2007.                  or otherwise unavailable.
  2008.                 "
  2009.     ::= { usmStats 1 }
  2010.  
  2011. usmStatsNotInTimeWindows OBJECT-TYPE
  2012.     SYNTAX       Counter32
  2013.     MAX-ACCESS   read-only
  2014.     STATUS       current
  2015.  
  2016.  
  2017.  
  2018. Blumenthal & Wijnen         Standards Track                    [Page 36]
  2019.  
  2020. RFC 2574                     USM for SNMPv3                   April 1999
  2021.  
  2022.  
  2023.     DESCRIPTION "The total number of packets received by the SNMP
  2024.                  engine which were dropped because they appeared
  2025.                  outside of the authoritative SNMP engine's window.
  2026.                 "
  2027.     ::= { usmStats 2 }
  2028.  
  2029. usmStatsUnknownUserNames OBJECT-TYPE
  2030.     SYNTAX       Counter32
  2031.     MAX-ACCESS   read-only
  2032.     STATUS       current
  2033.     DESCRIPTION "The total number of packets received by the SNMP
  2034.                  engine which were dropped because they referenced a
  2035.                  user that was not known to the SNMP engine.
  2036.                 "
  2037.     ::= { usmStats 3 }
  2038.  
  2039. usmStatsUnknownEngineIDs OBJECT-TYPE
  2040.     SYNTAX       Counter32
  2041.     MAX-ACCESS   read-only
  2042.     STATUS       current
  2043.     DESCRIPTION "The total number of packets received by the SNMP
  2044.                  engine which were dropped because they referenced an
  2045.                  snmpEngineID that was not known to the SNMP engine.
  2046.                 "
  2047.     ::= { usmStats 4 }
  2048.  
  2049. usmStatsWrongDigests OBJECT-TYPE
  2050.     SYNTAX       Counter32
  2051.     MAX-ACCESS   read-only
  2052.     STATUS       current
  2053.     DESCRIPTION "The total number of packets received by the SNMP
  2054.                  engine which were dropped because they didn't
  2055.                  contain the expected digest value.
  2056.                 "
  2057.     ::= { usmStats 5 }
  2058.  
  2059. usmStatsDecryptionErrors OBJECT-TYPE
  2060.     SYNTAX       Counter32
  2061.     MAX-ACCESS   read-only
  2062.     STATUS       current
  2063.     DESCRIPTION "The total number of packets received by the SNMP
  2064.                  engine which were dropped because they could not be
  2065.                  decrypted.
  2066.                 "
  2067.     ::= { usmStats 6 }
  2068.  
  2069. -- The usmUser Group ************************************************
  2070.  
  2071.  
  2072.  
  2073.  
  2074. Blumenthal & Wijnen         Standards Track                    [Page 37]
  2075.  
  2076. RFC 2574                     USM for SNMPv3                   April 1999
  2077.  
  2078.  
  2079. usmUser          OBJECT IDENTIFIER ::= { usmMIBObjects 2 }
  2080.  
  2081. usmUserSpinLock  OBJECT-TYPE
  2082.     SYNTAX       TestAndIncr
  2083.     MAX-ACCESS   read-write
  2084.     STATUS       current
  2085.     DESCRIPTION "An advisory lock used to allow several cooperating
  2086.                  Command Generator Applications to coordinate their
  2087.                  use of facilities to alter secrets in the
  2088.                  usmUserTable.
  2089.                 "
  2090.     ::= { usmUser 1 }
  2091.  
  2092. -- The table of valid users for the User-based Security Model ********
  2093.  
  2094. usmUserTable     OBJECT-TYPE
  2095.     SYNTAX       SEQUENCE OF UsmUserEntry
  2096.     MAX-ACCESS   not-accessible
  2097.     STATUS       current
  2098.     DESCRIPTION "The table of users configured in the SNMP engine's
  2099.                  Local Configuration Datastore (LCD).
  2100.  
  2101.                  To create a new user (i.e., to instantiate a new
  2102.                  conceptual row in this table), it is recommended to
  2103.                  follow this procedure:
  2104.  
  2105.                    1)  GET(usmUserSpinLock.0) and save in sValue.
  2106.                    2)  SET(usmUserSpinLock.0=sValue,
  2107.                            usmUserCloneFrom=templateUser,
  2108.                            usmUserStatus=createAndWait)
  2109.                        You should use a template user to clone from
  2110.                        which has the proper auth/priv protocol defined.
  2111.  
  2112.                  If the new user is to use privacy:
  2113.  
  2114.                    3)  generate the keyChange value based on the secret
  2115.                        privKey of the clone-from user and the secret key
  2116.                        to be used for the new user. Let us call this
  2117.                        pkcValue.
  2118.                    4)  GET(usmUserSpinLock.0) and save in sValue.
  2119.                    5)  SET(usmUserSpinLock.0=sValue,
  2120.                            usmUserPrivKeyChange=pkcValue
  2121.                            usmUserPublic=randomValue1)
  2122.                    6)  GET(usmUserPulic) and check it has randomValue1.
  2123.                        If not, repeat steps 4-6.
  2124.  
  2125.                  If the new user will never use privacy:
  2126.  
  2127.  
  2128.  
  2129.  
  2130. Blumenthal & Wijnen         Standards Track                    [Page 38]
  2131.  
  2132. RFC 2574                     USM for SNMPv3                   April 1999
  2133.  
  2134.  
  2135.                    7)  SET(usmUserPrivProtocol=usmNoPrivProtocol)
  2136.  
  2137.                  If the new user is to use authentication:
  2138.  
  2139.                    8)  generate the keyChange value based on the secret
  2140.                        authKey of the clone-from user and the secret key
  2141.                        to be used for the new user. Let us call this
  2142.                        akcValue.
  2143.                    9)  GET(usmUserSpinLock.0) and save in sValue.
  2144.                    10) SET(usmUserSpinLock.0=sValue,
  2145.                            usmUserAuthKeyChange=akcValue
  2146.                            usmUserPublic=randomValue2)
  2147.                    11) GET(usmUserPulic) and check it has randomValue2.
  2148.                        If not, repeat steps 9-11.
  2149.  
  2150.                  If the new user will never use authentication:
  2151.  
  2152.                    12) SET(usmUserAuthProtocol=usmNoAuthProtocol)
  2153.  
  2154.                  Finally, activate the new user:
  2155.  
  2156.                    13) SET(usmUserStatus=active)
  2157.  
  2158.                  The new user should now be available and ready to be
  2159.                  used for SNMPv3 communication. Note however that access
  2160.                  to MIB data must be provided via configuration of the
  2161.                  SNMP-VIEW-BASED-ACM-MIB.
  2162.  
  2163.                  The use of usmUserSpinlock is to avoid conflicts with
  2164.                  another SNMP command responder application which may
  2165.                  also be acting on the usmUserTable.
  2166.                 "
  2167.     ::= { usmUser 2 }
  2168.  
  2169. usmUserEntry     OBJECT-TYPE
  2170.     SYNTAX       UsmUserEntry
  2171.     MAX-ACCESS   not-accessible
  2172.     STATUS       current
  2173.     DESCRIPTION "A user configured in the SNMP engine's Local
  2174.                  Configuration Datastore (LCD) for the User-based
  2175.                  Security Model.
  2176.                 "
  2177.     INDEX       { usmUserEngineID,
  2178.                   usmUserName
  2179.                 }
  2180.     ::= { usmUserTable 1 }
  2181.  
  2182. UsmUserEntry ::= SEQUENCE
  2183.  
  2184.  
  2185.  
  2186. Blumenthal & Wijnen         Standards Track                    [Page 39]
  2187.  
  2188. RFC 2574                     USM for SNMPv3                   April 1999
  2189.  
  2190.  
  2191.     {
  2192.         usmUserEngineID         SnmpEngineID,
  2193.         usmUserName             SnmpAdminString,
  2194.         usmUserSecurityName     SnmpAdminString,
  2195.         usmUserCloneFrom        RowPointer,
  2196.         usmUserAuthProtocol     AutonomousType,
  2197.         usmUserAuthKeyChange    KeyChange,
  2198.         usmUserOwnAuthKeyChange KeyChange,
  2199.         usmUserPrivProtocol     AutonomousType,
  2200.         usmUserPrivKeyChange    KeyChange,
  2201.         usmUserOwnPrivKeyChange KeyChange,
  2202.         usmUserPublic           OCTET STRING,
  2203.         usmUserStorageType      StorageType,
  2204.         usmUserStatus           RowStatus
  2205.     }
  2206.  
  2207. usmUserEngineID  OBJECT-TYPE
  2208.     SYNTAX       SnmpEngineID
  2209.     MAX-ACCESS   not-accessible
  2210.     STATUS       current
  2211.     DESCRIPTION "An SNMP engine's administratively-unique identifier.
  2212.  
  2213.                  In a simple agent, this value is always that agent's
  2214.                  own snmpEngineID value.
  2215.  
  2216.                  The value can also take the value of the snmpEngineID
  2217.                  of a remote SNMP engine with which this user can
  2218.                  communicate.
  2219.                 "
  2220.     ::= { usmUserEntry 1 }
  2221.  
  2222. usmUserName      OBJECT-TYPE
  2223.     SYNTAX       SnmpAdminString (SIZE(1..32))
  2224.     MAX-ACCESS   not-accessible
  2225.     STATUS       current
  2226.     DESCRIPTION "A human readable string representing the name of
  2227.                  the user.
  2228.  
  2229.                  This is the (User-based Security) Model dependent
  2230.                  security ID.
  2231.                 "
  2232.     ::= { usmUserEntry 2 }
  2233.  
  2234. usmUserSecurityName OBJECT-TYPE
  2235.     SYNTAX       SnmpAdminString
  2236.     MAX-ACCESS   read-only
  2237.     STATUS       current
  2238.     DESCRIPTION "A human readable string representing the user in
  2239.  
  2240.  
  2241.  
  2242. Blumenthal & Wijnen         Standards Track                    [Page 40]
  2243.  
  2244. RFC 2574                     USM for SNMPv3                   April 1999
  2245.  
  2246.  
  2247.                  Security Model independent format.
  2248.  
  2249.                  The default transformation of the User-based Security
  2250.                  Model dependent security ID to the securityName and
  2251.                  vice versa is the identity function so that the
  2252.                  securityName is the same as the userName.
  2253.                 "
  2254.     ::= { usmUserEntry 3 }
  2255.  
  2256. usmUserCloneFrom OBJECT-TYPE
  2257.     SYNTAX       RowPointer
  2258.     MAX-ACCESS   read-create
  2259.     STATUS       current
  2260.     DESCRIPTION "A pointer to another conceptual row in this
  2261.                  usmUserTable.  The user in this other conceptual
  2262.                  row is called the clone-from user.
  2263.  
  2264.                  When a new user is created (i.e., a new conceptual
  2265.                  row is instantiated in this table), the privacy and
  2266.                  authentication parameters of the new user must be
  2267.                  cloned from its clone-from user. These parameters are:
  2268.                    - authentication protocol (usmUserAuthProtocol)
  2269.                    - privacy protocol (usmUserPrivProtocol)
  2270.                  They will be copied regardless of what the current
  2271.                  value is.
  2272.  
  2273.                  Cloning also causes the initial values of the secret
  2274.                  authentication key (authKey) and the secret encryption
  2275.                  key (privKey) of the new user to be set to the same
  2276.                  value as the corresponding secret of the clone-from
  2277.                  user.
  2278.  
  2279.                  The first time an instance of this object is set by
  2280.                  a management operation (either at or after its
  2281.                  instantiation), the cloning process is invoked.
  2282.                  Subsequent writes are successful but invoke no
  2283.                  action to be taken by the receiver.
  2284.                  The cloning process fails with an 'inconsistentName'
  2285.                  error if the conceptual row representing the
  2286.                  clone-from user does not exist or is not in an active
  2287.                  state when the cloning process is invoked.
  2288.  
  2289.                  When this object is read, the ZeroDotZero OID
  2290.                  is returned.
  2291.                 "
  2292.     ::= { usmUserEntry 4 }
  2293.  
  2294. usmUserAuthProtocol OBJECT-TYPE
  2295.  
  2296.  
  2297.  
  2298. Blumenthal & Wijnen         Standards Track                    [Page 41]
  2299.  
  2300. RFC 2574                     USM for SNMPv3                   April 1999
  2301.  
  2302.  
  2303.     SYNTAX       AutonomousType
  2304.     MAX-ACCESS   read-create
  2305.     STATUS       current
  2306.     DESCRIPTION "An indication of whether messages sent on behalf of
  2307.                  this user to/from the SNMP engine identified by
  2308.                  usmUserEngineID, can be authenticated, and if so,
  2309.                  the type of authentication protocol which is used.
  2310.  
  2311.                  An instance of this object is created concurrently
  2312.                  with the creation of any other object instance for
  2313.                  the same user (i.e., as part of the processing of
  2314.                  the set operation which creates the first object
  2315.                  instance in the same conceptual row).
  2316.  
  2317.                  If an initial set operation (i.e. at row creation time)
  2318.                  tries to set a value for an unknown or unsupported
  2319.                  protocol, then a 'wrongValue' error must be returned.
  2320.  
  2321.                  The value will be overwritten/set when a set operation
  2322.                  is performed on the corresponding instance of
  2323.                  usmUserCloneFrom.
  2324.  
  2325.                  Once instantiated, the value of such an instance of
  2326.                  this object can only be changed via a set operation to
  2327.                  the value of the usmNoAuthProtocol.
  2328.  
  2329.                  If a set operation tries to change the value of an
  2330.                  existing instance of this object to any value other
  2331.                  than usmNoAuthProtocol, then an 'inconsistentValue'
  2332.                  error must be returned.
  2333.  
  2334.                  If a set operation tries to set the value to the
  2335.                  usmNoAuthProtocol while the usmUserPrivProtocol value
  2336.                  in the same row is not equal to usmNoPrivProtocol,
  2337.                  then an 'inconsistentValue' error must be returned.
  2338.                  That means that an SNMP command generator application
  2339.                  must first ensure that the usmUserPrivProtocol is set
  2340.                  to the usmNoPrivProtocol value before it can set
  2341.                  the usmUserAuthProtocol value to usmNoAuthProtocol.
  2342.                 "
  2343.     DEFVAL      { usmNoAuthProtocol }
  2344.     ::= { usmUserEntry 5 }
  2345.  
  2346. usmUserAuthKeyChange OBJECT-TYPE
  2347.     SYNTAX       KeyChange   -- typically (SIZE (0 | 32)) for HMACMD5
  2348.                              -- typically (SIZE (0 | 40)) for HMACSHA
  2349.     MAX-ACCESS   read-create
  2350.     STATUS       current
  2351.  
  2352.  
  2353.  
  2354. Blumenthal & Wijnen         Standards Track                    [Page 42]
  2355.  
  2356. RFC 2574                     USM for SNMPv3                   April 1999
  2357.  
  2358.  
  2359.     DESCRIPTION "An object, which when modified, causes the secret
  2360.                  authentication key used for messages sent on behalf
  2361.                  of this user to/from the SNMP engine identified by
  2362.                  usmUserEngineID, to be modified via a one-way
  2363.                  function.
  2364.  
  2365.                  The associated protocol is the usmUserAuthProtocol.
  2366.                  The associated secret key is the user's secret
  2367.                  authentication key (authKey). The associated hash
  2368.                  algorithm is the algorithm used by the user's
  2369.                  usmUserAuthProtocol.
  2370.  
  2371.                  When creating a new user, it is an 'inconsistentName'
  2372.                  error for a set operation to refer to this object
  2373.                  unless it is previously or concurrently initialized
  2374.                  through a set operation on the corresponding instance
  2375.                  of usmUserCloneFrom.
  2376.  
  2377.                  When the value of the corresponding usmUserAuthProtocol
  2378.                  is usmNoAuthProtocol, then a set is successful, but
  2379.                  effectively is a no-op.
  2380.  
  2381.                  When this object is read, the zero-length (empty)
  2382.                  string is returned.
  2383.  
  2384.                  The recommended way to do a key change is as follows:
  2385.  
  2386.                    1) GET(usmUserSpinLock.0) and save in sValue.
  2387.                    2) generate the keyChange value based on the old
  2388.                       (existing) secret key and the new secret key,
  2389.                       let us call this kcValue.
  2390.  
  2391.                  If you do the key change on behalf of another user:
  2392.  
  2393.                    3) SET(usmUserSpinLock.0=sValue,
  2394.                           usmUserAuthKeyChange=kcValue
  2395.                           usmUserPublic=randomValue)
  2396.  
  2397.                  If you do the key change for yourself:
  2398.  
  2399.                    4) SET(usmUserSpinLock.0=sValue,
  2400.                           usmUserOwnAuthKeyChange=kcValue
  2401.                           usmUserPublic=randomValue)
  2402.  
  2403.                  If you get a response with error-status of noError,
  2404.                  then the SET succeeded and the new key is active.
  2405.                  If you do not get a response, then you can issue a
  2406.                  GET(usmUserPublic) and check if the value is equal
  2407.  
  2408.  
  2409.  
  2410. Blumenthal & Wijnen         Standards Track                    [Page 43]
  2411.  
  2412. RFC 2574                     USM for SNMPv3                   April 1999
  2413.  
  2414.  
  2415.                  to the randomValue you did send in the SET. If so, then
  2416.                  the key change succeeded and the new key is active
  2417.                  (probably the response got lost). If not, then the SET
  2418.                  request probably never reached the target and so you
  2419.                  can start over with the procedure above.
  2420.                 "
  2421.     DEFVAL      { ''H }    -- the empty string
  2422.     ::= { usmUserEntry 6 }
  2423.  
  2424. usmUserOwnAuthKeyChange OBJECT-TYPE
  2425.     SYNTAX       KeyChange   -- typically (SIZE (0 | 32)) for HMACMD5
  2426.                              -- typically (SIZE (0 | 40)) for HMACSHA
  2427.     MAX-ACCESS   read-create
  2428.     STATUS       current
  2429.     DESCRIPTION "Behaves exactly as usmUserAuthKeyChange, with one
  2430.                  notable difference: in order for the set operation
  2431.                  to succeed, the usmUserName of the operation
  2432.                  requester must match the usmUserName that
  2433.                  indexes the row which is targeted by this
  2434.                  operation.
  2435.                  In addition, the USM security model must be
  2436.                  used for this operation.
  2437.  
  2438.                  The idea here is that access to this column can be
  2439.                  public, since it will only allow a user to change
  2440.                  his own secret authentication key (authKey).
  2441.                  Note that this can only be done once the row is active.
  2442.  
  2443.                  When a set is received and the usmUserName of the
  2444.                  requester is not the same as the umsUserName that
  2445.                  indexes the row which is targeted by this operation,
  2446.                  then a 'noAccess' error must be returned.
  2447.  
  2448.                  When a set is received and the security model in use
  2449.                  is not USM, then a 'noAccess' error must be returned.
  2450.                 "
  2451.     DEFVAL      { ''H }    -- the empty string
  2452.     ::= { usmUserEntry 7 }
  2453.  
  2454. usmUserPrivProtocol OBJECT-TYPE
  2455.     SYNTAX       AutonomousType
  2456.     MAX-ACCESS   read-create
  2457.     STATUS       current
  2458.     DESCRIPTION "An indication of whether messages sent on behalf of
  2459.                  this user to/from the SNMP engine identified by
  2460.                  usmUserEngineID, can be protected from disclosure,
  2461.                  and if so, the type of privacy protocol which is used.
  2462.  
  2463.  
  2464.  
  2465.  
  2466. Blumenthal & Wijnen         Standards Track                    [Page 44]
  2467.  
  2468. RFC 2574                     USM for SNMPv3                   April 1999
  2469.  
  2470.  
  2471.                  An instance of this object is created concurrently
  2472.                  with the creation of any other object instance for
  2473.                  the same user (i.e., as part of the processing of
  2474.                  the set operation which creates the first object
  2475.                  instance in the same conceptual row).
  2476.  
  2477.                  If an initial set operation (i.e. at row creation time)
  2478.                  tries to set a value for an unknown or unsupported
  2479.                  protocol, then a 'wrongValue' error must be returned.
  2480.  
  2481.                  The value will be overwritten/set when a set operation
  2482.                  is performed on the corresponding instance of
  2483.                  usmUserCloneFrom.
  2484.  
  2485.                  Once instantiated, the value of such an instance of
  2486.                  this object can only be changed via a set operation to
  2487.                  the value of the usmNoPrivProtocol.
  2488.  
  2489.                  If a set operation tries to change the value of an
  2490.                  existing instance of this object to any value other
  2491.                  than usmNoPrivProtocol, then an 'inconsistentValue'
  2492.                  error must be returned.
  2493.  
  2494.                  Note that if any privacy protocol is used, then you
  2495.                  must also use an authentication protocol. In other
  2496.                  words, if usmUserPrivProtocol is set to anything else
  2497.                  than usmNoPrivProtocol, then the corresponding instance
  2498.                  of usmUserAuthProtocol cannot have a value of
  2499.                  usmNoAuthProtocol. If it does, then an
  2500.                  'inconsistentValue' error must be returned.
  2501.                 "
  2502.     DEFVAL      { usmNoPrivProtocol }
  2503.     ::= { usmUserEntry 8 }
  2504.  
  2505. usmUserPrivKeyChange OBJECT-TYPE
  2506.     SYNTAX       KeyChange  -- typically (SIZE (0 | 32)) for DES
  2507.     MAX-ACCESS   read-create
  2508.     STATUS       current
  2509.     DESCRIPTION "An object, which when modified, causes the secret
  2510.                  encryption key used for messages sent on behalf
  2511.                  of this user to/from the SNMP engine identified by
  2512.                  usmUserEngineID, to be modified via a one-way
  2513.                  function.
  2514.  
  2515.                  The associated protocol is the usmUserPrivProtocol.
  2516.                  The associated secret key is the user's secret
  2517.                  privacy key (privKey). The associated hash
  2518.                  algorithm is the algorithm used by the user's
  2519.  
  2520.  
  2521.  
  2522. Blumenthal & Wijnen         Standards Track                    [Page 45]
  2523.  
  2524. RFC 2574                     USM for SNMPv3                   April 1999
  2525.  
  2526.  
  2527.                  usmUserAuthProtocol.
  2528.  
  2529.                  When creating a new user, it is an 'inconsistentName'
  2530.                  error for a set operation to refer to this object
  2531.                  unless it is previously or concurrently initialized
  2532.                  through a set operation on the corresponding instance
  2533.                  of usmUserCloneFrom.
  2534.  
  2535.                  When the value of the corresponding usmUserPrivProtocol
  2536.                  is usmNoPrivProtocol, then a set is successful, but
  2537.                  effectively is a no-op.
  2538.  
  2539.                  When this object is read, the zero-length (empty)
  2540.                  string is returned.
  2541.                  See the description clause of usmUserAuthKeyChange for
  2542.                  a recommended procedure to do a key change.
  2543.                 "
  2544.     DEFVAL      { ''H }    -- the empty string
  2545.     ::= { usmUserEntry 9 }
  2546.  
  2547. usmUserOwnPrivKeyChange OBJECT-TYPE
  2548.     SYNTAX       KeyChange  -- typically (SIZE (0 | 32)) for DES
  2549.     MAX-ACCESS   read-create
  2550.     STATUS       current
  2551.     DESCRIPTION "Behaves exactly as usmUserPrivKeyChange, with one
  2552.                  notable difference: in order for the Set operation
  2553.                  to succeed, the usmUserName of the operation
  2554.                  requester must match the usmUserName that indexes
  2555.                  the row which is targeted by this operation.
  2556.                  In addition, the USM security model must be
  2557.                  used for this operation.
  2558.  
  2559.                  The idea here is that access to this column can be
  2560.                  public, since it will only allow a user to change
  2561.                  his own secret privacy key (privKey).
  2562.                  Note that this can only be done once the row is active.
  2563.  
  2564.                  When a set is received and the usmUserName of the
  2565.                  requester is not the same as the umsUserName that
  2566.                  indexes the row which is targeted by this operation,
  2567.                  then a 'noAccess' error must be returned.
  2568.  
  2569.                  When a set is received and the security model in use
  2570.                  is not USM, then a 'noAccess' error must be returned.
  2571.                 "
  2572.     DEFVAL      { ''H }    -- the empty string
  2573.     ::= { usmUserEntry 10 }
  2574.  
  2575.  
  2576.  
  2577.  
  2578. Blumenthal & Wijnen         Standards Track                    [Page 46]
  2579.  
  2580. RFC 2574                     USM for SNMPv3                   April 1999
  2581.  
  2582.  
  2583. usmUserPublic    OBJECT-TYPE
  2584.     SYNTAX       OCTET STRING (SIZE(0..32))
  2585.     MAX-ACCESS   read-create
  2586.     STATUS       current
  2587.     DESCRIPTION "A publicly-readable value which can be written as part
  2588.                  of the procedure for changing a user's secret
  2589.                  authentication and/or privacy key, and later read to
  2590.                  determine whether the change of the secret was
  2591.                  effected.
  2592.                 "
  2593.     DEFVAL      { ''H }  -- the empty string
  2594.     ::= { usmUserEntry 11 }
  2595.  
  2596. usmUserStorageType OBJECT-TYPE
  2597.     SYNTAX       StorageType
  2598.     MAX-ACCESS   read-create
  2599.     STATUS       current
  2600.     DESCRIPTION "The storage type for this conceptual row.
  2601.  
  2602.                  Conceptual rows having the value 'permanent' must
  2603.                  allow write-access at a minimum to:
  2604.  
  2605.                  - usmUserAuthKeyChange, usmUserOwnAuthKeyChange
  2606.                    and usmUserPublic for a user who employs
  2607.                    authentication, and
  2608.                  - usmUserPrivKeyChange, usmUserOwnPrivKeyChange
  2609.                    and usmUserPublic for a user who employs
  2610.                    privacy.
  2611.  
  2612.                  Note that any user who employs authentication or
  2613.                  privacy must allow its secret(s) to be updated and
  2614.                  thus cannot be 'readOnly'.
  2615.  
  2616.                  If an initial set operation tries to set the value to
  2617.                  'readOnly' for a user who employs authentication or
  2618.                  privacy, then an 'inconsistentValue' error must be
  2619.                  returned.  Note that if the value has been previously
  2620.                  set (implicit or explicit) to any value, then the rules
  2621.                  as defined in the StorageType Textual Convention apply.
  2622.  
  2623.                  It is an implementation issue to decide if a SET for
  2624.                  a readOnly or permanent row is accepted at all. In some
  2625.                  contexts this may make sense, in others it may not. If
  2626.                  a SET for a readOnly or permanent row is not accepted
  2627.                  at all, then a 'wrongValue' error must be returned.
  2628.                 "
  2629.     DEFVAL      { nonVolatile }
  2630.     ::= { usmUserEntry 12 }
  2631.  
  2632.  
  2633.  
  2634. Blumenthal & Wijnen         Standards Track                    [Page 47]
  2635.  
  2636. RFC 2574                     USM for SNMPv3                   April 1999
  2637.  
  2638.  
  2639. usmUserStatus    OBJECT-TYPE
  2640.     SYNTAX       RowStatus
  2641.     MAX-ACCESS   read-create
  2642.     STATUS       current
  2643.     DESCRIPTION "The status of this conceptual row.
  2644.  
  2645.                  Until instances of all corresponding columns are
  2646.                  appropriately configured, the value of the
  2647.                  corresponding instance of the usmUserStatus column
  2648.                  is 'notReady'.
  2649.  
  2650.                  In particular, a newly created row for a user who
  2651.                  employs authentication, cannot be made active until the
  2652.                  corresponding usmUserCloneFrom and usmUserAuthKeyChange
  2653.                  have been set.
  2654.  
  2655.                  Further, a newly created row for a user who also
  2656.                  employs privacy, cannot be made active until the
  2657.                  usmUserPrivKeyChange has been set.
  2658.  
  2659.                  The RowStatus TC [RFC2579] requires that this
  2660.                  DESCRIPTION clause states under which circumstances
  2661.                  other objects in this row can be modified:
  2662.  
  2663.                  The value of this object has no effect on whether
  2664.                  other objects in this conceptual row can be modified,
  2665.                  except for usmUserOwnAuthKeyChange and
  2666.                  usmUserOwnPrivKeyChange. For these 2 objects, the
  2667.                  value of usmUserStatus MUST be active.
  2668.                 "
  2669.     ::= { usmUserEntry 13 }
  2670.  
  2671. -- Conformance Information *******************************************
  2672.  
  2673. usmMIBCompliances OBJECT IDENTIFIER ::= { usmMIBConformance 1 }
  2674. usmMIBGroups      OBJECT IDENTIFIER ::= { usmMIBConformance 2 }
  2675.  
  2676. -- Compliance statements
  2677.  
  2678. usmMIBCompliance MODULE-COMPLIANCE
  2679.     STATUS       current
  2680.     DESCRIPTION "The compliance statement for SNMP engines which
  2681.                  implement the SNMP-USER-BASED-SM-MIB.
  2682.                 "
  2683.  
  2684.     MODULE       -- this module
  2685.         MANDATORY-GROUPS { usmMIBBasicGroup }
  2686.  
  2687.  
  2688.  
  2689.  
  2690. Blumenthal & Wijnen         Standards Track                    [Page 48]
  2691.  
  2692. RFC 2574                     USM for SNMPv3                   April 1999
  2693.  
  2694.  
  2695.         OBJECT           usmUserAuthProtocol
  2696.         MIN-ACCESS       read-only
  2697.         DESCRIPTION     "Write access is not required."
  2698.  
  2699.         OBJECT           usmUserPrivProtocol
  2700.         MIN-ACCESS       read-only
  2701.         DESCRIPTION     "Write access is not required."
  2702.  
  2703.     ::= { usmMIBCompliances 1 }
  2704.  
  2705. -- Units of compliance
  2706. usmMIBBasicGroup OBJECT-GROUP
  2707.     OBJECTS     {
  2708.                   usmStatsUnsupportedSecLevels,
  2709.                   usmStatsNotInTimeWindows,
  2710.                   usmStatsUnknownUserNames,
  2711.                   usmStatsUnknownEngineIDs,
  2712.                   usmStatsWrongDigests,
  2713.                   usmStatsDecryptionErrors,
  2714.                   usmUserSpinLock,
  2715.                   usmUserSecurityName,
  2716.                   usmUserCloneFrom,
  2717.                   usmUserAuthProtocol,
  2718.                   usmUserAuthKeyChange,
  2719.                   usmUserOwnAuthKeyChange,
  2720.                   usmUserPrivProtocol,
  2721.                   usmUserPrivKeyChange,
  2722.                   usmUserOwnPrivKeyChange,
  2723.                   usmUserPublic,
  2724.                   usmUserStorageType,
  2725.                   usmUserStatus
  2726.                 }
  2727.     STATUS       current
  2728.     DESCRIPTION "A collection of objects providing for configuration
  2729.                  of an SNMP engine which implements the SNMP
  2730.                  User-based Security Model.
  2731.                 "
  2732.     ::= { usmMIBGroups 1 }
  2733.  
  2734. END
  2735.  
  2736.  
  2737.  
  2738.  
  2739.  
  2740.  
  2741.  
  2742.  
  2743.  
  2744.  
  2745.  
  2746. Blumenthal & Wijnen         Standards Track                    [Page 49]
  2747.  
  2748. RFC 2574                     USM for SNMPv3                   April 1999
  2749.  
  2750.  
  2751. 6.  HMAC-MD5-96 Authentication Protocol
  2752.  
  2753.    This section describes the HMAC-MD5-96 authentication protocol.  This
  2754.    authentication protocol is the first defined for the User-based
  2755.    Security Model. It uses MD5 hash-function which is described in
  2756.    [MD5], in HMAC mode described in [RFC2104], truncating the output to
  2757.    96 bits.
  2758.  
  2759.    This protocol is identified by usmHMACMD5AuthProtocol.
  2760.  
  2761.    Over time, other authentication protocols may be defined either as a
  2762.    replacement of this protocol or in addition to this protocol.
  2763.  
  2764. 6.1.  Mechanisms
  2765.  
  2766.    - In support of data integrity, a message digest algorithm is
  2767.      required.  A digest is calculated over an appropriate portion of an
  2768.      SNMP message and included as part of the message sent to the
  2769.      recipient.
  2770.  
  2771.    - In support of data origin authentication and data integrity,
  2772.      a secret value is prepended to SNMP message prior to computing the
  2773.      digest; the calculated digest is partially inserted into the SNMP
  2774.      message prior to transmission, and the prepended value is not
  2775.      transmitted.  The secret value is shared by all SNMP engines
  2776.      authorized to originate messages on behalf of the appropriate user.
  2777.  
  2778. 6.1.1.  Digest Authentication Mechanism
  2779.  
  2780.    The Digest Authentication Mechanism defined in this memo provides
  2781.    for:
  2782.  
  2783.    - verification of the integrity of a received message, i.e., the
  2784.      message received is the message sent.
  2785.  
  2786.      The integrity of the message is protected by computing a digest
  2787.      over an appropriate portion of the message.  The digest is computed
  2788.      by the originator of the message, transmitted with the message, and
  2789.      verified by the recipient of the message.
  2790.  
  2791.    - verification of the user on whose behalf the message was generated.
  2792.  
  2793.      A secret value known only to SNMP engines authorized to generate
  2794.      messages on behalf of a user is used in HMAC mode (see [RFC2104]).
  2795.      It also recommends the hash-function output used as Message
  2796.      Authentication Code, to be truncated.
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802. Blumenthal & Wijnen         Standards Track                    [Page 50]
  2803.  
  2804. RFC 2574                     USM for SNMPv3                   April 1999
  2805.  
  2806.  
  2807.    This protocol uses the MD5 [MD5] message digest algorithm.  A 128-bit
  2808.    MD5 digest is calculated in a special (HMAC) way over the designated
  2809.    portion of an SNMP message and the first 96 bits of this digest is
  2810.    included as part of the message sent to the recipient. The size of
  2811.    the digest carried in a message is 12 octets. The size of the private
  2812.    authentication key (the secret) is 16 octets. For the details see
  2813.    section 6.3.
  2814.  
  2815. 6.2.  Elements of the Digest Authentication Protocol
  2816.  
  2817.    This section contains definitions required to realize the
  2818.    authentication module defined in this section of this memo.
  2819.  
  2820. 6.2.1.  Users
  2821.  
  2822.    Authentication using this authentication protocol makes use of a
  2823.    defined set of userNames. For any user on whose behalf a message must
  2824.    be authenticated at a particular SNMP engine, that SNMP engine must
  2825.    have knowledge of that user. An SNMP engine that wishes to
  2826.    communicate with another SNMP engine must also have knowledge of a
  2827.    user known to that engine, including knowledge of the applicable
  2828.    attributes of that user.
  2829.  
  2830.    A user and its attributes are defined as follows:
  2831.  
  2832.    <userName>
  2833.      A string representing the name of the user.
  2834.    <authKey>
  2835.      A user's secret key to be used when calculating a digest.
  2836.      It MUST be 16 octets long for MD5.
  2837.  
  2838. 6.2.2.  msgAuthoritativeEngineID
  2839.  
  2840.    The msgAuthoritativeEngineID value contained in an authenticated
  2841.    message specifies the authoritative SNMP engine for that particular
  2842.    message (see the definition of SnmpEngineID in the SNMP Architecture
  2843.    document [RFC2571]).
  2844.  
  2845.    The user's (private) authentication key is normally different at each
  2846.    authoritative SNMP engine and so the snmpEngineID is used to select
  2847.    the proper key for the authentication process.
  2848.  
  2849. 6.2.3.  SNMP Messages Using this Authentication Protocol
  2850.  
  2851.    Messages using this authentication protocol carry a
  2852.    msgAuthenticationParameters field as part of the
  2853.    msgSecurityParameters.  For this protocol, the
  2854.  
  2855.  
  2856.  
  2857.  
  2858. Blumenthal & Wijnen         Standards Track                    [Page 51]
  2859.  
  2860. RFC 2574                     USM for SNMPv3                   April 1999
  2861.  
  2862.  
  2863.    msgAuthenticationParameters field is the serialized OCTET STRING
  2864.    representing the first 12 octets of the HMAC-MD5-96 output done over
  2865.    the wholeMsg.
  2866.  
  2867.    The digest is calculated over the wholeMsg so if a message is
  2868.    authenticated, that also means that all the fields in the message are
  2869.    intact and have not been tampered with.
  2870.  
  2871. 6.2.4.  Services provided by the HMAC-MD5-96 Authentication Module
  2872.  
  2873.    This section describes the inputs and outputs that the HMAC-MD5-96
  2874.    Authentication module expects and produces when the User-based
  2875.    Security module calls the HMAC-MD5-96 Authentication module for
  2876.    services.
  2877.  
  2878. 6.2.4.1.  Services for Generating an Outgoing SNMP Message
  2879.  
  2880.    The HMAC-MD5-96 authentication protocol assumes that the selection of
  2881.    the authKey is done by the caller and that the caller passes the
  2882.    secret key to be used.
  2883.  
  2884.    Upon completion the authentication module returns statusInformation
  2885.    and, if the message digest was correctly calculated, the wholeMsg
  2886.    with the digest inserted at the proper place. The abstract service
  2887.    primitive is:
  2888.  
  2889.    statusInformation =              -- success or failure
  2890.      authenticateOutgoingMsg(
  2891.      IN   authKey                   -- secret key for authentication
  2892.      IN   wholeMsg                  -- unauthenticated complete message
  2893.      OUT  authenticatedWholeMsg     -- complete authenticated message
  2894.           )
  2895.  
  2896.    The abstract data elements are:
  2897.  
  2898.      statusInformation
  2899.        An indication of whether the authentication process was
  2900.        successful.  If not it is an indication of the problem.
  2901.      authKey
  2902.        The secret key to be used by the authentication algorithm.
  2903.        The length of this key MUST be 16 octets.
  2904.      wholeMsg
  2905.        The message to be authenticated.
  2906.      authenticatedWholeMsg
  2907.        The authenticated message (including inserted digest) on output.
  2908.  
  2909.  
  2910.  
  2911.  
  2912.  
  2913.  
  2914. Blumenthal & Wijnen         Standards Track                    [Page 52]
  2915.  
  2916. RFC 2574                     USM for SNMPv3                   April 1999
  2917.  
  2918.  
  2919.    Note, that authParameters field is filled by the authentication
  2920.    module and this module and this field should be already present in
  2921.    the wholeMsg before the Message Authentication Code (MAC) is
  2922.    generated.
  2923.  
  2924. 6.2.4.2.  Services for Processing an Incoming SNMP Message
  2925.  
  2926.    The HMAC-MD5-96 authentication protocol assumes that the selection of
  2927.    the authKey is done by the caller and that the caller passes the
  2928.    secret key to be used.
  2929.  
  2930.    Upon completion the authentication module returns statusInformation
  2931.    and, if the message digest was correctly calculated, the wholeMsg as
  2932.    it was processed. The abstract service primitive is:
  2933.  
  2934.    statusInformation =              -- success or failure
  2935.      authenticateIncomingMsg(
  2936.      IN   authKey                   -- secret key for authentication
  2937.      IN   authParameters            -- as received on the wire
  2938.      IN   wholeMsg                  -- as received on the wire
  2939.      OUT  authenticatedWholeMsg     -- complete authenticated message
  2940.        )
  2941.  
  2942.    The abstract data elements are:
  2943.  
  2944.      statusInformation
  2945.        An indication of whether the authentication process was
  2946.        successful.  If not it is an indication of the problem.
  2947.      authKey
  2948.        The secret key to be used by the authentication algorithm.
  2949.        The length of this key MUST be 16 octets.
  2950.      authParameters
  2951.        The authParameters from the incoming message.
  2952.      wholeMsg
  2953.        The message to be authenticated on input and the authenticated
  2954.        message on output.
  2955.      authenticatedWholeMsg
  2956.        The whole message after the authentication check is complete.
  2957.  
  2958. 6.3.  Elements of Procedure
  2959.  
  2960.    This section describes the procedures for the HMAC-MD5-96
  2961.    authentication protocol.
  2962.  
  2963.  
  2964.  
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970. Blumenthal & Wijnen         Standards Track                    [Page 53]
  2971.  
  2972. RFC 2574                     USM for SNMPv3                   April 1999
  2973.  
  2974.  
  2975. 6.3.1.  Processing an Outgoing Message
  2976.  
  2977.    This section describes the procedure followed by an SNMP engine
  2978.    whenever it must authenticate an outgoing message using the
  2979.    usmHMACMD5AuthProtocol.
  2980.  
  2981.    1) The msgAuthenticationParameters field is set to the serialization,
  2982.       according to the rules in [RFC1906], of an OCTET STRING containing
  2983.       12 zero octets.
  2984.  
  2985.    2) From the secret authKey, two keys K1 and K2 are derived:
  2986.  
  2987.          a) extend the authKey to 64 octets by appending 48 zero
  2988.             octets; save it as extendedAuthKey
  2989.          b) obtain IPAD by replicating the octet 0x36 64 times;
  2990.          c) obtain K1 by XORing extendedAuthKey with IPAD;
  2991.          d) obtain OPAD by replicating the octet 0x5C 64 times;
  2992.          e) obtain K2 by XORing extendedAuthKey with OPAD.
  2993.  
  2994.    3) Prepend K1 to the wholeMsg and calculate MD5 digest over it
  2995.       according to [MD5].
  2996.  
  2997.    4) Prepend K2 to the result of the step 4 and calculate MD5 digest
  2998.       over it according to [MD5]. Take the first 12 octets of the final
  2999.       digest - this is Message Authentication Code (MAC).
  3000.  
  3001.    5) Replace the msgAuthenticationParameters field with MAC obtained
  3002.       in the step 4.
  3003.  
  3004.    6) The authenticatedWholeMsg is then returned to the caller
  3005.       together with statusInformation indicating success.
  3006.  
  3007. 6.3.2.  Processing an Incoming Message
  3008.  
  3009.    This section describes the procedure followed by an SNMP engine
  3010.    whenever it must authenticate an incoming message using the
  3011.    usmHMACMD5AuthProtocol.
  3012.  
  3013.    1)  If the digest received in the msgAuthenticationParameters field
  3014.        is not 12 octets long, then an failure and an errorIndication
  3015.        (authenticationError) is returned to the calling module.
  3016.  
  3017.    2)  The MAC received in the msgAuthenticationParameters field
  3018.        is saved.
  3019.  
  3020.    3)  The digest in the msgAuthenticationParameters field is replaced
  3021.        by the 12 zero octets.
  3022.  
  3023.  
  3024.  
  3025.  
  3026. Blumenthal & Wijnen         Standards Track                    [Page 54]
  3027.  
  3028. RFC 2574                     USM for SNMPv3                   April 1999
  3029.  
  3030.  
  3031.    4)  From the secret authKey, two keys K1 and K2 are derived:
  3032.  
  3033.          a) extend the authKey to 64 octets by appending 48 zero
  3034.             octets; save it as extendedAuthKey
  3035.          b) obtain IPAD by replicating the octet 0x36 64 times;
  3036.          c) obtain K1 by XORing extendedAuthKey with IPAD;
  3037.          d) obtain OPAD by replicating the octet 0x5C 64 times;
  3038.          e) obtain K2 by XORing extendedAuthKey with OPAD.
  3039.  
  3040.    5)  The MAC is calculated over the wholeMsg:
  3041.  
  3042.          a) prepend K1 to the wholeMsg and calculate the MD5 digest
  3043.             over it;
  3044.          b) prepend K2 to the result of step 5.a and calculate the
  3045.             MD5 digest over it;
  3046.          c) first 12 octets of the result of step 5.b is the MAC.
  3047.  
  3048.        The msgAuthenticationParameters field is replaced with the MAC
  3049.        value that was saved in step 2.
  3050.  
  3051.    6)  Then the newly calculated MAC is compared with the MAC
  3052.        saved in step 2. If they do not match, then an failure and an
  3053.        errorIndication (authenticationFailure) is returned to the
  3054.        calling module.
  3055.  
  3056.    7)  The authenticatedWholeMsg and statusInformation indicating
  3057.        success are then returned to the caller.
  3058.  
  3059.  
  3060. 7.  HMAC-SHA-96 Authentication Protocol
  3061.  
  3062.    This section describes the HMAC-SHA-96 authentication protocol.  This
  3063.    protocol uses the SHA hash-function which is described in [SHA-NIST],
  3064.    in HMAC mode described in [RFC2104], truncating the output to 96
  3065.    bits.
  3066.  
  3067.    This protocol is identified by usmHMACSHAAuthProtocol.
  3068.  
  3069.    Over time, other authentication protocols may be defined either as a
  3070.    replacement of this protocol or in addition to this protocol.
  3071.  
  3072. 7.1.  Mechanisms
  3073.  
  3074.    - In support of data integrity, a message digest algorithm is
  3075.      required.  A digest is calculated over an appropriate portion of an
  3076.      SNMP message and included as part of the message sent to the
  3077.      recipient.
  3078.  
  3079.  
  3080.  
  3081.  
  3082. Blumenthal & Wijnen         Standards Track                    [Page 55]
  3083.  
  3084. RFC 2574                     USM for SNMPv3                   April 1999
  3085.  
  3086.  
  3087.    - In support of data origin authentication and data integrity,
  3088.      a secret value is prepended to the SNMP message prior to computing
  3089.      the digest; the calculated digest is then partially inserted into
  3090.      the message prior to transmission. The prepended secret is not
  3091.      transmitted.  The secret value is shared by all SNMP engines
  3092.      authorized to originate messages on behalf of the appropriate user.
  3093.  
  3094. 7.1.1.  Digest Authentication Mechanism
  3095.  
  3096.    The Digest Authentication Mechanism defined in this memo provides
  3097.    for:
  3098.  
  3099.    - verification of the integrity of a received message, i.e., the
  3100.      the message received is the message sent.
  3101.  
  3102.      The integrity of the message is protected by computing a digest
  3103.      over an appropriate portion of the message.  The digest is computed
  3104.      by the originator of the message, transmitted with the message, and
  3105.      verified by the recipient of the message.
  3106.  
  3107.    - verification of the user on whose behalf the message was generated.
  3108.  
  3109.      A secret value known only to SNMP engines authorized to generate
  3110.      messages on behalf of a user is used in HMAC mode (see [RFC2104]).
  3111.      It also recommends the hash-function output used as Message
  3112.      Authentication Code, to be truncated.
  3113.  
  3114.    This mechanism uses the SHA [SHA-NIST] message digest algorithm.  A
  3115.    160-bit SHA digest is calculated in a special (HMAC) way over the
  3116.    designated portion of an SNMP message and the first 96 bits of this
  3117.    digest is included as part of the message sent to the recipient. The
  3118.    size of the digest carried in a message is 12 octets. The size of the
  3119.    private authentication key (the secret) is 20 octets. For the details
  3120.    see section 7.3.
  3121.  
  3122. 7.2.  Elements of the HMAC-SHA-96 Authentication Protocol
  3123.  
  3124.    This section contains definitions required to realize the
  3125.    authentication module defined in this section of this memo.
  3126.  
  3127. 7.2.1.  Users
  3128.  
  3129.    Authentication using this authentication protocol makes use of a
  3130.    defined set of userNames.  For any user on whose behalf a message
  3131.    must be authenticated at a particular SNMP engine, that SNMP engine
  3132.    must have knowledge of that user.  An SNMP engine that wishes to
  3133.  
  3134.  
  3135.  
  3136.  
  3137.  
  3138. Blumenthal & Wijnen         Standards Track                    [Page 56]
  3139.  
  3140. RFC 2574                     USM for SNMPv3                   April 1999
  3141.  
  3142.  
  3143.    communicate with another SNMP engine must also have knowledge of a
  3144.    user known to that engine, including knowledge of the applicable
  3145.    attributes of that user.
  3146.  
  3147.    A user and its attributes are defined as follows:
  3148.  
  3149.    <userName>
  3150.      A string representing the name of the user.
  3151.    <authKey>
  3152.      A user's secret key to be used when calculating a digest.
  3153.      It MUST be 20 octets long for SHA.
  3154.  
  3155. 7.2.2.  msgAuthoritativeEngineID
  3156.  
  3157.    The msgAuthoritativeEngineID value contained in an authenticated
  3158.    message specifies the authoritative SNMP engine for that particular
  3159.    message (see the definition of SnmpEngineID in the SNMP Architecture
  3160.    document [RFC2571]).
  3161.  
  3162.    The user's (private) authentication key is normally different at each
  3163.    authoritative SNMP engine and so the snmpEngineID is used to select
  3164.    the proper key for the authentication process.
  3165.  
  3166. 7.2.3.  SNMP Messages Using this Authentication Protocol
  3167.  
  3168.    Messages using this authentication protocol carry a
  3169.    msgAuthenticationParameters field as part of the
  3170.    msgSecurityParameters. For this protocol, the
  3171.    msgAuthenticationParameters field is the serialized OCTET STRING
  3172.    representing the first 12 octets of HMAC-SHA-96 output done over the
  3173.    wholeMsg.
  3174.  
  3175.    The digest is calculated over the wholeMsg so if a message is
  3176.    authenticated, that also means that all the fields in the message are
  3177.    intact and have not been tampered with.
  3178.  
  3179. 7.2.4.  Services provided by the HMAC-SHA-96 Authentication Module
  3180.  
  3181.    This section describes the inputs and outputs that the HMAC-SHA-96
  3182.    Authentication module expects and produces when the User-based
  3183.    Security module calls the HMAC-SHA-96 Authentication module for
  3184.    services.
  3185.  
  3186. 7.2.4.1.  Services for Generating an Outgoing SNMP Message
  3187.  
  3188.    HMAC-SHA-96 authentication protocol assumes that the selection of the
  3189.    authKey is done by the caller and that the caller passes the secret
  3190.    key to be used.
  3191.  
  3192.  
  3193.  
  3194. Blumenthal & Wijnen         Standards Track                    [Page 57]
  3195.  
  3196. RFC 2574                     USM for SNMPv3                   April 1999
  3197.  
  3198.  
  3199.    Upon completion the authentication module returns statusInformation
  3200.    and, if the message digest was correctly calculated, the wholeMsg
  3201.    with the digest inserted at the proper place. The abstract service
  3202.    primitive is:
  3203.  
  3204.    statusInformation =              -- success or failure
  3205.      authenticateOutgoingMsg(
  3206.      IN   authKey                   -- secret key for authentication
  3207.      IN   wholeMsg                  -- unauthenticated complete message
  3208.      OUT  authenticatedWholeMsg     -- complete authenticated message
  3209.           )
  3210.  
  3211.    The abstract data elements are:
  3212.  
  3213.      statusInformation
  3214.        An indication of whether the authentication process was
  3215.        successful.  If not it is an indication of the problem.
  3216.      authKey
  3217.        The secret key to be used by the authentication algorithm.
  3218.        The length of this key MUST be 20 octets.
  3219.      wholeMsg
  3220.        The message to be authenticated.
  3221.      authenticatedWholeMsg
  3222.        The authenticated message (including inserted digest) on output.
  3223.  
  3224.    Note, that authParameters field is filled by the authentication
  3225.    module and this field should be already present in the wholeMsg
  3226.    before the Message Authentication Code (MAC) is generated.
  3227.  
  3228. 7.2.4.2.  Services for Processing an Incoming SNMP Message
  3229.  
  3230.    HMAC-SHA-96 authentication protocol assumes that the selection of the
  3231.    authKey is done by the caller and that the caller passes the secret
  3232.    key to be used.
  3233.  
  3234.    Upon completion the authentication module returns statusInformation
  3235.    and, if the message digest was correctly calculated, the wholeMsg as
  3236.    it was processed. The abstract service primitive is:
  3237.  
  3238.    statusInformation =              -- success or failure
  3239.      authenticateIncomingMsg(
  3240.      IN   authKey                   -- secret key for authentication
  3241.      IN   authParameters            -- as received on the wire
  3242.      IN   wholeMsg                  -- as received on the wire
  3243.      OUT  authenticatedWholeMsg     -- complete authenticated message
  3244.        )
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250. Blumenthal & Wijnen         Standards Track                    [Page 58]
  3251.  
  3252. RFC 2574                     USM for SNMPv3                   April 1999
  3253.  
  3254.  
  3255.    The abstract data elements are:
  3256.  
  3257.      statusInformation
  3258.        An indication of whether the authentication process was
  3259.        successful.  If not it is an indication of the problem.
  3260.      authKey
  3261.        The secret key to be used by the authentication algorithm.
  3262.        The length of this key MUST be 20 octets.
  3263.      authParameters
  3264.        The authParameters from the incoming message.
  3265.      wholeMsg
  3266.        The message to be authenticated on input and the authenticated
  3267.        message on output.
  3268.      authenticatedWholeMsg
  3269.        The whole message after the authentication check is complete.
  3270.  
  3271. 7.3.  Elements of Procedure
  3272.  
  3273.    This section describes the procedures for the HMAC-SHA-96
  3274.    authentication protocol.
  3275.  
  3276. 7.3.1.  Processing an Outgoing Message
  3277.  
  3278.    This section describes the procedure followed by an SNMP engine
  3279.    whenever it must authenticate an outgoing message using the
  3280.    usmHMACSHAAuthProtocol.
  3281.  
  3282.    1) The msgAuthenticationParameters field is set to the
  3283.       serialization, according to the rules in [RFC1906], of an OCTET
  3284.       STRING containing 12 zero octets.
  3285.  
  3286.    2) From the secret authKey, two keys K1 and K2 are derived:
  3287.  
  3288.          a) extend the authKey to 64 octets by appending 44 zero
  3289.             octets; save it as extendedAuthKey
  3290.          b) obtain IPAD by replicating the octet 0x36 64 times;
  3291.          c) obtain K1 by XORing extendedAuthKey with IPAD;
  3292.          d) obtain OPAD by replicating the octet 0x5C 64 times;
  3293.          e) obtain K2 by XORing extendedAuthKey with OPAD.
  3294.  
  3295.    3) Prepend K1 to the wholeMsg and calculate the SHA digest over it
  3296.       according to [SHA-NIST].
  3297.  
  3298.    4) Prepend K2 to the result of the step 4 and calculate SHA digest
  3299.       over it according to [SHA-NIST]. Take the first 12 octets of the
  3300.       final digest - this is Message Authentication Code (MAC).
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306. Blumenthal & Wijnen         Standards Track                    [Page 59]
  3307.  
  3308. RFC 2574                     USM for SNMPv3                   April 1999
  3309.  
  3310.  
  3311.    5) Replace the msgAuthenticationParameters field with MAC obtained
  3312.       in the step 5.
  3313.  
  3314.    6) The authenticatedWholeMsg is then returned to the caller
  3315.       together with statusInformation indicating success.
  3316.  
  3317. 7.3.2.  Processing an Incoming Message
  3318.  
  3319.    This section describes the procedure followed by an SNMP engine
  3320.    whenever it must authenticate an incoming message using the
  3321.    usmHMACSHAAuthProtocol.
  3322.  
  3323.    1)  If the digest received in the msgAuthenticationParameters field
  3324.        is not 12 octets long, then an failure and an errorIndication
  3325.        (authenticationError) is returned to the calling module.
  3326.  
  3327.    2)  The MAC received in the msgAuthenticationParameters field
  3328.        is saved.
  3329.  
  3330.    3)  The digest in the msgAuthenticationParameters field is
  3331.        replaced by the 12 zero octets.
  3332.  
  3333.    4)  From the secret authKey, two keys K1 and K2 are derived:
  3334.  
  3335.          a) extend the authKey to 64 octets by appending 44 zero
  3336.             octets; save it as extendedAuthKey
  3337.          b) obtain IPAD by replicating the octet 0x36 64 times;
  3338.          c) obtain K1 by XORing extendedAuthKey with IPAD;
  3339.          d) obtain OPAD by replicating the octet 0x5C 64 times;
  3340.          e) obtain K2 by XORing extendedAuthKey with OPAD.
  3341.  
  3342.    5)  The MAC is calculated over the wholeMsg:
  3343.  
  3344.          a) prepend K1 to the wholeMsg and calculate the SHA digest
  3345.             over it;
  3346.          b) prepend K2 to the result of step 5.a and calculate the
  3347.             SHA digest over it;
  3348.          c) first 12 octets of the result of step 5.b is the MAC.
  3349.  
  3350.        The msgAuthenticationParameters field is replaced with the MAC
  3351.        value that was saved in step 2.
  3352.  
  3353.    6)  The the newly calculated MAC is compared with the MAC saved in
  3354.        step 2. If they do not match, then a failure and an
  3355.        errorIndication (authenticationFailure) are returned to the
  3356.        calling module.
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362. Blumenthal & Wijnen         Standards Track                    [Page 60]
  3363.  
  3364. RFC 2574                     USM for SNMPv3                   April 1999
  3365.  
  3366.  
  3367.    7)  The authenticatedWholeMsg and statusInformation indicating
  3368.        success are then returned to the caller.
  3369.  
  3370. 8.  CBC-DES Symmetric Encryption Protocol
  3371.  
  3372.    This section describes the CBC-DES Symmetric Encryption Protocol.
  3373.    This protocol is the first privacy protocol defined for the User-
  3374.    based Security Model.
  3375.  
  3376.    This protocol is identified by usmDESPrivProtocol.
  3377.  
  3378.    Over time, other privacy protocols may be defined either as a
  3379.    replacement of this protocol or in addition to this protocol.
  3380.  
  3381. 8.1.  Mechanisms
  3382.  
  3383.    - In support of data confidentiality, an encryption algorithm is
  3384.      required.  An appropriate portion of the message is encrypted prior
  3385.      to being transmitted. The User-based Security Model specifies that
  3386.      the scopedPDU is the portion of the message that needs to be
  3387.      encrypted.
  3388.  
  3389.    - A secret value in combination with a timeliness value is used
  3390.      to create the en/decryption key and the initialization vector.  The
  3391.      secret value is shared by all SNMP engines authorized to originate
  3392.      messages on behalf of the appropriate user.
  3393.  
  3394. 8.1.1.  Symmetric Encryption Protocol
  3395.  
  3396.    The Symmetric Encryption Protocol defined in this memo provides
  3397.    support for data confidentiality.  The designated portion of an SNMP
  3398.    message is encrypted and included as part of the message sent to the
  3399.    recipient.
  3400.  
  3401.    Two organizations have published specifications defining the DES:
  3402.    the National Institute of Standards and Technology (NIST) [DES-NIST]
  3403.    and the American National Standards Institute [DES-ANSI].  There is a
  3404.    companion Modes of Operation specification for each definition
  3405.    ([DESO-NIST] and [DESO-ANSI], respectively).
  3406.  
  3407.    The NIST has published three additional documents that implementors
  3408.    may find useful.
  3409.  
  3410.    - There is a document with guidelines for implementing and using
  3411.      the DES, including functional specifications for the DES and its
  3412.      modes of operation [DESG-NIST].
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418. Blumenthal & Wijnen         Standards Track                    [Page 61]
  3419.  
  3420. RFC 2574                     USM for SNMPv3                   April 1999
  3421.  
  3422.  
  3423.    - There is a specification of a validation test suite for the DES
  3424.      [DEST-NIST].  The suite is designed to test all aspects of the DES
  3425.      and is useful for pinpointing specific problems.
  3426.  
  3427.    - There is a specification of a maintenance test for the DES
  3428.      [DESM-NIST].  The test utilizes a minimal amount of data and
  3429.      processing to test all components of the DES.  It provides a simple
  3430.      yes-or-no indication of correct operation and is useful to run as
  3431.      part of an initialization step, e.g., when a computer re-boots.
  3432.  
  3433. 8.1.1.1.  DES key and Initialization Vector.
  3434.  
  3435.    The first 8 octets of the 16-octet secret (private privacy key) are
  3436.    used as a DES key.  Since DES uses only 56 bits, the Least
  3437.    Significant Bit in each octet is disregarded.
  3438.  
  3439.    The Initialization Vector for encryption is obtained using the
  3440.    following procedure.
  3441.  
  3442.    The last 8 octets of the 16-octet secret (private privacy key) are
  3443.    used as pre-IV.
  3444.  
  3445.    In order to ensure that the IV for two different packets encrypted by
  3446.    the same key, are not the same (i.e., the IV does not repeat) we need
  3447.    to "salt" the pre-IV with something unique per packet.  An 8-octet
  3448.    string is used as the "salt".  The concatenation of the generating
  3449.    SNMP engine's 32-bit snmpEngineBoots and a local 32-bit integer, that
  3450.    the encryption engine maintains, is input to the "salt".  The 32-bit
  3451.    integer is initialized to an arbitrary value at boot time.
  3452.  
  3453.    The 32-bit snmpEngineBoots is converted to the first 4 octets (Most
  3454.    Significant Byte first) of our "salt".  The 32-bit integer is then
  3455.    converted to the last 4 octet (Most Significant Byte first) of our
  3456.    "salt".  The resulting "salt" is then XOR-ed with the pre-IV to
  3457.    obtain the IV.  The 8-octet "salt" is then put into the
  3458.    privParameters field encoded as an OCTET STRING.  The "salt" integer
  3459.    is then modified.  We recommend that it be incremented by one and
  3460.    wrap when it reaches the maximum value.
  3461.  
  3462.    How exactly the value of the "salt" (and thus of the IV) varies, is
  3463.    an implementation issue, as long as the measures are taken to avoid
  3464.    producing a duplicate IV.
  3465.  
  3466.    The "salt" must be placed in the privParameters field to enable the
  3467.    receiving entity to compute the correct IV and to decrypt the
  3468.    message.
  3469.  
  3470.  
  3471.  
  3472.  
  3473.  
  3474. Blumenthal & Wijnen         Standards Track                    [Page 62]
  3475.  
  3476. RFC 2574                     USM for SNMPv3                   April 1999
  3477.  
  3478.  
  3479. 8.1.1.2.  Data Encryption.
  3480.  
  3481.    The data to be encrypted is treated as sequence of octets. Its length
  3482.    should be an integral multiple of 8 - and if it is not, the data is
  3483.    padded at the end as necessary.  The actual pad value is irrelevant.
  3484.  
  3485.    The data is encrypted in Cipher Block Chaining mode.
  3486.  
  3487.    The plaintext is divided into 64-bit blocks.
  3488.  
  3489.    The plaintext for each block is XOR-ed with the ciphertext of the
  3490.    previous block, the result is encrypted and the output of the
  3491.    encryption is the ciphertext for the block.  This procedure is
  3492.    repeated until there are no more plaintext blocks.
  3493.  
  3494.    For the very first block, the Initialization Vector is used instead
  3495.    of the ciphertext of the previous block.
  3496.  
  3497. 8.1.1.3.  Data Decryption
  3498.  
  3499.    Before decryption, the encrypted data length is verified.  If the
  3500.    length of the OCTET STRING to be decrypted is not an integral
  3501.    multiple of 8 octets, the decryption process is halted and an
  3502.    appropriate exception noted.  When decrypting, the padding is
  3503.    ignored.
  3504.  
  3505.    The first ciphertext block is decrypted, the decryption output is
  3506.    XOR-ed with the Initialization Vector, and the result is the first
  3507.    plaintext block.
  3508.  
  3509.    For each subsequent block, the ciphertext block is decrypted, the
  3510.    decryption output is XOR-ed with the previous ciphertext block and
  3511.    the result is the plaintext block.
  3512.  
  3513. 8.2.  Elements of the DES Privacy Protocol
  3514.  
  3515.    This section contains definitions required to realize the privacy
  3516.    module defined by this memo.
  3517.  
  3518. 8.2.1.  Users
  3519.  
  3520.    Data en/decryption using this Symmetric Encryption Protocol makes use
  3521.    of a defined set of userNames.  For any user on whose behalf a
  3522.    message must be en/decrypted at a particular SNMP engine, that SNMP
  3523.    engine must have knowledge of that user.  An SNMP engine that wishes
  3524.    to communicate with another SNMP engine must also have knowledge of a
  3525.    user known to that SNMP engine, including knowledge of the applicable
  3526.    attributes of that user.
  3527.  
  3528.  
  3529.  
  3530. Blumenthal & Wijnen         Standards Track                    [Page 63]
  3531.  
  3532. RFC 2574                     USM for SNMPv3                   April 1999
  3533.  
  3534.  
  3535.    A user and its attributes are defined as follows:
  3536.  
  3537.    <userName>
  3538.      An octet string representing the name of the user.
  3539.  
  3540.    <privKey>
  3541.      A user's secret key to be used as input for the DES key and IV.
  3542.      The length of this key MUST be 16 octets.
  3543.  
  3544. 8.2.2.  msgAuthoritativeEngineID
  3545.  
  3546.    The msgAuthoritativeEngineID value contained in an authenticated
  3547.    message specifies the authoritative SNMP engine for that particular
  3548.    message (see the definition of SnmpEngineID in the SNMP Architecture
  3549.    document [RFC2571]).
  3550.  
  3551.    The user's (private) privacy key is normally different at each
  3552.    authoritative SNMP engine and so the snmpEngineID is used to select
  3553.    the proper key for the en/decryption process.
  3554.  
  3555. 8.2.3.  SNMP Messages Using this Privacy Protocol
  3556.  
  3557.    Messages using this privacy protocol carry a msgPrivacyParameters
  3558.    field as part of the msgSecurityParameters. For this protocol, the
  3559.    msgPrivacyParameters field is the serialized OCTET STRING
  3560.    representing the "salt" that was used to create the IV.
  3561.  
  3562. 8.2.4.  Services provided by the DES Privacy Module
  3563.  
  3564.    This section describes the inputs and outputs that the DES Privacy
  3565.    module expects and produces when the User-based Security module
  3566.    invokes the DES Privacy module for services.
  3567.  
  3568. 8.2.4.1.  Services for Encrypting Outgoing Data
  3569.  
  3570.    This DES privacy protocol assumes that the selection of the privKey
  3571.    is done by the caller and that the caller passes the secret key to be
  3572.    used.
  3573.  
  3574.    Upon completion the privacy module returns statusInformation and, if
  3575.    the encryption process was successful, the encryptedPDU and the
  3576.    msgPrivacyParameters encoded as an OCTET STRING.  The abstract
  3577.    service primitive is:
  3578.  
  3579.    statusInformation =              -- success of failure
  3580.      encryptData(
  3581.      IN    encryptKey               -- secret key for encryption
  3582.      IN    dataToEncrypt            -- data to encrypt (scopedPDU)
  3583.  
  3584.  
  3585.  
  3586. Blumenthal & Wijnen         Standards Track                    [Page 64]
  3587.  
  3588. RFC 2574                     USM for SNMPv3                   April 1999
  3589.  
  3590.  
  3591.      OUT   encryptedData            -- encrypted data (encryptedPDU)
  3592.      OUT   privParameters           -- filled in by service provider
  3593.            )
  3594.  
  3595.    The abstract data elements are:
  3596.  
  3597.      statusInformation
  3598.        An indication of the success or failure of the encryption
  3599.        process.  In case of failure, it is an indication of the error.
  3600.      encryptKey
  3601.        The secret key to be used by the encryption algorithm.
  3602.        The length of this key MUST be 16 octets.
  3603.      dataToEncrypt
  3604.        The data that must be encrypted.
  3605.      encryptedData
  3606.        The encrypted data upon successful completion.
  3607.      privParameters
  3608.        The privParameters encoded as an OCTET STRING.
  3609.  
  3610. 8.2.4.2.  Services for Decrypting Incoming Data
  3611.  
  3612.    This DES privacy protocol assumes that the selection of the privKey
  3613.    is done by the caller and that the caller passes the secret key to be
  3614.    used.
  3615.  
  3616.    Upon completion the privacy module returns statusInformation and, if
  3617.    the decryption process was successful, the scopedPDU in plain text.
  3618.    The abstract service primitive is:
  3619.  
  3620.    statusInformation =
  3621.      decryptData(
  3622.      IN    decryptKey               -- secret key for decryption
  3623.      IN    privParameters           -- as received on the wire
  3624.      IN    encryptedData            -- encrypted data (encryptedPDU)
  3625.      OUT   decryptedData            -- decrypted data (scopedPDU)
  3626.            )
  3627.  
  3628.    The abstract data elements are:
  3629.  
  3630.      statusInformation
  3631.        An indication whether the data was successfully decrypted
  3632.        and if not an indication of the error.
  3633.      decryptKey
  3634.        The secret key to be used by the decryption algorithm.
  3635.        The length of this key MUST be 16 octets.
  3636.      privParameters
  3637.        The "salt" to be used to calculate the IV.
  3638.  
  3639.  
  3640.  
  3641.  
  3642. Blumenthal & Wijnen         Standards Track                    [Page 65]
  3643.  
  3644. RFC 2574                     USM for SNMPv3                   April 1999
  3645.  
  3646.  
  3647.      encryptedData
  3648.        The data to be decrypted.
  3649.      decryptedData
  3650.        The decrypted data.
  3651.  
  3652. 8.3.  Elements of Procedure.
  3653.  
  3654.    This section describes the procedures for the DES privacy protocol.
  3655.  
  3656. 8.3.1.  Processing an Outgoing Message
  3657.  
  3658.    This section describes the procedure followed by an SNMP engine
  3659.    whenever it must encrypt part of an outgoing message using the
  3660.    usmDESPrivProtocol.
  3661.  
  3662.    1)  The secret cryptKey is used to construct the DES encryption key,
  3663.        the "salt" and the DES pre-IV (from which the IV is computed as
  3664.        described in section 8.1.1.1).
  3665.  
  3666.    2)  The privParameters field is set to the serialization according
  3667.        to the rules in [RFC1906] of an OCTET STRING representing the the
  3668.        "salt" string.
  3669.  
  3670.    3)  The scopedPDU is encrypted (as described in section 8.1.1.2)
  3671.        and the encrypted data is serialized according to the rules in
  3672.        [RFC1906] as an OCTET STRING.
  3673.  
  3674.    4)  The serialized OCTET STRING representing the encrypted
  3675.        scopedPDU together with the privParameters and statusInformation
  3676.        indicating success is returned to the calling module.
  3677.  
  3678. 8.3.2.  Processing an Incoming Message
  3679.  
  3680.    This section describes the procedure followed by an SNMP engine
  3681.    whenever it must decrypt part of an incoming message using the
  3682.    usmDESPrivProtocol.
  3683.  
  3684.    1)  If the privParameters field is not an 8-octet OCTET STRING,
  3685.        then an error indication (decryptionError) is returned to the
  3686.        calling module.
  3687.  
  3688.    2)  The "salt" is extracted from the privParameters field.
  3689.  
  3690.    3)  The secret cryptKey and the "salt" are then used to construct the
  3691.        DES decryption key and pre-IV (from which the IV is computed as
  3692.        described in section 8.1.1.1).
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698. Blumenthal & Wijnen         Standards Track                    [Page 66]
  3699.  
  3700. RFC 2574                     USM for SNMPv3                   April 1999
  3701.  
  3702.  
  3703.    4)  The encryptedPDU is then decrypted (as described in
  3704.        section 8.1.1.3).
  3705.  
  3706.    5)  If the encryptedPDU cannot be decrypted, then an error
  3707.        indication (decryptionError) is returned to the calling module.
  3708.  
  3709.    6)  The decrypted scopedPDU and statusInformation indicating
  3710.        success are returned to the calling module.
  3711.  
  3712. 9.  Intellectual Property
  3713.  
  3714.    The IETF takes no position regarding the validity or scope of any
  3715.    intellectual property or other rights that might be claimed to
  3716.    pertain to the implementation or use of the technology described in
  3717.    this document or the extent to which any license under such rights
  3718.    might or might not be available; neither does it represent that it
  3719.    has made any effort to identify any such rights.  Information on the
  3720.    IETF's procedures with respect to rights in standards-track and
  3721.    standards-related documentation can be found in BCP-11.  Copies of
  3722.    claims of rights made available for publication and any assurances of
  3723.    licenses to be made available, or the result of an attempt made to
  3724.    obtain a general license or permission for the use of such
  3725.    proprietary rights by implementors or users of this specification can
  3726.    be obtained from the IETF Secretariat.
  3727.  
  3728.    The IETF invites any interested party to bring to its attention any
  3729.    copyrights, patents or patent applications, or other proprietary
  3730.    rights which may cover technology that may be required to practice
  3731.    this standard.  Please address the information to the IETF Executive
  3732.    Director.
  3733.  
  3734. 10.  Acknowledgements
  3735.  
  3736.    This document is the result of the efforts of the SNMPv3 Working
  3737.    Group.  Some special thanks are in order to the following SNMPv3 WG
  3738.    members:
  3739.  
  3740.       Harald Tveit Alvestrand (Maxware)
  3741.       Dave Battle (SNMP Research, Inc.)
  3742.       Alan Beard (Disney Worldwide Services)
  3743.       Paul Berrevoets (SWI Systemware/Halcyon Inc.)
  3744.       Martin Bjorklund (Ericsson)
  3745.       Uri Blumenthal (IBM T.J. Watson Research Center)
  3746.       Jeff Case (SNMP Research, Inc.)
  3747.       John Curran (BBN)
  3748.       Mike Daniele (Compaq Computer Corporation))
  3749.       T. Max Devlin (Eltrax Systems)
  3750.       John Flick (Hewlett Packard)
  3751.  
  3752.  
  3753.  
  3754. Blumenthal & Wijnen         Standards Track                    [Page 67]
  3755.  
  3756. RFC 2574                     USM for SNMPv3                   April 1999
  3757.  
  3758.  
  3759.       Rob Frye (MCI)
  3760.       Wes Hardaker (U.C.Davis, Information Technology - D.C.A.S.)
  3761.       David Harrington (Cabletron Systems Inc.)
  3762.       Lauren Heintz (BMC Software, Inc.)
  3763.       N.C. Hien (IBM T.J. Watson Research Center)
  3764.       Michael Kirkham (InterWorking Labs, Inc.)
  3765.       Dave Levi (SNMP Research, Inc.)
  3766.       Louis A Mamakos (UUNET Technologies Inc.)
  3767.       Joe Marzot (Nortel Networks)
  3768.       Paul Meyer (Secure Computing Corporation)
  3769.       Keith McCloghrie (Cisco Systems)
  3770.       Bob Moore (IBM)
  3771.       Russ Mundy (TIS Labs at Network Associates)
  3772.       Bob Natale (ACE*COMM Corporation)
  3773.       Mike O'Dell (UUNET Technologies Inc.)
  3774.       Dave Perkins (DeskTalk)
  3775.       Peter Polkinghorne (Brunel University)
  3776.       Randy Presuhn (BMC Software, Inc.)
  3777.       David Reeder (TIS Labs at Network Associates)
  3778.       David Reid (SNMP Research, Inc.)
  3779.       Aleksey Romanov (Quality Quorum)
  3780.       Shawn Routhier (Epilogue)
  3781.       Juergen Schoenwaelder (TU Braunschweig)
  3782.       Bob Stewart (Cisco Systems)
  3783.       Mike Thatcher (Independent Consultant)
  3784.       Bert Wijnen (IBM T.J. Watson Research Center)
  3785.  
  3786.    The document is based on recommendations of the IETF Security and
  3787.    Administrative Framework Evolution for SNMP Advisory Team.  Members
  3788.    of that Advisory Team were:
  3789.  
  3790.       David Harrington (Cabletron Systems Inc.)
  3791.       Jeff Johnson (Cisco Systems)
  3792.       David Levi (SNMP Research Inc.)
  3793.       John Linn (Openvision)
  3794.       Russ Mundy (Trusted Information Systems) chair
  3795.       Shawn Routhier (Epilogue)
  3796.       Glenn Waters (Nortel)
  3797.       Bert Wijnen (IBM T. J. Watson Research Center)
  3798.  
  3799.    As recommended by the Advisory Team and the SNMPv3 Working Group
  3800.    Charter, the design incorporates as much as practical from previous
  3801.    RFCs and drafts. As a result, special thanks are due to the authors
  3802.    of previous designs known as SNMPv2u and SNMPv2*:
  3803.  
  3804.       Jeff Case (SNMP Research, Inc.)
  3805.       David Harrington (Cabletron Systems Inc.)
  3806.       David Levi (SNMP Research, Inc.)
  3807.  
  3808.  
  3809.  
  3810. Blumenthal & Wijnen         Standards Track                    [Page 68]
  3811.  
  3812. RFC 2574                     USM for SNMPv3                   April 1999
  3813.  
  3814.  
  3815.       Keith McCloghrie (Cisco Systems)
  3816.       Brian O'Keefe (Hewlett Packard)
  3817.       Marshall T. Rose (Dover Beach Consulting)
  3818.       Jon Saperia (BGS Systems Inc.)
  3819.       Steve Waldbusser (International Network Services)
  3820.       Glenn W. Waters (Bell-Northern Research Ltd.)
  3821.  
  3822. 11.  Security Considerations
  3823.  
  3824. 11.1.  Recommended Practices
  3825.  
  3826.    This section describes practices that contribute to the secure,
  3827.    effective operation of the mechanisms defined in this memo.
  3828.  
  3829.    - An SNMP engine must discard SNMP Response messages that do not
  3830.      correspond to any currently outstanding Request message. It is the
  3831.      responsibility of the Message Processing module to take care of
  3832.      this. For example it can use a msgID for that.
  3833.  
  3834.      An SNMP Command Generator Application must discard any Response
  3835.      Class PDU for which there is no currently outstanding Confirmed
  3836.      Class PDU; for example for SNMPv2 [RFC1905] PDUs, the request-id
  3837.      component in the PDU can be used to correlate Responses to
  3838.      outstanding Requests.
  3839.  
  3840.      Although it would be typical for an SNMP engine and an SNMP Command
  3841.      Generator Application to do this as a matter of course, when using
  3842.      these security protocols it is significant due to the possibility
  3843.      of message duplication (malicious or otherwise).
  3844.  
  3845.    - If an SNMP engine uses a msgID for correlating Response messages
  3846.      to outstanding Request messages, then it MUST use different msgIDs
  3847.      in all such Request messages that it sends out during a Time Window
  3848.      (150 seconds) period.
  3849.  
  3850.      A Command Generator or Notification Originator Application MUST use
  3851.      different request-ids in all Request PDUs that it sends out during
  3852.      a TimeWindow (150 seconds) period.
  3853.  
  3854.      This must be done to protect against the possibility of message
  3855.      duplication (malicious or otherwise).
  3856.  
  3857.      For example, starting operations with a msgID and/or request-id
  3858.      value of zero is not a good idea.  Initializing them with an
  3859.      unpredictable number (so they do not start out the same after each
  3860.      reboot) and then incrementing by one would be acceptable.
  3861.  
  3862.  
  3863.  
  3864.  
  3865.  
  3866. Blumenthal & Wijnen         Standards Track                    [Page 69]
  3867.  
  3868. RFC 2574                     USM for SNMPv3                   April 1999
  3869.  
  3870.  
  3871.    - An SNMP engine should perform time synchronization using
  3872.      authenticated messages in order to protect against the possibility
  3873.      of message duplication (malicious or otherwise).
  3874.  
  3875.    - When sending state altering messages to a managed authoritative
  3876.      SNMP engine, a Command Generator Application should delay sending
  3877.      successive messages to that managed SNMP engine until a positive
  3878.      acknowledgement is received for the previous message or until the
  3879.      previous message expires.
  3880.  
  3881.      No message ordering is imposed by the SNMP. Messages may be
  3882.      received in any order relative to their time of generation and each
  3883.      will be processed in the ordered received.  Note that when an
  3884.      authenticated message is sent to a managed SNMP engine, it will be
  3885.      valid for a period of time of approximately 150 seconds under
  3886.      normal circumstances, and is subject to replay during this period.
  3887.      Indeed, an SNMP engine and SNMP Command Generator Applications must
  3888.      cope with the loss and re-ordering of messages resulting from
  3889.      anomalies in the network as a matter of course.
  3890.  
  3891.      However, a managed object, snmpSetSerialNo [RFC1907], is
  3892.      specifically defined for use with SNMP Set operations in order to
  3893.      provide a mechanism to ensure that the processing of SNMP messages
  3894.      occurs in a specific order.
  3895.  
  3896.    - The frequency with which the secrets of a User-based Security
  3897.      Model user should be changed is indirectly related to the frequency
  3898.      of their use.
  3899.  
  3900.      Protecting the secrets from disclosure is critical to the overall
  3901.      security of the protocols.  Frequent use of a secret provides a
  3902.      continued source of data that may be useful to a cryptanalyst in
  3903.      exploiting known or perceived weaknesses in an algorithm.  Frequent
  3904.      changes to the secret avoid this vulnerability.
  3905.  
  3906.      Changing a secret after each use is generally regarded as the most
  3907.      secure practice, but a significant amount of overhead may be
  3908.      associated with that approach.
  3909.  
  3910.      Note, too, in a local environment the threat of disclosure may be
  3911.      less significant, and as such the changing of secrets may be less
  3912.      frequent.  However, when public data networks are used as the
  3913.      communication paths, more caution is prudent.
  3914.  
  3915.  
  3916.  
  3917.  
  3918.  
  3919.  
  3920.  
  3921.  
  3922. Blumenthal & Wijnen         Standards Track                    [Page 70]
  3923.  
  3924. RFC 2574                     USM for SNMPv3                   April 1999
  3925.  
  3926.  
  3927. 11.2  Defining Users
  3928.  
  3929.    The mechanisms defined in this document employ the notion of users on
  3930.    whose behalf messages are sent.  How "users" are defined is subject
  3931.    to the security policy of the network administration.  For example,
  3932.    users could be individuals (e.g., "joe" or "jane"), or a particular
  3933.    role (e.g., "operator" or "administrator"), or a combination (e.g.,
  3934.    "joe-operator", "jane-operator" or "joe-admin").  Furthermore, a user
  3935.    may be a logical entity, such as an SNMP Application or a set of SNMP
  3936.    Applications, acting on behalf of an individual or role, or set of
  3937.    individuals, or set of roles, including combinations.
  3938.  
  3939.    Appendix A describes an algorithm for mapping a user "password" to a
  3940.    16/20 octet value for use as either a user's authentication key or
  3941.    privacy key (or both).  Note however, that using the same password
  3942.    (and therefore the same key) for both authentication and privacy is
  3943.    very poor security practice and should be strongly discouraged.
  3944.    Passwords are often generated, remembered, and input by a human.
  3945.    Human-generated passwords may be less than the 16/20 octets required
  3946.    by the authentication and privacy protocols, and brute force attacks
  3947.    can be quite easy on a relatively short ASCII character set.
  3948.    Therefore, the algorithm is Appendix A performs a transformation on
  3949.    the password.  If the Appendix A algorithm is used, SNMP
  3950.    implementations (and SNMP configuration applications) must ensure
  3951.    that passwords are at least 8 characters in length.  Please note that
  3952.    longer passwords with repetitive strings may result in exactly the
  3953.    same key. For example, a password 'bertbert' will result in exactly
  3954.    the same key as password 'bertbertbert'.
  3955.  
  3956.    Because the Appendix A algorithm uses such passwords (nearly)
  3957.    directly, it is very important that they not be easily guessed.  It
  3958.    is suggested that they be composed of mixed-case alphanumeric and
  3959.    punctuation characters that don't form words or phrases that might be
  3960.    found in a dictionary.  Longer passwords improve the security of the
  3961.    system.  Users may wish to input multiword phrases to make their
  3962.    password string longer while ensuring that it is memorable.
  3963.  
  3964.    Since it is infeasible for human users to maintain different
  3965.    passwords for every SNMP engine, but security requirements strongly
  3966.    discourage having the same key for more than one SNMP engine, the
  3967.    User-based Security Model employs a compromise proposed in
  3968.    [Localized-key].  It derives the user keys for the SNMP engines from
  3969.    user's password in such a way that it is practically impossible to
  3970.    either determine the user's password, or user's key for another SNMP
  3971.    engine from any combination of user's keys on SNMP engines.
  3972.  
  3973.  
  3974.  
  3975.  
  3976.  
  3977.  
  3978. Blumenthal & Wijnen         Standards Track                    [Page 71]
  3979.  
  3980. RFC 2574                     USM for SNMPv3                   April 1999
  3981.  
  3982.  
  3983.    Note however, that if user's password is disclosed, then key
  3984.    localization will not help and network security may be compromised in
  3985.    this case. Therefore a user's password or non-localized key MUST NOT
  3986.    be stored on a managed device/node. Instead the localized key SHALL
  3987.    be stored (if at all) , so that, in case a device does get
  3988.    compromised, no other managed or managing devices get compromised.
  3989.  
  3990. 11.3.  Conformance
  3991.  
  3992.    To be termed a "Secure SNMP implementation" based on the User-based
  3993.    Security Model, an SNMP implementation MUST:
  3994.  
  3995.    - implement one or more Authentication Protocol(s). The HMAC-MD5-96
  3996.      and HMAC-SHA-96 Authentication Protocols defined in this memo are
  3997.      examples of such protocols.
  3998.  
  3999.    - to the maximum extent possible, prohibit access to the secret(s)
  4000.      of each user about which it maintains information in a Local
  4001.      Configuration Datastore (LCD) under all circumstances except as
  4002.      required to generate and/or validate SNMP messages with respect to
  4003.      that user.
  4004.  
  4005.    - implement the key-localization mechanism.
  4006.  
  4007.    - implement the SNMP-USER-BASED-SM-MIB.
  4008.  
  4009.    In addition, an authoritative SNMP engine SHOULD provide initial
  4010.    configuration in accordance with Appendix A.1.
  4011.  
  4012.    Implementation of a Privacy Protocol (the DES Symmetric Encryption
  4013.    Protocol defined in this memo is one such protocol) is optional.
  4014.  
  4015. 11.4.  Use of Reports
  4016.  
  4017.    The use of unsecure reports (i.e. sending them with a securityLevel
  4018.    of noAuthNoPriv) potentially exposes a non-authoritative SNMP engine
  4019.    to some form of attacks.  Some people consider these denial of
  4020.    service attacks, others don't.  An installation should evaluate the
  4021.    risk involved before deploying unsecure Report PDUs.
  4022.  
  4023. 11.5  Access to the SNMP-USER-BASED-SM-MIB
  4024.  
  4025.    The objects in this MIB may be considered sensitive in many
  4026.    environments. Specifically the objects in the usmUserTable contain
  4027.    information about users and their authentication and privacy
  4028.    protocols.  It is important to closely control (both read and write)
  4029.  
  4030.  
  4031.  
  4032.  
  4033.  
  4034. Blumenthal & Wijnen         Standards Track                    [Page 72]
  4035.  
  4036. RFC 2574                     USM for SNMPv3                   April 1999
  4037.  
  4038.  
  4039.    access to these MIB objects by using appropriately configured Access
  4040.    Control models (for example the View-based Access Control Model as
  4041.    specified in [RFC2575]).
  4042.  
  4043. 12.  References
  4044.  
  4045.    [RFC1321]       Rivest, R.,  "Message Digest Algorithm MD5", RFC
  4046.                    1321, April 1992.
  4047.  
  4048.    [RFC2579]       McCloghrie, K., Perkins, D. and J. Schoenwaelder,
  4049.                    "Textual Conventions for SMIv2", STD 58, RFC 2579,
  4050.                    April 1999.
  4051.  
  4052.    [RFC1905]       Case, J., McCloghrie, K., Rose, M. and S. Waldbusser,
  4053.                    "Protocol Operations for Version 2 of the Simple
  4054.                    Network Management Protocol (SNMPv2)", RFC 1905,
  4055.                    January 1996.
  4056.  
  4057.    [RFC1906]       Case, J., McCloghrie, K., Rose, M. and S. Waldbusser,
  4058.                    "Transport Mappings for Version 2 of the Simple
  4059.                    Network Management Protocol (SNMPv2)", RFC 1906,
  4060.                    January 1996.
  4061.  
  4062.    [RFC1907]       Case, J., McCloghrie, K., Rose, M. and S. Waldbusser,
  4063.                    "Management Information Base for Version 2 of the
  4064.                    Simple Network Management Protocol (SNMPv2)", RFC
  4065.                    1907 January 1996.
  4066.  
  4067.    [RFC2104]       Krawczyk, H., Bellare, M. and R. Canetti, "HMAC:
  4068.                    Keyed-Hashing  for Message Authentication", RFC 2104,
  4069.                    February 1997.
  4070.  
  4071.    [RFC2119]       Bradner, S., "Key words for use in RFCs to Indicate
  4072.                    Requirement Levels", BCP 14, RFC 2119, March 1997.
  4073.  
  4074.    [RFC2571]       Harrington, D., Presuhn, R. and B. Wijnen, "An
  4075.                    Architecture for describing SNMP Management
  4076.                    Frameworks", RFC 2571, April 1999.
  4077.  
  4078.    [RFC2572]       Case, J., Harrington, D., Presuhn, R. and B. Wijnen,
  4079.                    "Message Processing and Dispatching for the Simple
  4080.                    Network Management Protocol (SNMP)", RFC 2572, April
  4081.                    1999.
  4082.  
  4083.    [RF2575]        Wijnen, B., Presuhn, R. and K. McCloghrie, "View-
  4084.                    based Access Control Model for the Simple Network
  4085.                    Management Protocol (SNMP)", RFC 2575, April 1999.
  4086.  
  4087.  
  4088.  
  4089.  
  4090. Blumenthal & Wijnen         Standards Track                    [Page 73]
  4091.  
  4092. RFC 2574                     USM for SNMPv3                   April 1999
  4093.  
  4094.  
  4095.    [Localized-Key] U. Blumenthal, N. C. Hien, B. Wijnen "Key Derivation
  4096.                    for Network Management Applications" IEEE Network
  4097.                    Magazine, April/May issue, 1997.
  4098.  
  4099.    [DES-NIST]      Data Encryption Standard, National Institute of
  4100.                    Standards and Technology.  Federal Information
  4101.                    Processing Standard (FIPS) Publication 46-1.
  4102.                    Supersedes FIPS Publication 46, (January, 1977;
  4103.                    reaffirmed January, 1988).
  4104.  
  4105.    [DES-ANSI]      Data Encryption Algorithm, American National
  4106.                    Standards Institute.  ANSI X3.92-1981, (December,
  4107.                    1980).
  4108.  
  4109.    [DESO-NIST]     DES Modes of Operation, National Institute of
  4110.                    Standards and Technology.  Federal Information
  4111.                    Processing Standard (FIPS) Publication 81, (December,
  4112.                    1980).
  4113.  
  4114.    [DESO-ANSI]     Data Encryption Algorithm - Modes of Operation,
  4115.                    American National Standards Institute.  ANSI X3.106-
  4116.                    1983, (May 1983).
  4117.  
  4118.    [DESG-NIST]     Guidelines for Implementing and Using the NBS Data
  4119.                    Encryption Standard, National Institute of Standards
  4120.                    and Technology.  Federal Information Processing
  4121.                    Standard (FIPS) Publication 74, (April, 1981).
  4122.  
  4123.    [DEST-NIST]     Validating the Correctness of Hardware
  4124.                    Implementations of the NBS Data Encryption Standard,
  4125.                    National Institute of Standards and Technology.
  4126.                    Special Publication 500-20.
  4127.  
  4128.    [DESM-NIST]     Maintenance Testing for the Data Encryption Standard,
  4129.                    National Institute of Standards and Technology.
  4130.                    Special Publication 500-61, (August, 1980).
  4131.  
  4132.    [SHA-NIST]      Secure Hash Algorithm. NIST FIPS 180-1, (April, 1995)
  4133.                    http://csrc.nist.gov/fips/fip180-1.txt (ASCII)
  4134.                    http://csrc.nist.gov/fips/fip180-1.ps  (Postscript)
  4135.  
  4136.  
  4137.  
  4138.  
  4139.  
  4140.  
  4141.  
  4142.  
  4143.  
  4144.  
  4145.  
  4146. Blumenthal & Wijnen         Standards Track                    [Page 74]
  4147.  
  4148. RFC 2574                     USM for SNMPv3                   April 1999
  4149.  
  4150.  
  4151. 13.  Editors' Addresses
  4152.  
  4153.    Uri Blumenthal
  4154.    IBM T. J. Watson Research
  4155.    30 Saw Mill River Pkwy,
  4156.    Hawthorne, NY 10532
  4157.    USA
  4158.  
  4159.    Phone:      +1-914-784-7064
  4160.    EMail:      uri@watson.ibm.com
  4161.  
  4162.  
  4163.  
  4164.    Bert Wijnen
  4165.    IBM T. J. Watson Research
  4166.    Schagen 33
  4167.    3461 GL Linschoten
  4168.    Netherlands
  4169.  
  4170.    Phone:      +31-348-432-794
  4171.    EMail:      wijnen@vnet.ibm.com
  4172.  
  4173.  
  4174.  
  4175.  
  4176.  
  4177.  
  4178.  
  4179.  
  4180.  
  4181.  
  4182.  
  4183.  
  4184.  
  4185.  
  4186.  
  4187.  
  4188.  
  4189.  
  4190.  
  4191.  
  4192.  
  4193.  
  4194.  
  4195.  
  4196.  
  4197.  
  4198.  
  4199.  
  4200.  
  4201.  
  4202. Blumenthal & Wijnen         Standards Track                    [Page 75]
  4203.  
  4204. RFC 2574                     USM for SNMPv3                   April 1999
  4205.  
  4206.  
  4207. APPENDIX A - Installation
  4208.  
  4209. A.1.  SNMP engine Installation Parameters
  4210.  
  4211.    During installation, an authoritative SNMP engine SHOULD (in the
  4212.    meaning as defined in [RFC2119]) be configured with several initial
  4213.    parameters.  These include:
  4214.  
  4215.    1) A security posture
  4216.  
  4217.       The choice of security posture determines if initial configuration
  4218.       is implemented and if so how.  One of three possible choices is
  4219.       selected:
  4220.  
  4221.             minimum-secure,
  4222.             semi-secure,
  4223.             very-secure (i.e., no-initial-configuration)
  4224.  
  4225.       In the case of a very-secure posture, there is no initial
  4226.       configuration, and so the following steps are irrelevant.
  4227.  
  4228. 2) one or more secrets
  4229.  
  4230.    These are the authentication/privacy secrets for the first user to be
  4231.    configured.
  4232.  
  4233.    One way to accomplish this is to have the installer enter a
  4234.    "password" for each required secret. The password is then
  4235.    algorithmically converted into the required secret by:
  4236.  
  4237.    - forming a string of length 1,048,576 octets by repeating the
  4238.      value of the password as often as necessary, truncating
  4239.      accordingly, and using the resulting string as the input to the MD5
  4240.      algorithm [MD5].  The resulting digest, termed "digest1", is used
  4241.      in the next step.
  4242.  
  4243.    - a second string is formed by concatenating digest1, the SNMP
  4244.      engine's snmpEngineID value, and digest1.  This string is used as
  4245.      input to the MD5 algorithm [MD5].
  4246.  
  4247.      The resulting digest is the required secret (see Appendix A.2).
  4248.  
  4249.    With these configured parameters, the SNMP engine instantiates the
  4250.    following usmUserEntry in the usmUserTable:
  4251.  
  4252.  
  4253.  
  4254.  
  4255.  
  4256.  
  4257.  
  4258. Blumenthal & Wijnen         Standards Track                    [Page 76]
  4259.  
  4260. RFC 2574                     USM for SNMPv3                   April 1999
  4261.  
  4262.  
  4263.                            no privacy support     privacy support
  4264.                            ------------------     ---------------
  4265.    usmUserEngineID         localEngineID          localEngineID
  4266.    usmUserName             "initial"              "initial"
  4267.    usmUserSecurityName     "initial"              "initial"
  4268.    usmUserCloneFrom        ZeroDotZero            ZeroDotZero
  4269.    usmUserAuthProtocol     usmHMACMD5AuthProtocol usmHMACMD5AuthProtocol
  4270.    usmUserAuthKeyChange    ""                     ""
  4271.    usmUserOwnAuthKeyChange ""                     ""
  4272.    usmUserPrivProtocol     none                   usmDESPrivProtocol
  4273.    usmUserPrivKeyChange    ""                     ""
  4274.    usmUserOwnPrivKeyChange ""                     ""
  4275.    usmUserPublic           ""                     ""
  4276.    usmUserStorageType      anyValidStorageType    anyValidStorageType
  4277.    usmUserStatus           active                 active
  4278.  
  4279.  
  4280.    It is recommended to also instantiate a set of template
  4281.    usmUserEntries which can be used as clone-from users for newly
  4282.    created usmUserEntries.  These are the two suggested entries:
  4283.  
  4284.                            no privacy support     privacy support
  4285.                            ------------------     ---------------
  4286.    usmUserEngineID         localEngineID          localEngineID
  4287.    usmUserName             "templateMD5"          "templateMD5"
  4288.    usmUserSecurityName     "templateMD5"          "templateMD5"
  4289.    usmUserCloneFrom        ZeroDotZero            ZeroDotZero
  4290.    usmUserAuthProtocol     usmHMACMD5AuthProtocol usmHMACMD5AuthProtocol
  4291.    usmUserAuthKeyChange    ""                     ""
  4292.    usmUserOwnAuthKeyChange ""                     ""
  4293.    usmUserPrivProtocol     none                   usmDESPrivProtocol
  4294.    usmUserPrivKeyChange    ""                     ""
  4295.    usmUserOwnPrivKeyChange ""                     ""
  4296.    usmUserPublic           ""                     ""
  4297.    usmUserStorageType      permanent              permanent
  4298.    usmUserStatus           active                 active
  4299.  
  4300.  
  4301.  
  4302.  
  4303.  
  4304.  
  4305.  
  4306.  
  4307.  
  4308.  
  4309.  
  4310.  
  4311.  
  4312.  
  4313.  
  4314. Blumenthal & Wijnen         Standards Track                    [Page 77]
  4315.  
  4316. RFC 2574                     USM for SNMPv3                   April 1999
  4317.  
  4318.  
  4319.                            no privacy support     privacy support
  4320.                            ------------------     ---------------
  4321.    usmUserEngineID         localEngineID          localEngineID
  4322.    usmUserName             "templateSHA"          "templateSHA"
  4323.    usmUserSecurityName     "templateSHA"          "templateSHA"
  4324.    usmUserCloneFrom        ZeroDotZero            ZeroDotZero
  4325.    usmUserAuthProtocol     usmHMACSHAAuthProtocol usmHMACSHAAuthProtocol
  4326.    usmUserAuthKeyChange    ""                     ""
  4327.    usmUserOwnAuthKeyChange ""                     ""
  4328.    usmUserPrivProtocol     none                   usmDESPrivProtocol
  4329.    usmUserPrivKeyChange    ""                     ""
  4330.    usmUserOwnPrivKeyChange ""                     ""
  4331.    usmUserPublic           ""                     ""
  4332.    usmUserStorageType      permanent              permanent
  4333.    usmUserStatus           active                 active
  4334.  
  4335. A.2.  Password to Key Algorithm
  4336.  
  4337.    A sample code fragment (section A.2.1) demonstrates the password to
  4338.    key algorithm which can be used when mapping a password to an
  4339.    authentication or privacy key using MD5. The reference source code
  4340.    of MD5 is available in [RFC1321].
  4341.  
  4342.    Another sample code fragment (section A.2.2) demonstrates the
  4343.    password to key algorithm which can be used when mapping a password
  4344.    to an authentication or privacy key using SHA (documented in
  4345.    SHA-NIST).
  4346.  
  4347.    An example of the results of a correct implementation is provided
  4348.    (section A.3) which an implementor can use to check if his
  4349.    implementation produces the same result.
  4350.  
  4351.  
  4352.  
  4353.  
  4354.  
  4355.  
  4356.  
  4357.  
  4358.  
  4359.  
  4360.  
  4361.  
  4362.  
  4363.  
  4364.  
  4365.  
  4366.  
  4367.  
  4368.  
  4369.  
  4370. Blumenthal & Wijnen         Standards Track                    [Page 78]
  4371.  
  4372. RFC 2574                     USM for SNMPv3                   April 1999
  4373.  
  4374.  
  4375. A.2.1.  Password to Key Sample Code for MD5
  4376.  
  4377. void password_to_key_md5(
  4378.    u_char *password,    /* IN */
  4379.    u_int   passwordlen, /* IN */
  4380.    u_char *engineID,    /* IN  - pointer to snmpEngineID  */
  4381.    u_int   engineLength,/* IN  - length of snmpEngineID */
  4382.    u_char *key)         /* OUT - pointer to caller 16-octet buffer */
  4383. {
  4384.    MD5_CTX     MD;
  4385.    u_char     *cp, password_buf[64];
  4386.    u_long      password_index = 0;
  4387.    u_long      count = 0, i;
  4388.  
  4389.    MD5Init (&MD);   /* initialize MD5 */
  4390.  
  4391.    /**********************************************/
  4392.    /* Use while loop until we've done 1 Megabyte */
  4393.    /**********************************************/
  4394.    while (count < 1048576) {
  4395.       cp = password_buf;
  4396.       for (i = 0; i < 64; i++) {
  4397.           /*************************************************/
  4398.           /* Take the next octet of the password, wrapping */
  4399.           /* to the beginning of the password as necessary.*/
  4400.           /*************************************************/
  4401.           *cp++ = password[password_index++ % passwordlen];
  4402.       }
  4403.       MD5Update (&MD, password_buf, 64);
  4404.       count += 64;
  4405.    }
  4406.    MD5Final (key, &MD);          /* tell MD5 we're done */
  4407.  
  4408.    /*****************************************************/
  4409.    /* Now localize the key with the engineID and pass   */
  4410.    /* through MD5 to produce final key                  */
  4411.    /* May want to ensure that engineLength <= 32,       */
  4412.    /* otherwise need to use a buffer larger than 64     */
  4413.    /*****************************************************/
  4414.    memcpy(password_buf, key, 16);
  4415.    memcpy(password_buf+16, engineID, engineLength);
  4416.    memcpy(password_buf+16+engineLength, key, 16);
  4417.  
  4418.    MD5Init(&MD);
  4419.    MD5Update(&MD, password_buf, 32+engineLength);
  4420.    MD5Final(key, &MD);
  4421.    return;
  4422. }
  4423.  
  4424.  
  4425.  
  4426. Blumenthal & Wijnen         Standards Track                    [Page 79]
  4427.  
  4428. RFC 2574                     USM for SNMPv3                   April 1999
  4429.  
  4430.  
  4431. A.2.2.  Password to Key Sample Code for SHA
  4432.  
  4433. void password_to_key_sha(
  4434.    u_char *password,    /* IN */
  4435.    u_int   passwordlen, /* IN */
  4436.    u_char *engineID,    /* IN  - pointer to snmpEngineID  */
  4437.    u_int   engineLength,/* IN  - length of snmpEngineID */
  4438.    u_char *key)         /* OUT - pointer to caller 20-octet buffer */
  4439. {
  4440.    SHA_CTX     SH;
  4441.    u_char     *cp, password_buf[72];
  4442.    u_long      password_index = 0;
  4443.    u_long      count = 0, i;
  4444.  
  4445.    SHAInit (&SH);   /* initialize SHA */
  4446.  
  4447.    /**********************************************/
  4448.    /* Use while loop until we've done 1 Megabyte */
  4449.    /**********************************************/
  4450.    while (count < 1048576) {
  4451.       cp = password_buf;
  4452.       for (i = 0; i < 64; i++) {
  4453.           /*************************************************/
  4454.           /* Take the next octet of the password, wrapping */
  4455.           /* to the beginning of the password as necessary.*/
  4456.           /*************************************************/
  4457.           *cp++ = password[password_index++ % passwordlen];
  4458.       }
  4459.       SHAUpdate (&SH, password_buf, 64);
  4460.       count += 64;
  4461.    }
  4462.    SHAFinal (key, &SH);          /* tell SHA we're done */
  4463.  
  4464.    /*****************************************************/
  4465.    /* Now localize the key with the engineID and pass   */
  4466.    /* through SHA to produce final key                  */
  4467.    /* May want to ensure that engineLength <= 32,       */
  4468.    /* otherwise need to use a buffer larger than 72     */
  4469.    /*****************************************************/
  4470.    memcpy(password_buf, key, 20);
  4471.    memcpy(password_buf+20, engineID, engineLength);
  4472.    memcpy(password_buf+20+engineLength, key, 20);
  4473.  
  4474.    SHAInit(&SH);
  4475.    SHAUpdate(&SH, password_buf, 40+engineLength);
  4476.    SHAFinal(key, &SH);
  4477.    return;
  4478. }
  4479.  
  4480.  
  4481.  
  4482. Blumenthal & Wijnen         Standards Track                    [Page 80]
  4483.  
  4484. RFC 2574                     USM for SNMPv3                   April 1999
  4485.  
  4486.  
  4487. A.3.  Password to Key Sample Results
  4488.  
  4489. A.3.1.  Password to Key Sample Results using MD5
  4490.  
  4491.    The following shows a sample output of the password to key algorithm
  4492.    for a 16-octet key using MD5.
  4493.  
  4494.    With a password of "maplesyrup" the output of the password to key
  4495.    algorithm before the key is localized with the SNMP engine's
  4496.    snmpEngineID is:
  4497.  
  4498.       '9f af 32 83 88 4e 92 83 4e bc 98 47 d8 ed d9 63'H
  4499.  
  4500.    After the intermediate key (shown above) is localized with the
  4501.    snmpEngineID value of:
  4502.  
  4503.       '00 00 00 00 00 00 00 00 00 00 00 02'H
  4504.  
  4505.    the final output of the password to key algorithm is:
  4506.  
  4507.       '52 6f 5e ed 9f cc e2 6f 89 64 c2 93 07 87 d8 2b'H
  4508.  
  4509. A.3.2.  Password to Key Sample Results using SHA
  4510.  
  4511.       The following shows a sample output of the password to key
  4512.       algorithm for a 20-octet key using SHA.
  4513.  
  4514.       With a password of "maplesyrup" the output of the password to key
  4515.       algorithm before the key is localized with the SNMP engine's
  4516.       snmpEngineID is:
  4517.  
  4518.       '9f b5 cc 03 81 49 7b 37 93 52 89 39 ff 78 8d 5d 79 14 52 11'H
  4519.  
  4520.    After the intermediate key (shown above) is localized with the
  4521.    snmpEngineID value of:
  4522.  
  4523.       '00 00 00 00 00 00 00 00 00 00 00 02'H
  4524.  
  4525.    the final output of the password to key algorithm is:
  4526.  
  4527.       '66 95 fe bc 92 88 e3 62 82 23 5f c7 15 1f 12 84 97 b3 8f 3f'H
  4528.  
  4529.  
  4530.  
  4531.  
  4532.  
  4533.  
  4534.  
  4535.  
  4536.  
  4537.  
  4538. Blumenthal & Wijnen         Standards Track                    [Page 81]
  4539.  
  4540. RFC 2574                     USM for SNMPv3                   April 1999
  4541.  
  4542.  
  4543. A.4.  Sample encoding of msgSecurityParameters
  4544.  
  4545.    The msgSecurityParameters in an SNMP message are represented as an
  4546.    OCTET STRING. This OCTET STRING should be considered opaque outside a
  4547.    specific Security Model.
  4548.  
  4549.    The User-based Security Model defines the contents of the OCTET
  4550.    STRING as a SEQUENCE (see section 2.4).
  4551.  
  4552.    Given these two properties, the following is an example of the
  4553.    msgSecurityParameters for the User-based Security Model, encoded as
  4554.    an OCTET STRING:
  4555.  
  4556.      04 <length>
  4557.      30 <length>
  4558.      04 <length> <msgAuthoritativeEngineID>
  4559.      02 <length> <msgAuthoritativeEngineBoots>
  4560.      02 <length> <msgAuthoritativeEngineTime>
  4561.      04 <length> <msgUserName>
  4562.      04 0c       <HMAC-MD5-96-digest>
  4563.      04 08       <salt>
  4564.  
  4565.    Here is the example once more, but now with real values (except for
  4566.    the digest in msgAuthenticationParameters and the salt in
  4567.    msgPrivacyParameters, which depend on variable data that we have not
  4568.    defined here):
  4569.  
  4570.      Hex Data                         Description
  4571.      --------------  -----------------------------------------------
  4572.      04 39           OCTET STRING,                  length 57
  4573.      30 37           SEQUENCE,                      length 55
  4574.      04 0c 80000002  msgAuthoritativeEngineID:      IBM
  4575.            01                                       IPv4 address
  4576.            09840301                                 9.132.3.1
  4577.      02 01 01        msgAuthoritativeEngineBoots:   1
  4578.      02 02 0101      msgAuthoritativeEngineTime:    257
  4579.      04 04 62657274  msgUserName:                   bert
  4580.      04 0c 01234567  msgAuthenticationParameters:   sample value
  4581.            89abcdef
  4582.            fedcba98
  4583.      04 08 01234567  msgPrivacyParameters:          sample value
  4584.            89abcdef
  4585.  
  4586.  
  4587.  
  4588.  
  4589.  
  4590.  
  4591.  
  4592.  
  4593.  
  4594. Blumenthal & Wijnen         Standards Track                    [Page 82]
  4595.  
  4596. RFC 2574                     USM for SNMPv3                   April 1999
  4597.  
  4598.  
  4599. A.5.  Sample keyChange Results
  4600.  
  4601.  
  4602. A.5.1.  Sample keyChange Results using MD5
  4603.  
  4604.    Let us assume that a user has a current password of "maplesyrup" as
  4605.    in section A.3.1. and let us also assume the snmpEngineID of 12
  4606.    octets:
  4607.  
  4608.       '00 00 00 00 00 00 00 00 00 00 00 02'H
  4609.  
  4610.    If we now want to change the password to "newsyrup", then we first
  4611.    calculate the key for the new password. It is as follows:
  4612.  
  4613.       '01 ad d2 73 10 7c 4e 59 6b 4b 00 f8 2b 1d 42 a7'H
  4614.  
  4615.    If we localize it for the above snmpEngineID, then the localized new
  4616.    key becomes:
  4617.  
  4618.       '87 02 1d 7b d9 d1 01 ba 05 ea 6e 3b f9 d9 bd 4a'H
  4619.  
  4620.    If we then use a (not so good, but easy to test) random value of:
  4621.  
  4622.       '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'H
  4623.  
  4624.    Then the value we must send for keyChange is:
  4625.  
  4626.       '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  4627.        88 05 61 51 41 67 6c c9 19 61 74 e7 42 a3 25 51'H
  4628.  
  4629.    If this were for the privacy key, then it would be exactly the same.
  4630.  
  4631.  
  4632.  
  4633.  
  4634.  
  4635.  
  4636.  
  4637.  
  4638.  
  4639.  
  4640.  
  4641.  
  4642.  
  4643.  
  4644.  
  4645.  
  4646.  
  4647.  
  4648.  
  4649.  
  4650. Blumenthal & Wijnen         Standards Track                    [Page 83]
  4651.  
  4652. RFC 2574                     USM for SNMPv3                   April 1999
  4653.  
  4654.  
  4655. A.5.2.  Sample keyChange Results using SHA
  4656.  
  4657.    Let us assume that a user has a current password of "maplesyrup" as
  4658.    in section A.3.2. and let us also assume the snmpEngineID of 12
  4659.    octets:
  4660.  
  4661.       '00 00 00 00 00 00 00 00 00 00 00 02'H
  4662.  
  4663.    If we now want to change the password to "newsyrup", then we first
  4664.    calculate the key for the new password. It is as follows:
  4665.  
  4666.       '3a 51 a6 d7 36 aa 34 7b 83 dc 4a 87 e3 e5 5e e4 d6 98 ac 71'H
  4667.  
  4668.    If we localize it for the above snmpEngineID, then the localized new
  4669.    key becomes:
  4670.  
  4671.       '78 e2 dc ce 79 d5 94 03 b5 8c 1b ba a5 bf f4 63 91 f1 cd 25'H
  4672.  
  4673.    If we then use a (not so good, but easy to test) random value of:
  4674.  
  4675.       '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'H
  4676.  
  4677.    Then the value we must send for keyChange is:
  4678.  
  4679.       '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  4680.        9c 10 17 f4 fd 48 3d 2d e8 d5 fa db f8 43 92 cb 06 45 70 51'
  4681.  
  4682.    For the key used for privacy, the new nonlocalized key would be:
  4683.  
  4684.       '3a 51 a6 d7 36 aa 34 7b 83 dc 4a 87 e3 e5 5e e4 d6 98 ac 71'H
  4685.  
  4686.    For the key used for privacy, the new localized key would be (note
  4687.    that they localized key gets truncated to 16 octets for DES):
  4688.  
  4689.       '78 e2 dc ce 79 d5 94 03 b5 8c 1b ba a5 bf f4 63'H
  4690.  
  4691.    If we then use a (not so good, but easy to test) random value of:
  4692.  
  4693.       '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00'H
  4694.  
  4695.    Then the value we must send for keyChange for the privacy key is:
  4696.  
  4697.       '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  4698.       '7e f8 d8 a4 c9 cd b2 6b 47 59 1c d8 52 ff 88 b5'H
  4699.  
  4700.  
  4701.  
  4702.  
  4703.  
  4704.  
  4705.  
  4706. Blumenthal & Wijnen         Standards Track                    [Page 84]
  4707.  
  4708. RFC 2574                     USM for SNMPv3                   April 1999
  4709.  
  4710.  
  4711. B.  Change Log
  4712.  
  4713.    Changes made since RFC2274:
  4714.    - Fixed msgUserName to allow size of zero and explain that this can
  4715.    be used for snmpEngineID discovery.
  4716.    - Clarified section 3.1 steps 4.b, 5, 6 and 8.b.
  4717.    - Clarified section 3.2 paragraph 2.
  4718.    - Clarified section 3.2 step 7.a last paragraph, step 7.b.1 second
  4719.    bullet and step 7.b.2 third bullet.
  4720.    - Clarified section 4 to indicate that discovery can use a userName
  4721.    of zero length in unAuthenticated messages, whereas a valid userName
  4722.    must be used in authenticated messages.
  4723.    - Added REVISION clauses to MODULE-IDENTITY
  4724.    - Clarified KeyChange TC by adding a note that localized keys must be
  4725.    used when calculating a KeyChange value.
  4726.    - Added clarifying text to the DESCRIPTION clause of usmUserTable.
  4727.    Added text describes a recommended procedure for adding a new user.
  4728.    - Clarified the use of usmUserCloneFrom object.
  4729.    - Clarified how and under which conditions the usmUserAuthProtocol
  4730.    and usmUserPrivProtocol can be initialized and/or changed.
  4731.    - Added comment on typical sizes for usmUserAuthKeyChange and
  4732.    usmUserPrivKeyChange. Also for usmUserOwnAuthKeyChange and
  4733.    usmUserOwnPrivKeyChange.
  4734.    - Added clarifications to the DESCRIPTION clauses of
  4735.    usmUserAuthKeyChange, usmUserOwnAuthKeychange, usmUserPrivKeyChange
  4736.    and usmUserOwnPrivKeychange.  - Added clarification to DESCRIPTION
  4737.    clause of usmUserStorageType.  - Added clarification to DESCRIPTION
  4738.    clause of usmUserStatus.
  4739.    - Clarified IV generation procedure in section 8.1.1.1 and in
  4740.    addition clarified section 8.3.1 step 1 and section 8.3.2. step 3.
  4741.    - Clarified section 11.2 and added a warning that different size
  4742.    passwords with repetitive strings may result in same key.
  4743.    - Added template users to appendix A for cloning process.
  4744.    - Fixed C-code examples in Appendix A.
  4745.    - Fixed examples of generated keys in Appendix A.
  4746.    - Added examples of KeyChange values to Appendix A.
  4747.    - Used PDU Classes instead of RFC1905 PDU types.
  4748.    - Added text in the security section about Reports and Access Control
  4749.    to the MIB
  4750.    - Removed a incorrect note at the end of section 3.2 step 7.
  4751.    - Added a note in section 3.2 step 3.
  4752.    - Corrected various spelling errors and typos.
  4753.    - Corrected procedure for 3.2 step 2.a)
  4754.    - various clarifications.
  4755.    - Fixed references to new/revised documents
  4756.    - Change to no longer cache data that is not used
  4757.  
  4758.  
  4759.  
  4760.  
  4761.  
  4762. Blumenthal & Wijnen         Standards Track                    [Page 85]
  4763.  
  4764. RFC 2574                     USM for SNMPv3                   April 1999
  4765.  
  4766.  
  4767. C.  Full Copyright Statement
  4768.  
  4769.    Copyright (C) The Internet Society (1999).  All Rights Reserved.
  4770.  
  4771.    This document and translations of it may be copied and furnished to
  4772.    others, and derivative works that comment on or otherwise explain it
  4773.    or assist in its implementation may be prepared, copied, published
  4774.    and distributed, in whole or in part, without restriction of any
  4775.    kind, provided that the above copyright notice and this paragraph are
  4776.    included on all such copies and derivative works.  However, this
  4777.    document itself may not be modified in any way, such as by removing
  4778.    the copyright notice or references to the Internet Society or other
  4779.    Internet organizations, except as needed for the purpose of
  4780.    developing Internet standards in which case the procedures for
  4781.    copyrights defined in the Internet Standards process must be
  4782.    followed, or as required to translate it into languages other than
  4783.    English.
  4784.  
  4785.    The limited permissions granted above are perpetual and will not be
  4786.    revoked by the Internet Society or its successors or assigns.
  4787.  
  4788.    This document and the information contained herein is provided on an
  4789.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  4790.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  4791.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  4792.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  4793.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  4794.  
  4795. Acknowledgement
  4796.  
  4797.    Funding for the RFC Editor function is currently provided by
  4798.    the Internet Society.
  4799.  
  4800.  
  4801.  
  4802.  
  4803.  
  4804.  
  4805.  
  4806.  
  4807.  
  4808.  
  4809.  
  4810.  
  4811.  
  4812.  
  4813.  
  4814.  
  4815.  
  4816.  
  4817. Blumenthal & Wijnen         Standards Track                    [Page 86]
  4818.  
  4819.