home *** CD-ROM | disk | FTP | other *** search
/ Internet Info 1997 December / Internet_Info_CD-ROM_Walnut_Creek_December_1997.iso / drafts / draft_ietf_q_t / draft-ietf-snmpv3-usec-01.txt < prev    next >
Text File  |  1997-06-19  |  118KB  |  3,319 lines

  1.  
  2.                User-based Security Model for version 3 of the
  3.                 Simple Network Management Protocol (SNMPv3)
  4.  
  5.                              18 June 1997
  6.  
  7.  
  8.                             U. Blumenthal
  9.                        IBM T. J. Watson Research
  10.                            uri@watson.ibm.com
  11.  
  12.                               B. Wijnen
  13.                        IBM T. J. Watson Research
  14.                           wijnen@vnet.ibm.com
  15.  
  16.  
  17.                     <draft-ietf-snmpv3-usec-01.txt>
  18.  
  19.  
  20.                           Status of this Memo
  21.  
  22. This document is an Internet-Draft.  Internet-Drafts are working
  23. documents of the Internet Engineering Task Force (IETF), its areas,
  24. and its working groups.  Note that other groups may also distribute
  25. working documents as Internet-Drafts.
  26.  
  27. Internet-Drafts are draft documents valid for a maximum of six months
  28. and may be updated, replaced, or obsoleted by other documents at any
  29. time.  It is inappropriate to use Internet- Drafts as reference
  30. material or to cite them other than as ``work in progress.''
  31.  
  32. To learn the current status of any Internet-Draft, please check the
  33. ``1id-abstracts.txt'' listing contained in the Internet- Drafts Shadow
  34. Directories on ds.internic.net (US East Coast), nic.nordu.net (Europe),
  35. ftp.isi.edu (US West Coast), or munnari.oz.au (Pacific Rim).
  36.  
  37.  
  38.                           Abstract
  39.  
  40. This document describes the User-based Security Model (USEC) for SNMP
  41. version 3 for use in the SNMP architecture [SNMP-ARCH].  This
  42. document defines the Elements of Procedure for providing SNMP message
  43. level security.  This document also includes a MIB for remotely
  44. monitoring/managing the configuration parameters for this Security
  45. model.
  46.  
  47. 0.1 Issues
  48.      - Do we indeed want to move all STATS counters to MPC, we
  49.        have assumed so for now.
  50.      - Do we need to do group mapping here and pass it back to MPC
  51.        we have assumed so for now... but other documents do not pass
  52.        groupName around.
  53.  
  54.  
  55.  
  56. Blumenthal/Wijnen         Expires December  1997               [Page  1]
  57.  
  58. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  59.  
  60.  
  61.      - Do we want to check reportableFlag to determine if caching
  62.        of securityData is needed or not.
  63.  
  64. 0.2 Change Log
  65.  
  66.    [version 1.2]
  67.      - changed (simplified) time sync in section 3 item 7.
  68.      - added usecUserMiId
  69.      - cleaned up text
  70.      - defined IV "salt" generation
  71.      - removed Statistics counters (now in MPC) and reportPDU
  72.        generation (now in MPC)
  73.      - Removed auth and des MIBs which are now merged into USEC MIB
  74.      - specified where cachedSecurityData needs to be discarded
  75.      - added abtract service interface definitions
  76.      - removed section on error reporting (is MPC responsibility)
  77.      - removed auth/priv protocol definitions, they are in ARCH now
  78.      - removed MIB definitions for snmpEngineID,Time,Boots. They
  79.        are in ARCH now.
  80.  
  81.    [version 1.1]
  82.      - removed <securityCookie>.
  83.      - added <securityIdentity>, <securityCachedData>.
  84.      - added abstract function interface description of
  85.        inter-module communications.
  86.      - modified IV generation process to accomodate messages produced
  87.        faster than one-per-second (still open).
  88.      - always update the clock regardless of whether incoming message
  89.        was Report or not (if the message was properly authenticated
  90.        and its timestamp is ahead of our notion of their clock).
  91.  
  92.    [version 1.0]
  93.      - first version posted to the v3editors mailing list.
  94.      - based on v2adv slides, v2adv items and issues list and on
  95.        RFC1910 and SNMPv2u and SNMPv2* documents.
  96.      - various iterations were done by the authors via private email.
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115. Blumenthal/Wijnen         Expires December  1997               [Page  2]
  116.  
  117. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  118.  
  119.  
  120. 1.  Introduction
  121.  
  122.    The Architecture for describing Internet Management Frameworks
  123.    is composed of multiple subsystems:
  124.      1) a message processing and control subsystem,
  125.      2) a security subsystem,
  126.      3) an access control subsystem, and
  127.      4) orangelets.
  128.  
  129.    It is important to understand the SNMP architecture and the
  130.    terminology of the architecture to understand where the model
  131.    described in this document fits into the architecture and interacts
  132.    with other subsystems within the architecture.  The reader is
  133.    expected to have read and understood the description of the SNMP
  134.    architecture, as defined in [SNMP-ARCH].
  135.  
  136.    This memo [SNMPv3-USEC] describes the User-Based Security model
  137.    as it is used within the SNMP Architecture. The main idea is that
  138.    we use the traditional concept of a user (identified by a userName)
  139.    to associate security information with.
  140.  
  141.    This memo describes the use of Keyed-MD5 as the authentication
  142.    protocol and the use of CBC-DES as the privacy protocol.
  143.    The User-based Security model however allows for other such
  144.    protocols to be used instead of or concurrent with these protocols.
  145.    So the description of Keyed-MD5 and CBC-DES are in separate sections.
  146.    That way it shows that they are supposed to be self-contained
  147.    pieces that can be replaced or supplemented in the future.
  148.  
  149. 1.1.  Threats
  150.  
  151.    Several of the classical threats to network protocols are applicable
  152.    to the network management problem and therefore would be applicable
  153.    to any SNMP security model.  Other threats are not applicable to
  154.    the network management problem.  This section discusses principal
  155.    threats, secondary threats, and threats which are of lesser
  156.    importance.
  157.  
  158.    The principal threats against which this SNMPv3 security model
  159.    should provide protection are:
  160.  
  161.    - Modification of Information
  162.      The modification threat is the danger that some unauthorized entity
  163.      may alter in-transit SNMPv3 messages generated on behalf of an
  164.      authorized user in such a way as to effect unauthorized management
  165.      operations, including falsifying the value of an object.
  166.  
  167.    - Masquerade
  168.      The masquerade threat is the danger that management operations not
  169.      authorized for some user may be attempted by assuming the identity
  170.      of another user that has the appropriate authorizations.
  171.  
  172.  
  173.  
  174. Blumenthal/Wijnen         Expires December  1997               [Page  3]
  175.  
  176. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  177.  
  178.  
  179.  
  180.    Two secondary threats are also identified.  The security protocols
  181.    defined in this memo provide limited protection against:
  182.  
  183.    - Disclosure
  184.      The disclosure threat is the danger of eavesdropping on the
  185.      exchanges between managed agents and a management station.
  186.      Protecting against this threat may be required as a matter of
  187.      local policy.
  188.  
  189.    - Message Stream Modification
  190.      The SNMPv3 protocol is typically based upon a connection-less
  191.      transport service which may operate over any sub-network service.
  192.      The re-ordering, delay or replay of messages can and does occur
  193.      through the natural operation of many such sub-network services.
  194.      The message stream modification threat is the danger that messages
  195.      may be maliciously re-ordered, delayed or replayed to an extent
  196.      which is greater than can occur through the natural operation of a
  197.      sub-network service, in order to effect unauthorized management
  198.      operations.
  199.  
  200.    There are at least two threats that an SNMPv3 security protocol need
  201.    not protect against.  The security protocols defined in this memo do
  202.    not provide protection against:
  203.  
  204.    - Denial of Service
  205.      An SNMPv3 security protocol need not attempt to address the broad
  206.      range of attacks by which service on behalf of authorized users is
  207.      denied.  Indeed, such denial-of-service attacks are in many cases
  208.      indistinguishable from the type of network failures with which any
  209.      viable network management protocol must cope as a matter of course.
  210.    - Traffic Analysis
  211.      In addition, an SNMPv3 security protocol need not attempt to
  212.      address traffic analysis attacks.  Indeed, many traffic patterns
  213.      are predictable - agents may be managed on a regular basis by a
  214.      relatively small number of management stations - and therefore
  215.      there is no significant advantage afforded by protecting against
  216.      traffic analysis.
  217.  
  218. 1.2.  Goals and Constraints
  219.  
  220.    Based on the foregoing account of threats in the SNMP network
  221.    management environment, the goals of this SNMPv3 security model are
  222.    as follows.
  223.  
  224.    1) The protocol should provide for verification that each received
  225.       SNMPv3 message has not been modified during its transmission
  226.       through the network in such a way that an unauthorized management
  227.       operation might result.
  228.  
  229.    2) The protocol should provide for verification of the identity of
  230.  
  231.  
  232.  
  233. Blumenthal/Wijnen         Expires December  1997               [Page  4]
  234.  
  235. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  236.  
  237.  
  238.       the user on whose behalf a received SNMPv3 message claims to have
  239.       been generated.
  240.  
  241.    3) The protocol should provide for detection of received SNMPv3
  242.       messages, which request or contain management information, whose
  243.       time of generation was not recent.
  244.  
  245.    4) The protocol should provide, when necessary, that the contents of
  246.       each received SNMPv3 message are protected from disclosure.
  247.  
  248.    In addition to the principal goal of supporting secure network
  249.    management, the design of this SNMPv3 security model is also
  250.    influenced by the following constraints:
  251.  
  252.    1) When the requirements of effective management in times of network
  253.       stress are inconsistent with those of security, the design should
  254.       prefer the former.
  255.  
  256.    2) Neither the security protocol nor its underlying security
  257.       mechanisms should depend upon the ready availability of other
  258.       network services (e.g., Network Time Protocol (NTP) or key
  259.       management protocols).
  260.  
  261.    3) A security mechanism should entail no changes to the basic SNMP
  262.       network management philosophy.
  263.  
  264. 1.3.  Security Services
  265.  
  266.    The security services necessary to support the goals of an SNMPv3
  267.    security model are as follows.
  268.  
  269.    - Data Integrity
  270.      is the provision of the property that data has not been altered or
  271.      destroyed in an unauthorized manner, nor have data sequences been
  272.      altered to an extent greater than can occur non-maliciously.
  273.  
  274.    - Data Origin Authentication
  275.      is the provision of the property that the claimed identity of the
  276.      user on whose behalf received data was originated is corroborated.
  277.  
  278.    - Data Confidentiality
  279.      is the provision of the property that information is not made
  280.      available or disclosed to unauthorized individuals, entities, or
  281.      processes.
  282.  
  283.    For the protocols specified in this memo, it is not possible to
  284.    assure the specific originator of a received SNMPv3 message; rather,
  285.    it is the user on whose behalf the message was originated that is
  286.    authenticated.
  287.  
  288.    For these protocols, it not possible to obtain data integrity without
  289.  
  290.  
  291.  
  292. Blumenthal/Wijnen         Expires December  1997               [Page  5]
  293.  
  294. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  295.  
  296.  
  297.    data origin authentication, nor is it possible to obtain data origin
  298.    authentication without data integrity.  Further, there is no
  299.    provision for data confidentiality without both data integrity and
  300.    data origin authentication.
  301.  
  302.    The security protocols used in this memo are considered acceptably
  303.    secure at the time of writing.  However, the procedures allow for new
  304.    authentication and privacy methods to be specified at a future time
  305.    if the need arises.
  306.  
  307. 1.4.  Implementation Organization
  308.  
  309.    The security protocols defined in this memo are implemented in three
  310.    different modules and each have their specific responsibilities such
  311.    that together they realize the goals and security services described
  312.    above:
  313.  
  314.    - The timeliness module must provide for:
  315.  
  316.      - Protection against message delay or replay (to an extent greater
  317.        than can occur through normal operation)
  318.  
  319.    - The authentication module must provide for:
  320.  
  321.      - Data Integrity,
  322.  
  323.      - Data Origin Authentication
  324.  
  325.    - The privacy module must provide for
  326.  
  327.      - Protection against disclosure of the message payload.
  328.  
  329.    The timeliness module is fixed for this User-based Security model
  330.    while there is provision for multiple authentication and/or privacy
  331.    modules, each of which implements a specific authentication or
  332.    privacy protocol respectively.
  333.  
  334. 1.4.1.  Timeliness Module
  335.  
  336.    Section 3 (Elements of procedure) uses the time values in an SNMPv3
  337.    message to do timeliness checking. The timeliness check is only
  338.    performed if authentication is applied to the message. Since the
  339.    complete message is checked for integrity, we can assume that the
  340.    time values in a message that passes the authentication module are
  341.    trustworthy.
  342.  
  343. 1.4.2.  Authentication Protocol
  344.  
  345.    Section 6 describes the Keyed-MD5 authentication protocol which is
  346.    the first authentication protocol to be used with the User-based
  347.    Security model. In the future additional or replacement
  348.  
  349.  
  350.  
  351. Blumenthal/Wijnen         Expires December  1997               [Page  6]
  352.  
  353. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  354.  
  355.  
  356.    authentication protocols may be defined as new needs arise.
  357.  
  358.    This User-based Security model prescribes that the complete message
  359.    is checked for integrity in the authentication module.
  360.  
  361.    For a message to be authenticated, it needs to pass authentication
  362.    check by the authentication module and the timeliness check which
  363.    is a fixed part of this User-based Security model.
  364.  
  365. 1.4.3.  Privacy Protocol
  366.  
  367.    Section 7 describes the CBC-DES Symmetric Encryption Protocol which
  368.    the first privacy protocol to be used with the User-based Security
  369.    model.  In the future additional or replacement privacy protocols
  370.    may be defined as new needs arise.
  371.  
  372.    This User-based Security model prescribes that the scopedPDU
  373.    is protected from disclosure when a message is sent with privacy.
  374.  
  375.    This User-based Security model also prescribes that a message needs
  376.    to be authenticated if privacy is in use.
  377.  
  378. 1.5  Protection against Message Replay, Delay and Redirection
  379.  
  380. 1.5.1   Authoritative SNMP Engine
  381.  
  382.    In order to protect against message replay, delay and redirection,
  383.    one of the SNMP engines involved in each communication is designated
  384.    to be the authoritative engine.  For messages with a GET, GETNEXT,
  385.    GETBULK, SET or INFORM request as the payload, the receiver of such
  386.    messages is authoritative.  For messages with a SNMPv2-TRAP,
  387.    RESPONSE  or REPORT as the payload, the sender is authoritative.
  388.  
  389. 1.5.2   The following mechanisms are used:
  390.  
  391.    - To protect against the threat of message delay or replay (to an
  392.      extent greater than can occur through normal operation), a set of
  393.      time (at the authoritative source) indicators and a request-id are
  394.      included in each message generated.  An SNMPv3 engine evaluates
  395.      the time indicators to determine if a received message is recent.
  396.      An SNMPv3 engine may evaluate the time indicators to ensure that
  397.      a received message is at least as recent as the last message it
  398.      received from the same source.  A non-authoritative SNMPv3 engine
  399.      uses received authentic messages to advance its notion of time at
  400.      the remote authoritative source.  An SNMPv3 engine also evaluates
  401.      the request-id in received Response messages and discards messages
  402.      which do not correspond to outstanding requests.
  403.  
  404.      These mechanisms provide for the detection of messages whose time
  405.      of generation was not recent in all but one circumstance; this
  406.      circumstance is the delay or replay of a Report message (sent to a
  407.  
  408.  
  409.  
  410. Blumenthal/Wijnen         Expires December  1997               [Page  7]
  411.  
  412. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  413.  
  414.  
  415.      receiver) when the receiver has has not recently communicated with
  416.      the source of the Report message.  In this circumstance, the
  417.      detection guarantees only that the Report message is more recent
  418.      than the last communication between source and destination of the
  419.      Report message.  However, Report messages do not request or contain
  420.      management information, and thus, goal #3 in Section 1.2 above is
  421.      met; further, Report messages can at most cause the receiver to
  422.      advance its notion of time (at the source) by less than the proper
  423.      amount.
  424.  
  425.      This protection against the threat of message delay or replay does
  426.      not imply nor provide any protection against unauthorized deletion
  427.      or suppression of messages. Also, an SNMPv3 engine may not be able
  428.      to detect message reordering if all the messages involved are sent
  429.      within the Time Window interval.  Other mechanisms defined
  430.      independently of the security protocol can also be used to detect
  431.      the re-ordering replay, deletion, or suppression of messages
  432.      containing set operations (e.g., the MIB variable snmpSetSerialNo
  433.      [RFC1907]).
  434.  
  435.    - verifying that a message sent to/from one SNMPv3 engine cannot be
  436.      replayed to/as-if-from another SNMPv3 engine.
  437.  
  438.      Included in each message is an identifier unique to the SNMPv3
  439.      engine associated with the sender or intended recipient of the
  440.      message.  Also, each message containing a Response PDU contains a
  441.      request-id which associates the message to a recently generated
  442.      request.
  443.  
  444.      A Report message sent by one SNMPv3 engine to a second SNMPv3
  445.      engine can potentially be replayed to another SNMPv3 engine.
  446.      However, Report messages do not request or contain management
  447.      information, and thus, goal #3 in Section 1.2 above is met;
  448.      further, Report messages can at most cause the receiver to advance
  449.      its notion of time (at the authoritative source) by less than the
  450.      correct amount.
  451.  
  452.    - detecting messages which were not recently generated.
  453.  
  454.      A set of time indicators are included in the message, indicating
  455.      the time of generation.  Messages (other than those containing
  456.      Report PDUs) without recent time indicators are not considered
  457.      authentic.  In addition, messages containing Response PDUs have a
  458.      request-id; if the request-id does not match that of a recently
  459.      generated request, then the message is not considered to be
  460.      authentic.
  461.  
  462.      A Report message sent by an SNMPv3 engine can potentially be
  463.      replayed at a later time to an SNMPv3 engine which has not
  464.      recently communicated with that source engine.  However, Report
  465.      messages do not request or contain management information, and
  466.  
  467.  
  468.  
  469. Blumenthal/Wijnen         Expires December  1997               [Page  8]
  470.  
  471. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  472.  
  473.  
  474.      thus, goal #3 in Section 1.2 above is met; further, Report
  475.      messages can at most cause the receiver to advance its notion of
  476.      time (at the authoritative source) by less than the correct
  477.      amount.
  478.  
  479.    This memo allows the same user to be defined on multiple SNMPv3
  480.    engines.  Each SNMPv3 engine maintains a value, snmpEngineID,
  481.    which uniquely identifies the engine.  This value is included in
  482.    each message sent to/from the engine that is authoritative (see
  483.    section 1.5.1).  On receipt of a message, an authoritative engine
  484.    checks the value to ensure it is the intended recipient, and a
  485.    non-authoritative engine uses the value to ensure that the message
  486.    is processed using the correct state information.
  487.  
  488.    Each SNMPv3 engine maintains two values, engineBoots and engineTime,
  489.    which taken together provide an indication of time at that engine.
  490.    Both of these values are included in an authenticated message sent
  491.    to/received from that engine. On receipt, the values are checked to
  492.    ensure that the indicated time is within a time window of the
  493.    current time.  The time window represents an administrative upper
  494.    bound on acceptable delivery delay for protocol messages.
  495.  
  496.    For an SNMPv3 engine to generate a message which an authoritative
  497.    engine will accept as authentic, and to verify that a message
  498.    received from that authoritative engine is authentic, such an engine
  499.    must first achieve time synchronization with the authoritative
  500.    engine.
  501.  
  502.  
  503.  
  504.  
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.  
  527.  
  528. Blumenthal/Wijnen         Expires December  1997               [Page  9]
  529.  
  530. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  531.  
  532.  
  533. 2.  Elements of the Model
  534.  
  535.    This section contains definitions required to realize the security
  536.    model defined by this memo.
  537.  
  538. 2.1.  SNMPv3 Users
  539.  
  540.    Management operations using this security model make use of a defined
  541.    set of user identities.  For any SNMPv3 user on whose behalf
  542.    management operations are authorized at a particular SNMPv3 engine,
  543.    that engine must have knowledge of that user.  An SNMPv3 engine that
  544.    wishes to communicate with another SNMPv3 engine must also have
  545.    knowledge of a user known to that engine, including knowledge of the
  546.    applicable attributes of that user.
  547.  
  548.    A user and its attributes are defined as follows:
  549.  
  550.    <userName>
  551.      A string representing the name of the user.
  552.  
  553.    <miId>
  554.      A human-readable string representing a (security) model
  555.      independent identity for this user.
  556.  
  557.    <groupName>
  558.      A string representing the group that the user belongs to.
  559.  
  560.    <authProtocol>
  561.      An indication of whether messages sent on behalf of this user can
  562.      be authenticated, and if so, the type of authentication protocol
  563.      which is used.  One such protocol is defined in this memo: the
  564.      Digest Authentication Protocol.
  565.  
  566.    <authKey>
  567.      If messages sent on behalf of this user can be authenticated, the
  568.      (private) authentication key for use with the authentication
  569.      protocol.  Note that a user's authentication key will normally be
  570.      different at different authoritative engines. Not visible via
  571.      remote access.
  572.  
  573.    <authKeyChange>
  574.      The only way to remotely update the authentication key. Does that
  575.      in a secure manner, so that the update can be completed without
  576.      the need to employ privacy protection.
  577.  
  578.    <privProtocol>
  579.      An indication of whether messages sent on behalf of this user can
  580.      be protected from disclosure, and if so, the type of privacy
  581.      protocol which is used.  One such protocol is defined in this memo:
  582.      the DES-based Encryption Protocol.
  583.  
  584.  
  585.  
  586.  
  587. Blumenthal/Wijnen         Expires December  1997               [Page 10]
  588.  
  589. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  590.  
  591.  
  592.    <privKey>
  593.      If messages sent on behalf of this user can be en/decrypted, the
  594.      (private) privacy key for use with the privacy protocol. Note that
  595.      a user's privacy key will normally be different at different
  596.      authoritative engines. Not visible via remote access.
  597.  
  598.    <privKeyChange>
  599.      The only way to remotely update the encryption key. Does that
  600.      in a secure manner, so that the update can be completed without
  601.      the need to employ privacy protection.
  602.  
  603.  
  604. 2.2.  Replay Protection
  605.  
  606.    Each SNMPv3 engine maintains three objects:
  607.  
  608.    - snmpEngineID, which is an identifier unique among all SNMPv3
  609.      engines in (at least) an administrative domain;
  610.  
  611.    - engineBoots, which is a count of the number of times the engine has
  612.      re-booted/re-initialized since snmpEngineID was last configured;
  613.      and,
  614.  
  615.    - engineTime, which is the number of seconds since engineBoots was
  616.      last incremented.
  617.  
  618.    Each SNMPv3 engine is always authoritative with respect to these
  619.    objects in its own engine.  It is the responsibility of a non-
  620.    authoritative SNMPv3 engine to synchronize with the authoritative
  621.    engine, as appropriate.
  622.  
  623.    An authoritative SNMPv3 engine is required to maintain the values of
  624.    its snmpEngineID and engineBoots in non-volatile storage.
  625.  
  626. 2.2.1.  snmpEngineID
  627.  
  628.    The engineID value contained in an authenticated message is used to
  629.    defeat attacks in which messages from one engine to another engine
  630.    are replayed to a different engine.
  631.  
  632.    When an authoritative engine is first installed, it sets its local
  633.    value of snmpEngineID according to a enterprise-specific algorithm
  634.    (see the definition of engineID in the SNMP Architecture document
  635.    [SNMP-ARCH]).
  636.  
  637. 2.2.2.  engineBoots and engineTime
  638.  
  639.    The engineBoots and engineTime values contained in an authenticated
  640.    message are used to defeat attacks in which messages are replayed
  641.    when they are no longer valid.  Through use of engineBoots and
  642.    engineTime, there is no requirement for an SNMPv3 engine to have a
  643.  
  644.  
  645.  
  646. Blumenthal/Wijnen         Expires December  1997               [Page 11]
  647.  
  648. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  649.  
  650.  
  651.    non-volatile clock which ticks (i.e., increases with the passage of
  652.    time) even when the engine is powered off.  Rather, each time an
  653.    SNMPv3 engine re-boots, it retrieves, increments, and then stores
  654.    engineBoots in non-volatile storage, and resets engineTime to zero.
  655.  
  656.    When an SNMPv3 engine is first installed, it sets its local values
  657.    of engineBoots and engineTime to zero.  If engineTime ever
  658.    reaches its maximum value (2147483647), then engineBoots is
  659.    incremented as if the engine has re-booted and engineTime is reset to
  660.    zero and starts incrementing again.
  661.  
  662.    Each time an authoritative SNMPv3 engine re-boots, any SNMPv3 engines
  663.    holding that authoritative engine's values of engineBoots and
  664.    engineTime need to re-synchronize prior to sending correctly
  665.    authenticated messages to that authoritative engine (see Section
  666.    2.3 for (re-)synchronization procedures).  Note, however, that the
  667.    procedures do provide for a notification to be accepted as authentic
  668.    by a receiving engine, when sent by an authoritative engine which has
  669.    re-booted since the receiving engine last (re-)synchronized.
  670.  
  671.    If an authoritative SNMPv3 engine is ever unable to determine its
  672.    latest engineBoots value, then it must set its engineBoots value to
  673.    0xffffffff.
  674.  
  675.    Whenever the local value of engineBoots has the value 0xffffffff, it
  676.    latches at that value and an authenticated message always causes an
  677.    notInTimeWindow authentication failure.
  678.  
  679.    In order to reset an engine whose engineBoots value has reached the
  680.    value 0xffffffff, manual intervention is required.  The engine must
  681.    be physically visited and re-configured, either with a new
  682.    snmpEngineID value, or with new secret values for the authentication
  683.    and privacy protocols of all users known to that engine.
  684.  
  685. 2.2.3.  Time Window
  686.  
  687.    The Time Window is a value that specifies the window of time in which
  688.    a message generated on behalf of any user is valid.  This memo
  689.    specifies that the same value of the Time Window, 150 seconds, is
  690.    used for all users.
  691.  
  692. 2.3.  Time Synchronization
  693.  
  694.    Time synchronization, required by a non-authoritative engine (see
  695.    section 5.1.1) in order to proceed with authentic communications,
  696.    has occurred when the non-authoritative engine has obtained local
  697.    values of engineBoots and engineTime from the authoritative engine
  698.    that are within the authoritative engine's time window.  To remain
  699.    synchronized, the local values must remain within the authoritative
  700.    engine's time window and thus must be kept loosely synchronized
  701.    with the values stored at the authoritative engine.
  702.  
  703.  
  704.  
  705. Blumenthal/Wijnen         Expires December  1997               [Page 12]
  706.  
  707. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  708.  
  709.  
  710.    In addition to keeping a local version of engineBoots and engineTime,
  711.    a non-authoritative engine must also keep one other local variable,
  712.    latestReceivedEngineTime.  This value records the highest value of
  713.    engineTime that was received by the non-authoritative engine from
  714.    the authoritative engine and is used to eliminate the possibility
  715.    of replaying messages that would prevent the non-authoritative
  716.    engine's notion of the engineTime from advancing.
  717.  
  718.    Time synchronization occurs as part of the procedures of receiving
  719.    a message (Section 3.2, step 7b). As such, no explicit time
  720.    synchronization procedure is required by a non-authoritative engine.
  721.    Note, that whenever the local value of snmpEngineID is changed
  722.    (e.g., through discovery) or when secure communications are first
  723.    established with this engine, the local values of engineBoots and
  724.    latestReceivedEngineTime should be set to zero. This will cause
  725.    the time synchronization to occur when the next authentic message
  726.    is received.
  727.  
  728. 2.4.  SNMPv3 Messages Using this Model
  729.  
  730.    The syntax of an SNMPv3 message using this security model adheres
  731.    to the message format defined in the SNMP Architecture document
  732.    [SNMP-ARCH]. The securityParameters in the message are
  733.    defined as an OCTET STRING. The format of that OCTET STRING for
  734.    the User-based Security model is as follows:
  735.  
  736.       securityParameters ::=
  737.           SEQUENCE {
  738.               -- global parameters
  739.               engineID
  740.                   OCTET STRING (SIZE(12)),
  741.               engineBoots
  742.                   Unsigned32 (0..4294967295),
  743.               engineTime
  744.                   Unsigned32 (0..2147483647),
  745.               userName
  746.                   OCTET STRING (SIZE(1..16)),
  747.               authParameters
  748.                   OCTET STRING,
  749.               privParameters
  750.                   OCTET STRING,
  751.           }
  752.       END
  753.  
  754.    The authParameters are defined by the authentication protocol in
  755.    use for the message (as defined by the authProtocol column in
  756.    the user's entry in the usecUserTable).
  757.  
  758.    The privParameters are defined by the privacy protocol in
  759.    use for the message (as defined by the privProtocol column in
  760.    the user's entry in the usecUserTable).
  761.  
  762.  
  763.  
  764. Blumenthal/Wijnen         Expires December  1997               [Page 13]
  765.  
  766. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  767.  
  768.  
  769.  
  770. 2.5  Input and Output of the User-based Security Module
  771.  
  772.    This section describes the inputs and outputs that the User-based
  773.    Security module expects and produces when the Message Processing
  774.    and Control module (MPC) invokes the User-base Security module for
  775.    services.
  776.  
  777. 2.5.1 Input and Output when generating an SNMPv3 Message
  778.  
  779.    When the Message Processing and Control module (MPC) invokes the
  780.    User-based Security module to secure an outgoing SNMPv3 message,
  781.    there are two possibilities:
  782.  
  783.    a) A new request is generated.  The abstract service interface is:
  784.  
  785.         generateRequestMsg(version, msgID, mms, msgFlags,
  786.                            securityModel, securityParameters,
  787.                            LoS, miId, engineID, scopedPDU)
  788.  
  789.    b) A response is generated.  The abtract service interface is:
  790.  
  791.         generateResponseMsg(version, msgID, mms, msgFlags,
  792.                             securityModel, securityParameters,
  793.                             scopedPDU, cachedSecurityDataReference)
  794.  
  795.    Where:
  796.  
  797.      version
  798.       This is the version number for the SNMP message.
  799.       This data is not used by the USEC module.
  800.       It is part of the globalData of the message.
  801.      msgID
  802.       This is the msgID to be generated.
  803.       This data is not used by the USEC module.
  804.       It is part of the globalData of the message.
  805.      mms
  806.       This is the maximum message size.
  807.       This data is not used by the USEC module.
  808.       It is part of the globalData of the message.
  809.      msgFlags
  810.       This is the field containing the msgFlags.
  811.       This data is not used by the USEC module.
  812.       It is part of the globalData of the message.
  813.       It should be consistent with the LoS that is passed.
  814.      securityModel
  815.       This is the securityModel in use. Should be the USEC model.
  816.       This data is not used by the USEC module.
  817.       It is part of the globalData of the message.
  818.      securityParameters
  819.       These are the security parameters. They will be filled in
  820.  
  821.  
  822.  
  823. Blumenthal/Wijnen         Expires December  1997               [Page 14]
  824.  
  825. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  826.  
  827.  
  828.       by the User-based Security module.
  829.      LoS
  830.       The Level of Security (LoS) from which the User-based Security
  831.       module determines if the message needs to be protected from
  832.       disclosure and if the message needs to be authenticated.
  833.      scopedPDU
  834.       this is the message payload. The data is opaque as far as the
  835.       User-based Security module is concerned.
  836.      miId
  837.       this is the (security) model independent Identifier.
  838.       Together with the engineID it identifies a row in the
  839.       usecUserTable that is to be used for securing the message.
  840.      engineID
  841.       the engineID of the authoritative SNMP engine to which the
  842.       request is to be sent.
  843.      cachedSecurityDataReference
  844.       A handle/reference to cached security data to be used when
  845.       securing an outgoing response. This is the handle/reference
  846.       that was generated by the USEC module when the incoming
  847.       request was processed.
  848.  
  849.    Upon completion of the process, the User-based Security module
  850.    returns either and error indication or the completed message
  851.    with privacy and authentication applied if such was requested
  852.    by the Level of Security (LoS) flags passed.
  853.  
  854.    The abstract service interface is:
  855.  
  856.       returnGeneratedMsg(wholeMsg, wholeMsgLen, statusCode)
  857.  
  858.    Where:
  859.      wholeMsg
  860.       this is fully encoded and secured message ready to be sent on
  861.       the wire.
  862.      wholeMsgLen
  863.       this is the length of the encoded and secured message wholeMsg.
  864.      statusCode
  865.       this is the indicator of whether the encoding and securing of
  866.       the message was successful, and if not it is an indication of
  867.       the problem.
  868.  
  869. 2.5.2 Input and Output when receiving an SNMPv3 Message
  870.  
  871.    The Message Processing and Control module (MPC) invokes the
  872.    User-based Security module to verify proper security of an incoming
  873.    SNMPv3 message. The abstract service interface is:
  874.  
  875.       processMsg(version, msgID, mms, msgFlags,
  876.                  securityModel, securityParameters,
  877.                  LoS, wholeMsg, wholeMsgLen)
  878.  
  879.  
  880.  
  881.  
  882. Blumenthal/Wijnen         Expires December  1997               [Page 15]
  883.  
  884. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  885.  
  886.  
  887.    Where:
  888.  
  889.      version
  890.       This is the version number for the SNMP message.
  891.       This data is not used by the USEC module.
  892.       It is part of the globalData of the message.
  893.      msgID
  894.       This is the msgID to be generated.
  895.       This data is not used by the USEC module.
  896.       It is part of the globalData of the message.
  897.      mms
  898.       This is the maximum message size.
  899.       This data is not used by the USEC module.
  900.       It is part of the globalData of the message.
  901.      msgFlags
  902.       This is the field containing the msgFlags.
  903.       This data is not used by the USEC module.
  904.       It is part of the globalData of the message.
  905.       It should be consistent with the LoS that is passed.
  906.      securityModel
  907.       This is the securityModel in use. Should be the USEC model.
  908.       This data is not used by the USEC module.
  909.       It is part of the globalData of the message.
  910.      securityParameters
  911.       These are the security parameters. They will be filled in
  912.       by the User-based Security module.
  913.      LoS
  914.       The Level of Security (LoS) from which the User-based Security
  915.       module determines if the message needs to be protected from
  916.       disclosure and if the message needs to be authenticated.
  917.      wholeMsg
  918.       this is the complete message as it was received by the Message
  919.       Processing and Control module (MPC).
  920.      wholeMsgLen
  921.       this is the length of the wholeMsg as received on the wire.
  922.  
  923.    Upon completion of the process, the User-based Security module
  924.    returns a statusCode and in case of success authenticated and
  925.    decrypted data. The abstract service interface is:
  926.  
  927.       returnMsg(miId, groupName, cachedSecurityDataReference,
  928.                 scopedPDUmms, scopedPDU, statusCode)
  929.  
  930.    Where:
  931.  
  932.      miId
  933.       this is an Security Model-independent Identifier that identifies
  934.       an entry in the usecUserTable. It is to be used later when a
  935.       response message must be secured.
  936.      groupName
  937.       this is the group to which the user belongs. The User-based
  938.  
  939.  
  940.  
  941. Blumenthal/Wijnen         Expires December  1997               [Page 16]
  942.  
  943. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  944.  
  945.  
  946.       Security module retrieves this information from the usecUserTable.
  947.      cachedSecurityDataReference
  948.       cached security data to be used when securing a possible outgoing
  949.       response to this request.  Will have to be released explicitly
  950.       by the MPC or the application.
  951.      scopedPDUmms
  952.       this is the maximum message size that a possible response PDU
  953.       may use. The User-based Security module calculates this size such
  954.       that there is always space available for any security parameters
  955.       that need to be added to the response message.
  956.      scopedPDU
  957.       this is the message payload.  The data is opaque as far as the
  958.       User-based Security module is concerned.  But if the data was
  959.       encrypted because privacy protection was in effect, then upon
  960.       return from the User-based Security module the data will have
  961.       been decrypted.
  962.      statusCode
  963.       this is an indicator of whether the message was parsed,
  964.       authenticated and possibly decrypted successfully. If
  965.       it was not - it indicates what the problem was.
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.  
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.  
  998.  
  999.  
  1000. Blumenthal/Wijnen         Expires December  1997               [Page 17]
  1001.  
  1002. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1003.  
  1004.  
  1005. 3.  Elements of Procedure
  1006.  
  1007.    This section describes the security related procedures followed by
  1008.    an SNMPv3 engine when processing SNMPv3 messages according to the
  1009.    User-based Security model.
  1010.  
  1011. 3.1.  Processing an Outgoing Message
  1012.  
  1013.    This section describes the procedure followed by an SNMPv3 engine
  1014.    whenever it generates a message containing a management operation
  1015.    (either a request, a response, a notification, or a report) on
  1016.    behalf of a user, with a particular Level of Security (LoS).
  1017.  
  1018.    1)  - If any cachedSecurityDataReference is passed, then
  1019.          information concerning the user is extracted from the
  1020.          cachedSecurityData. The cachedSecurityData can now be
  1021.          discarded.
  1022.        - Otherwise, based on the miId, information concerning the user
  1023.          at the destination engineID is extracted from the Local
  1024.          (security) Configuration Datastore (LCD, usecUserTable).
  1025.          If information about the user is absent from the LCD,
  1026.          then an error indication (unknownSecurityIdentity) is
  1027.          returned to the calling module.
  1028.  
  1029.    2)  If the Level of Security (LoS) specifies that the message is to
  1030.        be protected from disclosure, but the user does not support both
  1031.        an authentication and a privacy protocol then the message cannot
  1032.        be sent.  An error indication (unsupportedLoS) is returned to
  1033.        the calling module.
  1034.  
  1035.    3)  If the Level of Security (LoS) specifies that the message is to
  1036.        be authenticated, but the user does not support an authentication
  1037.        protocol, then the message cannot be sent.  An error indication
  1038.        (unsupportedLoS) is returned to the calling module.
  1039.  
  1040.    4)  If the Level of Security (LoS) specifies that the message is to
  1041.        be protected from disclosure, then the octet sequence
  1042.        representing the serialized scopedPDU is encrypted according to
  1043.        the user's privacy protocol.  To do so a call is made to the
  1044.        privacy module that implements the user's privacy protocol.
  1045.        The abstract service interface is:
  1046.  
  1047.            encryptMsg(cryptKey, scopedPDU)
  1048.  
  1049.          Where:
  1050.  
  1051.          cryptKey
  1052.            The user's usecUserPrivKey. This is the secret key
  1053.            that can be used by the encryption algorithm.
  1054.          scopedPDU
  1055.            The data to be encrypted.
  1056.  
  1057.  
  1058.  
  1059. Blumenthal/Wijnen         Expires December  1997               [Page 18]
  1060.  
  1061. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1062.  
  1063.  
  1064.  
  1065.        Upon completion the privacy module returns:
  1066.  
  1067.            returnEncryptedMsg(encryptedPDU, privParameters, statusCode)
  1068.  
  1069.          encryptedPDU
  1070.            The encrypted scopedPDU (encoded as an octet string).
  1071.          privParameters
  1072.            The privacy parameters (encoded as an octet string) that
  1073.            need to be sent in the outgoing message.
  1074.          statusCode
  1075.            The indicator of whether the PDU was encrypted successfully
  1076.            and if not, it indicates what went wrong.
  1077.  
  1078.        If an error indication is returned by the privacy module then
  1079.        the message cannot be sent and the error indication is returned
  1080.        to the calling module.
  1081.  
  1082.        If the privacy module returns success, then the privParameters
  1083.        field is put into the securityParameters and the encryptedPDU
  1084.        serves as the payload of the message being prepared.
  1085.  
  1086.    5)  If the Level of Security (LoS) specifies that the message is not
  1087.        to be protected from disclosure, then the NULL string is encoded
  1088.        as an octet string into the privParameters field of the
  1089.        securityParameters and the scopedPDU serves as the payload of
  1090.        the message being prepared.
  1091.  
  1092.    6)  The engineID is encoded as an octet string into the <engineID>
  1093.        field of the securityParameters.
  1094.  
  1095.    7)  If the Level of Security (LoS) specifies that the message is to
  1096.        be authenticated, then the current values of engineBoots, and
  1097.        engineTime corresponding to engineID from the LCD are used.
  1098.        Otherwise, a zero value is used for engineBoots and engineTime.
  1099.        The values are encoded as Unsigned32 into the engineBoots and
  1100.        engineTime fields of the securityParameters.
  1101.  
  1102.    8)  The userName is encoded as an octet string into the userName
  1103.        field of the securityParameters.
  1104.  
  1105.    9)  If the Level of Security (LoS) specifies that the message is to
  1106.        be authenticated, the message is authenticated according to the
  1107.        user's authentication protocol. To do so, a call is made to the
  1108.        authentication module that implements the user's authentication
  1109.        protocol.  The abstract service interface is:
  1110.  
  1111.             authMsg(authKey, wholeMsg)
  1112.  
  1113.           authKey
  1114.             The user's usecUserAuthKey. This is the secret key
  1115.  
  1116.  
  1117.  
  1118. Blumenthal/Wijnen         Expires December  1997               [Page 19]
  1119.  
  1120. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1121.  
  1122.  
  1123.             that can be used by the authentication algorithm.
  1124.           wholeMsg
  1125.             the message to be authenticated.
  1126.  
  1127.        Upon completion the authentication module returns:
  1128.  
  1129.             returnAuthMsg(wholeMsg, statusCode)
  1130.  
  1131.           wholeMsg
  1132.             Same as in input, but with authParameters properly filled.
  1133.           statusCode
  1134.             The indicator of whether the message was successfully
  1135.             processed by the authentication module.
  1136.  
  1137.        If an error indication is returned by the authentication module,
  1138.        then the message cannot be sent and the error indication is
  1139.        returned to the calling module.
  1140.  
  1141.    10) If the Level of Security (LoS) specifies that the message is not
  1142.        to be authenticated then the NULL string is encoded as an octet
  1143.        string into the authParameters field of the securityParameters.
  1144.  
  1145.    11) The completed message is returned to the calling module with
  1146.        the statusCode set to success.
  1147.  
  1148. 3.2.  Processing an Incoming Message
  1149.  
  1150.    This section describes the procedure followed by an SNMPv3 engine
  1151.    whenever it receives a message containing a management operation
  1152.    on behalf of a user, with a particular Level of Security (LoS).
  1153.  
  1154.    1)  If the received securityParameters is not the serialization
  1155.        (according to the conventions of [RFC1906]) of an OCTET STRING
  1156.        formated according to the securityParameters defined in section
  1157.        2.4, then the snmpInASNParseErrs counter [RFC1907] is
  1158.        incremented, and an error indication (ASNParseError) is returned
  1159.        to the calling module.
  1160.  
  1161.    2)  The values of the security parameter fields are extracted from
  1162.        the securityParameters.
  1163.  
  1164.    3)  If the engineID field contained in the securityParameters is
  1165.        unknown then:
  1166.  
  1167.        - a manager that performs discovery may optionally create a
  1168.          new entry in its Local (security) Configuration Database (LCD)
  1169.          and continue processing; or
  1170.  
  1171.        - an error indication (unknownEngineID) is returned to the
  1172.          calling module.
  1173.  
  1174.  
  1175.  
  1176.  
  1177. Blumenthal/Wijnen         Expires December  1997               [Page 20]
  1178.  
  1179. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1180.  
  1181.  
  1182.    4)  Information about the value of the userName and engineID
  1183.        fields is extracted from the Local (security) Configuration
  1184.        Database (LCD, usecUserTable).  If no information is
  1185.        available for this user, then an error indication
  1186.        (unknownSecurityIdentity) is returned to the calling module.
  1187.  
  1188.    5)  If the information about the user indicates that it does not
  1189.        support the Level of Security indicated by the LoS parameter,
  1190.        then and an error indication (unsupportedLoS) is returned to
  1191.        the calling module.
  1192.  
  1193.    6)  If the Level of Security (LoS) specifies that the message is to
  1194.        be authenticated, then the message is authenticated according to
  1195.        the user's authentication protocol.  To do so, a call is made to
  1196.        the authentication module that implements the user's
  1197.        authentication protocol. The abstract service interface is:
  1198.  
  1199.            authIncomingMsg(authKey, authParameters, wholeMsg)
  1200.  
  1201.          authKey
  1202.            The user's (secret) usecUserAuthKey
  1203.          authParameters
  1204.            the authParameters from the incoming message.
  1205.          wholeMsg
  1206.            the message to be authenticated.
  1207.  
  1208.        The authentication module returns:
  1209.  
  1210.            returnAuthIncomingMsg(wholeMsg, statusCode)
  1211.  
  1212.        If the message is not authentic according to the authentication
  1213.        protocol module (i.e. it returns an error indication), then the
  1214.        error indication is returned to the calling module.
  1215.  
  1216.        Otherwise, the authenticated wholeMsg is used for further
  1217.        processing.
  1218.  
  1219.    7)  If the LoS field indicates an authenticated message, then
  1220.        the local values of engineBoots and engineTime corresponding to
  1221.        the value of the engineID field are extracted from the
  1222.        Local (security) Configuration Database (LCD).
  1223.  
  1224.        a) If the engineID value is the same as the snmpEngineID of
  1225.           the processing SNMPv3 engine (meaning that this is the
  1226.           authoritative engine), then if any of the following
  1227.           conditions is true, then the message is considered to be
  1228.           outside of the Time Window:
  1229.  
  1230.            - the local value of engineBoots is 0xffffffff;
  1231.  
  1232.            - the engineBoots field differs from the local value of
  1233.  
  1234.  
  1235.  
  1236. Blumenthal/Wijnen         Expires December  1997               [Page 21]
  1237.  
  1238. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1239.  
  1240.  
  1241.              engineBoots; or,
  1242.  
  1243.            - the value of the engineTime field differs from the local
  1244.              notion of engineTime by more than +/- 150 seconds.
  1245.  
  1246.           If the message is considered to be outside of the Time Window
  1247.           then an error indication (notInTimeWindow) is returned to
  1248.           the calling module.
  1249.  
  1250.        b) If the engineID value is not the same as the snmpEngineID of
  1251.           the processing SNMPv3 engine (meaning that this engine is not
  1252.           the authoritative engine), then:
  1253.  
  1254.           - if at least one of the following conditions is true:
  1255.  
  1256.             - the engineBoots field is greater than the local value
  1257.               of engineBoots; or,
  1258.  
  1259.             - the engineBoots field is equal to the local value of
  1260.               engineBoots and the engineTime field is greater than
  1261.               the value of latestReceivedEngineTime,
  1262.  
  1263.             then the LCD entry corresponding to the value of the
  1264.             engineID field is updated, by setting the local value of
  1265.             engineBoots from the engineBoots field, the local value
  1266.             latestReceivedEngineTime from the engineTime field, and
  1267.             the local value of engineTime from the engineTime field.
  1268.  
  1269.           - if any of the following conditions is true, then the message
  1270.             is considered to be outside of the Time Window:
  1271.  
  1272.             - the local value of engineBoots is 0xffffffff;
  1273.  
  1274.             - the engineBoots field is less than the local value of
  1275.               engineBoots; or,
  1276.  
  1277.             - the engineBoots field is equal to the local value of
  1278.               engineBoots and the engineTime field is more than 150
  1279.               seconds less than the local notion of engineTime.
  1280.  
  1281.             If the message is considered to be outside of the Time
  1282.             Window then an error indication (notInTimeWindow) is
  1283.             returned to the calling module;
  1284.             however, time synchronization procedures may be invoked.
  1285.             Note that this procedure allows for engineBoots in the
  1286.             message to be greater than the local value of engineBoots
  1287.             to allow for received messages to be accepted as authentic
  1288.             when received from an authoritative SNMPv3 engine that
  1289.             has re-booted since the receiving SNMPv3 engine last
  1290.             (re-)synchronized.
  1291.  
  1292.  
  1293.  
  1294.  
  1295. Blumenthal/Wijnen         Expires December  1997               [Page 22]
  1296.  
  1297. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1298.  
  1299.  
  1300.    8)  If the LoS field indicates that the message was protected from
  1301.        disclosure, then the octet sequence representing the scopedPDU
  1302.        is decrypted according to the user's privacy protocol to obtain
  1303.        a serialized scopedPDUs value.  Otherwise the data component is
  1304.        assumed to directly contain the scopedPDUs value. To do the
  1305.        decryption, a call is made to the privacy module that implements
  1306.        the user's privacy protocol.  The abstract service interface is:
  1307.  
  1308.            decryptMsg(cryptKey, privParameters, encryptedPDU)
  1309.  
  1310.          cryptKey
  1311.            The user's secret usecUserPrivKey
  1312.          privParameters
  1313.            The privParameters field from the securityParameters from
  1314.            the incoming message.
  1315.          encryptedPDU
  1316.            the data to be decrypted
  1317.  
  1318.        The privacy module returns:
  1319.  
  1320.            returnDecryptedMsg(scopedPDU, statusCode)
  1321.  
  1322.          scopedPDU
  1323.            The decrypted scopedPDU.
  1324.          statusCode
  1325.            The indicator whether the message was successfully decrypted.
  1326.  
  1327.        If an error indication is returned by the privacy module, then
  1328.        the error indication is returned to the calling module.
  1329.  
  1330.    9)  The scopedPDU-MMS is calculated.
  1331.  
  1332.    10) The groupName is retrieved from the usecUserTable
  1333.  
  1334.    11) The miId is retrieved from the usecUserTable
  1335.  
  1336.    12) The securityData is cached, so that a possible response to
  1337.        this message can use the same authentication and privacy
  1338.        secrets.  Information to be saved/cached is as follows:
  1339.  
  1340.           usecUserName,
  1341.           usecUserAuthProto, usecUserAuthKey,
  1342.           usecUserPrivProto, usecUserPrivKey
  1343.  
  1344. -- Editor's note:
  1345.    If we assume SNMPv3, then we could check the reportableFlag and if
  1346.    it is not set, then we do not need to cache any security data
  1347.    because then there is no response possible. Do we want to do that?
  1348. -- End Editor's note.
  1349.  
  1350.    13) The statusCode is set to success and a return is made to the
  1351.  
  1352.  
  1353.  
  1354. Blumenthal/Wijnen         Expires December  1997               [Page 23]
  1355.  
  1356. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1357.  
  1358.  
  1359.        calling module according to this abstract service interface:
  1360.  
  1361.           returnMsg(miId, groupName, cachedSecurityDataReference,
  1362.                     scopedPDUmms, scopedPDU, statusCode)
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.  
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.  
  1394.  
  1395.  
  1396.  
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402.  
  1403.  
  1404.  
  1405.  
  1406.  
  1407.  
  1408.  
  1409.  
  1410.  
  1411.  
  1412.  
  1413. Blumenthal/Wijnen         Expires December  1997               [Page 24]
  1414.  
  1415. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1416.  
  1417.  
  1418. 4.  Discovery
  1419.  
  1420.    This security model requires that a discovery process obtains
  1421.    sufficient information about other SNMP engines in order to
  1422.    communicate with them.  Discovery requires the SNMP manager to
  1423.    learn the engine's snmpEngineID value before communication may
  1424.    proceed.  This may be accomplished by formulating a get-request
  1425.    communication with the LoS set to noAuth/noPriv, the userName set
  1426.    to "public", the snmpEngineID set to all zeros (binary), and the
  1427.    varBindList left empty.  The response to this message will be a
  1428.    report PDU that contains the snmpEngineID within the
  1429.    securityParameters field (and containing the snmpUnknownEngineIDs
  1430.    counter in the varBindList).
  1431.    If authenticated communication is required then the discovery
  1432.    process may invoke the procedure described in Section 2.3 to
  1433.    synchronize the timers.
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.  
  1460.  
  1461.  
  1462.  
  1463.  
  1464.  
  1465.  
  1466.  
  1467.  
  1468.  
  1469.  
  1470.  
  1471.  
  1472. Blumenthal/Wijnen         Expires December  1997               [Page 25]
  1473.  
  1474. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1475.  
  1476.  
  1477. 5.  Definitions
  1478.  
  1479. SNMP-USEC-MIB DEFINITIONS ::= BEGIN
  1480.  
  1481. IMPORTS
  1482.     MODULE-IDENTITY, OBJECT-TYPE, snmpModules  FROM SNMPv2-SMI
  1483.     TEXTUAL-CONVENTION, TestAndIncr,
  1484.     RowStatus, StorageType                     FROM SNMPv2-TC
  1485.     MODULE-COMPLIANCE, OBJECT-GROUP            FROM SNMPv2-CONF,
  1486.     SnmpAdminString, SnmpLoS, SnmpEngineID,
  1487.     SnmpSecurityModel,
  1488.     imfAuthMD5Protocol, imfNoPrivProtocol      FROM IMF-MIB;
  1489.  
  1490. snmpUsecMIB MODULE-IDENTITY
  1491.     LAST-UPDATED "9706180000Z"     -- 18 June 1997, midnight
  1492.     ORGANIZATION "SNMPv3 Working Group"
  1493.     CONTACT-INFO "WG-email:   snmpv3@tis.com
  1494.                   Subscribe:  majordomo@tis.com
  1495.                               In msg body:  subscribe snmpv3
  1496.  
  1497.                   Chair:      Russ Mundy
  1498.                               Trusted Information Systems
  1499.                   postal:     3060 Washington Rd
  1500.                               Glenwood MD 21738
  1501.                   email:      mundy@tis.com
  1502.                   phone:      301-854-6889
  1503.  
  1504.                   Co-editor   Uri Blumenthal
  1505.                               IBM T. J. Watson Research
  1506.                   postal:     30 Saw Mill River Pkwy,
  1507.                               Hawthorne, NY 10532
  1508.                               USA
  1509.                   email:      uri@watson.ibm.com
  1510.                   phone:      +1.914.784.7964
  1511.  
  1512.                   Co-editor:  Bert Wijnen
  1513.                               IBM T. J. Watson Research
  1514.                   postal:     Schagen 33
  1515.                               3461 GL Linschoten
  1516.                               Netherlands
  1517.                   email:      wijnen@vnet.ibm.com
  1518.                   phone:      +31-348-432-794
  1519.                  "
  1520.  
  1521.     DESCRIPTION  "The management information definitions for the
  1522.                   SNMPv3 User-based Security model.
  1523.                  "
  1524.     ::= { snmpModules 99 }  -- to be assigned
  1525.  
  1526. -- Administrative assignments ****************************************
  1527.  
  1528.  
  1529.  
  1530.  
  1531. Blumenthal/Wijnen         Expires December  1997               [Page 26]
  1532.  
  1533. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1534.  
  1535.  
  1536. snmpUsecAdmin           OBJECT IDENTIFIER ::= { snmpUsecMIB 1 }
  1537. snmpUsecMIBObjects      OBJECT IDENTIFIER ::= { snmpUsecMIB 2 }
  1538. snmpUsecMIBConformance  OBJECT IDENTIFIER ::= { snmpUsecMIB 3 }
  1539.  
  1540. -- Textual Conventions ***********************************************
  1541.  
  1542. UserName ::=     TEXTUAL-CONVENTION
  1543.     STATUS       current
  1544.     DESCRIPTION "A string representing the name of a user for use in
  1545.                  accordance with the SNMP User-based Security model.
  1546.                 "
  1547.     SYNTAX       SnmpAdminString (SIZE(1..16))
  1548.  
  1549.  
  1550. -- Editor's note:
  1551. -- A real issue is whether the fact that MD5 is used in the following
  1552. -- TC is OK. It might be better to use 3DES for 3DES and IDEA for IDEA.
  1553. -- End Editor's note
  1554.  
  1555. KeyChange ::=    TEXTUAL-CONVENTION
  1556.     STATUS       current
  1557.     DESCRIPTION
  1558.          "Every definition of an object with this syntax must identify
  1559.           a protocol, P, and a secret key, K.  The object's value is a
  1560.           manager-generated, partially-random value which, when
  1561.           modified, causes the value of the secret key, K, to be
  1562.           modified via a one-way function.
  1563.  
  1564.           The value of an instance of this object is the concatenation
  1565.           of two components: a 'random' component and a 'delta'
  1566.           component.  The lengths of the random and delta components are
  1567.           given by the corresponding value of the protocol, P; if P
  1568.           requires K to be a fixed length, the length of both the random
  1569.           and delta components is that fixed length; if P allows the
  1570.           length of K to be variable up to a particular maximum length,
  1571.           the length of the random component is that maximum length and
  1572.           the length of the delta component is any length less than or
  1573.           equal to that maximum length.  For example,
  1574.           imfAuthMD5Protocol requires K to be a fixed length of 16
  1575.           octets.  Other protocols may define other sizes, as deemed
  1576.           appropriate.
  1577.  
  1578.           When an instance of this object is modified to have a new
  1579.           value by the management protocol, the agent generates a new
  1580.           value of K as follows:
  1581.  
  1582.            - a temporary variable is initialized to the existing value
  1583.              of K;
  1584.            - if the length of the delta component is greater than 16
  1585.              bytes, then:
  1586.               - the random component is appended to the value of the
  1587.  
  1588.  
  1589.  
  1590. Blumenthal/Wijnen         Expires December  1997               [Page 27]
  1591.  
  1592. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1593.  
  1594.  
  1595.                 temporary variable, and the result is input to the MD5
  1596.                 hash algorithm to produce a digest value, and the
  1597.                 temporary variable is set to this digest value;
  1598.               - the value of the temporary variable is XOR-ed with the
  1599.                 first (next) 16-bytes of the delta component to produce
  1600.                 the first (next) 16-bytes of the new value of K.
  1601.               - the above two steps are repeated until the unused
  1602.                 portion of the delta component is 16 bytes or less,
  1603.            - the random component is appended to the value of the
  1604.              temporary variable, and the result is input to the MD5
  1605.              hash algorithm to produce a digest value;
  1606.            - this digest value, truncated if necessary to be the same
  1607.              length as the unused portion of the delta component, is
  1608.              XOR-ed with the unused portion of the delta component to
  1609.              produce the (final portion of the) new value of K.
  1610.  
  1611.              i.e.,
  1612.  
  1613.                 iterations = (lenOfDelta - 1)/16; /* integer division */
  1614.                 temp = keyOld;
  1615.                 for (i = 0; i < iterations; i++) {
  1616.                    temp = MD5 (temp || random);
  1617.                    keyNew[i*16 .. (i*16)+15] =
  1618.                           temp XOR delta[i*16 .. (i*16)+15];
  1619.                 }
  1620.                 temp = MD5 (temp || random);
  1621.                 keyNew[i*16 .. lenOfDelta-1] =
  1622.                        temp XOR delta[i*16 .. lenOfDelta-1];
  1623.  
  1624.           The value of an object with this syntax, whenever it is
  1625.           retrieved by the management protocol, is always the zero-
  1626.           length string."
  1627.     SYNTAX      OCTET STRING
  1628.  
  1629. -- *******************************************************************
  1630.  
  1631. -- The valid users for the User-based Security model ******************
  1632.  
  1633. usecUser         OBJECT IDENTIFIER ::= { snmpUsecMIBObjects 1 }
  1634.  
  1635. usecUserTable    OBJECT-TYPE
  1636.     SYNTAX       SEQUENCE OF UsecUserEntry
  1637.     MAX-ACCESS   not-accessible
  1638.     STATUS       current
  1639.     DESCRIPTION "The table of users configured in the SNMP engine's
  1640.                  Local (security) Configuration Datastore (LCD)."
  1641.     ::= { usecUser 1 }
  1642.  
  1643. usecUserEntry    OBJECT-TYPE
  1644.     SYNTAX       UsecUserEntry
  1645.     MAX-ACCESS   not-accessible
  1646.  
  1647.  
  1648.  
  1649. Blumenthal/Wijnen         Expires December  1997               [Page 28]
  1650.  
  1651. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1652.  
  1653.  
  1654.     STATUS       current
  1655.     DESCRIPTION "A user configured in the SNMP engine's Local
  1656.                  (security) Configuration Datastore (LCD) for
  1657.                  the User-based Security model.
  1658.                 "
  1659.     INDEX       { usecUserEngineID,
  1660.                   IMPLIED usecUserName
  1661.                 }
  1662.     ::= { usecUserTable 1 }
  1663.  
  1664. UsecUserEntry ::= SEQUENCE {
  1665.     usecUserEngineID         SnmpEngineID,
  1666.     usecUserName             UserName,
  1667.     usecUserMiId             SnmpAdminString,
  1668.     usecUserGroupName        SnmpAdminString,
  1669.     usecUserCloneFrom        RowPointer,
  1670.     usecUserAuthProtocol     OBJECT IDENTIFIER,
  1671.     usecUserAuthKeyChange    KeyChange,
  1672. --  usecUserAuthKey          OCTET STRING, not visible
  1673.     usecUserAuthPublic       OCTET STRING,
  1674.     usecUserPrivProtocol     OBJECT IDENTIFIER,
  1675.     usecUserPrivKeyChange    KeyChange,
  1676. --  usecUserPrivKey          OCTET STRING, not visible
  1677.     usecUserPrivPublic       OCTET STRING,
  1678.     usecUserStorageType      StorageType,
  1679.     usecUserStatus           RowStatus
  1680. }
  1681.  
  1682. usecUserEngineID OBJECT-TYPE
  1683.     SYNTAX       SnmpEngineID
  1684.     MAX-ACCESS   not-accessible
  1685.     STATUS       current
  1686.     DESCRIPTION "An SNMP engine's administratively-unique identifier.
  1687.  
  1688.                  In a simple agent, this value is always that agent's
  1689.                  own snmpEngineID value.
  1690.  
  1691.                  This value can also take the value of the snmpEngineID
  1692.                  of a remote SNMP engine with which this user can
  1693.                  communicate.
  1694.                 "
  1695.     ::= { usecUserEntry 1 }
  1696.  
  1697. usecUserName     OBJECT-TYPE
  1698.     SYNTAX       UserName
  1699.     MAX-ACCESS   not-accessible
  1700.     STATUS       current
  1701.     DESCRIPTION "A string representing the name of the user.  This is
  1702.                  the (User-based security) model dependent identity.
  1703.                 "
  1704.     ::= { usecUserEntry 2 }
  1705.  
  1706.  
  1707.  
  1708. Blumenthal/Wijnen         Expires December  1997               [Page 29]
  1709.  
  1710. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1711.  
  1712.  
  1713.  
  1714. usecUserMiId     OBJECT-TYPE
  1715.     SYNTAX       SnmpAdminString
  1716.     MAX-ACCESS   read-only
  1717.     STATUS       current
  1718.     DESCRIPTION "A string representing the (security) model independent
  1719.                  identity for this user.
  1720.  
  1721.                  The default mapping for the User-based Security model
  1722.                  is that the miId is the same as the userName.
  1723.                 "
  1724.     ::= { usecUserEntry 3 }
  1725.  
  1726. usecUserGroupName OBJECT-TYPE
  1727.     SYNTAX       SnmpAdminString
  1728.     MAX-ACCESS   read-write
  1729.     STATUS       current
  1730.     DESCRIPTION "A string representing the group to which the user
  1731.                  belongs.  A group name of zero length indicates
  1732.                  that the user is not [perhaps yet] a member of any
  1733.                  group, possibly because the entry has not yet been
  1734.                  completely configured.  Users which are not a part
  1735.                  of any group are effectively disabled to perform any
  1736.                  SNMP operations.
  1737.                 "
  1738.     DEFVAL      { ''H } -- the empty string
  1739.     ::= { usecUserEntry 4 }
  1740.  
  1741. usecUserCloneFrom OBJECT-TYPE
  1742.     SYNTAX       RowPointer
  1743.     MAX-ACCESS   read-create
  1744.     STATUS       current
  1745.     DESCRIPTION "A pointer to another conceptual row in this
  1746.                  usecUserTable.  The user in this other conceptual row
  1747.                  is called the clone-from user.
  1748.  
  1749.                  When a new user is created (i.e., a new conceptual row
  1750.                  is instantiated in this table), the authentication
  1751.                  parameters of the new user are cloned from its
  1752.                  clone-from user.
  1753.  
  1754.                  The first time an instance of this object is set by a
  1755.                  management operation (either at or after its
  1756.                  instantiation), the cloning process is invoked.
  1757.                  Subsequent writes are successful but invoke no action
  1758.                  to be taken by the agent.
  1759.                  The cloning process fails with an 'inconsistentName'
  1760.                  error if the conceptual row representing the
  1761.                  clone-from user is not in an active state when the
  1762.                  cloning process is invoked.
  1763.  
  1764.  
  1765.  
  1766.  
  1767. Blumenthal/Wijnen         Expires December  1997               [Page 30]
  1768.  
  1769. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1770.  
  1771.  
  1772.                  Cloning also causes the initial values of the secret
  1773.                  authentication key and the secret encryption key of
  1774.                  the new user to be set to the same value as the
  1775.                  corresponding secret of the clone-from user.
  1776.  
  1777.                  When this object is read, the zero length string is
  1778.                  returned.
  1779.                 "
  1780.     ::= { usecUserEntry 5 }
  1781.  
  1782. usecUserAuthProtocol OBJECT-TYPE
  1783.     SYNTAX       OBJECT IDENTIFIER
  1784.     MAX-ACCESS   read-create
  1785.     STATUS       current
  1786.     DESCRIPTION "An indication of whether messages sent on behalf of
  1787.                  this user to/from the SNMP engine identified by
  1788.                  usecUserEngineID, can be authenticated, and if so,
  1789.                  the type of authentication protocol which is used.
  1790.  
  1791.                  An instance of this object is created concurrently
  1792.                  with the creation of any other object instance for
  1793.                  the same user (i.e., as part of the processing of
  1794.                  the set operation which creates the first object
  1795.                  instance in the same conceptual row).  Once created,
  1796.                  the value of an instance of this object can not be
  1797.                  changed.
  1798.                 "
  1799.     DEFVAL      { imfAuthMD5Protocol }
  1800.     ::= { usecUserEntry 6 }
  1801.  
  1802. usecUserAuthKeyChange OBJECT-TYPE
  1803.     SYNTAX       KeyChange  -- typically (SIZE (0..32))
  1804.     MAX-ACCESS   read-create
  1805.     STATUS       current
  1806.     DESCRIPTION "An object, which when modified, causes the secret
  1807.                  authentication key used for messages sent on behalf
  1808.                  of this user to/from the SNMP engine identified by
  1809.                  usecUserEngineID, to be modified via a one-way
  1810.                  function.
  1811.  
  1812.                  The associated protocol is the usecUserAuthProtocol.
  1813.                  The associated secret key is the user's secret
  1814.                  authentication key (usecUserAuthKey).
  1815.  
  1816.                  When creating a new user, it is an 'inconsistentName'
  1817.                  error for a set operation to refer to this object
  1818.                  unless it is previously or concurrently initialized
  1819.                  through a set operation on the corresponding value
  1820.                  of usecUserCloneFrom.
  1821.                 "
  1822.     DEFVAL      { ''H }    -- the empty string
  1823.  
  1824.  
  1825.  
  1826. Blumenthal/Wijnen         Expires December  1997               [Page 31]
  1827.  
  1828. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1829.  
  1830.  
  1831.     ::= { usecUserEntry 7 }
  1832.  
  1833. usecUserAuthPublic    OBJECT-TYPE
  1834.     SYNTAX       OCTET STRING -- for MD5 (SIZE(0..32))
  1835.     MAX-ACCESS   read-create
  1836.     STATUS       current
  1837.     DESCRIPTION "A publicly-readable value which is written as part
  1838.                  of the procedure for changing a user's secret key,
  1839.                  and later read to determine whether the change of
  1840.                  the secrets was effected.
  1841.                 "
  1842.     DEFVAL      { ''H }  -- the empty string
  1843.     ::= { usecUserEntry 8 }
  1844.  
  1845. usecUserPrivProtocol OBJECT-TYPE
  1846.     SYNTAX       OBJECT IDENTIFIER
  1847.     MAX-ACCESS   read-create
  1848.     STATUS       current
  1849.     DESCRIPTION "An indication of whether messages sent on behalf of
  1850.                  this user to/from the SNMP engine identified by
  1851.                  usecUserEngineID, can be protected from disclosure,
  1852.                  and if so, the type of privacy protocol which is used.
  1853.  
  1854.                  An instance of this object is created concurrently
  1855.                  with the creation of any other object instance for
  1856.                  the same user (i.e., as part of the processing of
  1857.                  the set operation which creates the first object
  1858.                  instance in the same conceptual row).  Once created,
  1859.                  the value of an instance of this object can not be
  1860.                  changed.
  1861.                 "
  1862.     DEFVAL      { imfNoPrivProtocol }
  1863.     ::= { usecUserEntry 9 }
  1864.  
  1865. usecUserPrivKeyChange OBJECT-TYPE
  1866.     SYNTAX       KeyChange  -- typically (SIZE (0..32))
  1867.     MAX-ACCESS   read-create
  1868.     STATUS       current
  1869.     DESCRIPTION "An object, which when modified, causes the secret
  1870.                  encryption key used for messages sent on behalf
  1871.                  of this user to/from the SNMP engine identified by
  1872.                  usecUserEngineID, to be modified via a one-way
  1873.                  function.
  1874.  
  1875.                  The associated protocol is the usecUserPrivProtocol.
  1876.                  The associated secret key is the user's secret
  1877.                  encryption key (usecUserPrivKey).
  1878.  
  1879.                  When creating a new user, it is an 'inconsistentName'
  1880.                  error for a set operation to refer to this object
  1881.                  unless it is previously or concurrently initialized
  1882.  
  1883.  
  1884.  
  1885. Blumenthal/Wijnen         Expires December  1997               [Page 32]
  1886.  
  1887. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1888.  
  1889.  
  1890.                  through a set operation on the corresponding value
  1891.                  of usecUserCloneFrom.
  1892.                 "
  1893.     DEFVAL      { ''H }    -- the empty string
  1894.     ::= { usecUserEntry 10 }
  1895.  
  1896. usecUserPrivPublic    OBJECT-TYPE
  1897.     SYNTAX       OCTET STRING -- for DES (SIZE(0..16))
  1898.     MAX-ACCESS   read-create
  1899.     STATUS       current
  1900.     DESCRIPTION "A publicly-readable value which is written as part
  1901.                  of the procedure for changing a user's secret key,
  1902.                  and later read to determine whether the change of
  1903.                  the secrets was effected.
  1904.                 "
  1905.     DEFVAL      { ''H }  -- the empty string
  1906.     ::= { usecUserEntry 11 }
  1907.  
  1908. usecUserStorageType OBJECT-TYPE
  1909.     SYNTAX       StorageType
  1910.     MAX-ACCESS   read-create
  1911.     STATUS       current
  1912.     DESCRIPTION "The storage type for this conceptual row."
  1913.     DEFVAL      { nonVolatile }
  1914.     ::= { usecUserEntry 12 }
  1915.  
  1916. usecUserStatus OBJECT-TYPE
  1917.     SYNTAX       RowStatus
  1918.     MAX-ACCESS   read-create
  1919.     STATUS       current
  1920.     DESCRIPTION "The status of this conceptual row.  Until instances
  1921.                  of all corresponding columns are appropriately
  1922.                  configured, the value of the corresponding instance
  1923.                  of the usecUserStatus column is 'notReady'.
  1924.  
  1925.                  For those columnar objects which permit write-access,
  1926.                  their value in an existing conceptual row can be
  1927.                  changed irrespective of the value of usecUserStatus
  1928.                  for that row.
  1929.                 "
  1930.     ::= { usecUserEntry 13 }
  1931.  
  1932.  
  1933. usecUserSecretSpinLock  OBJECT-TYPE
  1934.     SYNTAX       TestAndIncr
  1935.     MAX-ACCESS   read-write
  1936.     STATUS       current
  1937.     DESCRIPTION "An advisory lock used to allow several cooperating
  1938.                  SNMPv3 engines, all acting in a manager role, to
  1939.                  coordinate their use of facilities to alter secrets
  1940.                  in the usecUserTable.
  1941.  
  1942.  
  1943.  
  1944. Blumenthal/Wijnen         Expires December  1997               [Page 33]
  1945.  
  1946. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  1947.  
  1948.  
  1949.                 "
  1950.     ::= { usecUser 2 }
  1951.  
  1952. --Editor's note
  1953. Is it enough to have just one spin-lock for such a table where
  1954. several secrets can be modified? Can the protocol ensure the
  1955. consistency? Should it?
  1956. --End editor's note
  1957.  
  1958. -- Conformance Information *******************************************
  1959.  
  1960. snmpUsecMIBCompliances
  1961.                  OBJECT IDENTIFIER ::= { snmpUsecMIBConformance 1 }
  1962. snmpUsecMIBGroups
  1963.                  OBJECT IDENTIFIER ::= { snmpUsecMIBConformance 2 }
  1964.  
  1965. -- Compliance statements
  1966.  
  1967. snmpUsecMIBCompliance MODULE-COMPLIANCE
  1968.     STATUS       current
  1969.     DESCRIPTION "The compliance statement for SNMP engines which
  1970.                  implement the SNMP USEC MIB.
  1971.                 "
  1972.  
  1973.     MODULE       -- this module
  1974.         MANDATORY-GROUPS { snmpUsecMIBBasicGroup }
  1975.  
  1976.         OBJECT           usecUserGroupName
  1977.         MIN-ACCESS       read-only
  1978.         DESCRIPTION     "Write access is not required."
  1979.  
  1980.         OBJECT           usecUserAuthProtocol
  1981.         MIN-ACCESS       read-only
  1982.         DESCRIPTION     "Write access is not required."
  1983.  
  1984.         OBJECT           usecUserPrivProtocol
  1985.         MIN-ACCESS       read-only
  1986.         DESCRIPTION     "Write access is not required."
  1987.  
  1988.     ::= { snmpUsecMIBCompliances 1 }
  1989.  
  1990. -- Units of compliance
  1991.  
  1992. snmpUsecMIBBasicGroup OBJECT-GROUP
  1993.     OBJECTS     {
  1994.                   usecUserMiId,
  1995.                   usecUserGroupName,
  1996.                   usecUserCloneFrom,
  1997.                   usecUserAuthProtocol,
  1998.                   usecUserAuthKeyChange,
  1999.                   usecUserAuthPublic,
  2000.  
  2001.  
  2002.  
  2003. Blumenthal/Wijnen         Expires December  1997               [Page 34]
  2004.  
  2005. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2006.  
  2007.  
  2008.                   usecUserPrivProtocol,
  2009.                   usecUserPrivKeyChange,
  2010.                   usecUserPrivPublic,
  2011.                   usecUserStorageType,
  2012.                   usecUserStatus
  2013.                 }
  2014.     STATUS       current
  2015.     DESCRIPTION "A collection of objects providing for configuration
  2016.                  of an SNMP engine which implements the SNMP
  2017.                  User-based Security model.
  2018.                 "
  2019.     ::= { snmpUsecMIBGroups 1 }
  2020.  
  2021. END
  2022.  
  2023.  
  2024.  
  2025.  
  2026.  
  2027.  
  2028.  
  2029.  
  2030.  
  2031.  
  2032.  
  2033.  
  2034.  
  2035.  
  2036.  
  2037.  
  2038.  
  2039.  
  2040.  
  2041.  
  2042.  
  2043.  
  2044.  
  2045.  
  2046.  
  2047.  
  2048.  
  2049.  
  2050.  
  2051.  
  2052.  
  2053.  
  2054.  
  2055.  
  2056.  
  2057.  
  2058.  
  2059.  
  2060.  
  2061.  
  2062. Blumenthal/Wijnen         Expires December  1997               [Page 35]
  2063.  
  2064. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2065.  
  2066.  
  2067. 6.  MD5 Authentication Protocol
  2068.  
  2069.    This section describes the Keyed-MD5 authentication protocol.
  2070.    This protocol is the first authentication protocol defined for
  2071.    the User-based Security model.
  2072.    Over time, other authentication protocols may be defined either
  2073.    as a replacement of this protocol or in addition to this protocol.
  2074.  
  2075. 6.1  Mechanisms
  2076.  
  2077.    - In support of data integrity, a message digest algorithm is
  2078.      required.  A digest is calculated over an appropriate portion
  2079.      of an SNMPv3 message and included as part of the message sent
  2080.      to the recipient.
  2081.  
  2082.    - In support of data origin authentication and data integrity, a
  2083.      secret value is both inserted into, and appended to, the SNMPv3
  2084.      message prior to computing the digest; the inserted value is
  2085.      overwritten prior to transmission, and the appended value is not
  2086.      transmitted.  The secret value is shared by all SNMPv3 engines
  2087.      authorized to originate messages on behalf of the appropriate
  2088.      user.
  2089.  
  2090.    - In order to not expose the shared secrets (keys) at all SNMPv3
  2091.      engines in case one of the engines is compromised, such secrets
  2092.      (keys) are localized for each authoritative SNMPv3 engine, see
  2093.      [Localized-Key].
  2094.  
  2095. 6.1.1.  Digest Authentication Protocol
  2096.  
  2097.    The Digest Authentication Protocol defined in this memo provides for:
  2098.  
  2099.    - verifying the integrity of a received message (i.e., the message
  2100.      received is the message sent).
  2101.  
  2102.      The integrity of the message is protected by computing a digest
  2103.      over an appropriate portion of a message.  The digest is computed
  2104.      by the originator of the message, transmitted with the message, and
  2105.      verified by the recipient of the message.
  2106.  
  2107.    - verifying the user on whose behalf the message was generated.
  2108.  
  2109.      A secret value known only to SNMPv3 engines authorized to generate
  2110.      messages on behalf of a user is both inserted into, and appended
  2111.      to, the message prior to the digest computation.  Thus, the
  2112.      verification of the user is implicit with the verification of the
  2113.      digest.  (Note that the use of two copies of the secret, one near
  2114.      the start and one at the end, is recommended by [KEYED-MD5].)
  2115.  
  2116.    This protocol uses the MD5 [MD5] message digest algorithm.  A 128-bit
  2117.    digest is calculated over the designated portion of an SNMPv3 message
  2118.  
  2119.  
  2120.  
  2121. Blumenthal/Wijnen         Expires December  1997               [Page 36]
  2122.  
  2123. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2124.  
  2125.  
  2126.    and included as part of the message sent to the recipient.  The size
  2127.    of both the digest carried in a message and the private
  2128.    authentication key (the secret) is 16 octets.
  2129.  
  2130. 6.2  Elements of the Digest Authentication Protocol
  2131.  
  2132.    This section contains definitions required to realize the
  2133.    authentication module defined by this memo.
  2134.  
  2135. 6.2.1.  SNMPv3 Users
  2136.  
  2137.    Authentication using this Digest Authentication protocol makes use
  2138.    of a defined set of user identities.  For any SNMPv3 user on whose
  2139.    behalf a message must be authenticated at a particular SNMPv3 engine,
  2140.    that engine must have knowledge of that user.  An SNMPv3 engine that
  2141.    wishes to communicate with another SNMPv3 engine must also have
  2142.    knowledge of a user known to that engine, including knowledge of the
  2143.    applicable attributes of that user.
  2144.  
  2145.    A user and its attributes are defined as follows:
  2146.  
  2147.    <userName>
  2148.      A string representing the name of the user.
  2149.    <authKey>
  2150.      A user's secret key to be used when calculating a digest.
  2151.  
  2152.  
  2153. 6.2.2.  EngineID
  2154.  
  2155.    The engineID value contained in an authenticated message specifies
  2156.    the authoritative SNMPv3 engine for that particular message.
  2157.    (see the definition of engineID in the SNMP Architecture document
  2158.    [SNMP-ARCH]).
  2159.  
  2160.    The user's (private) authentication key is normally different at
  2161.    each authoritative SNMPv3 engine and so the snmpEngineID is used
  2162.    to select the proper key for the authentication process.
  2163.  
  2164. 6.2.3.  SNMPv3 Messages Using this Authentication Protocol
  2165.  
  2166.    Messages using this authentication protocol carry an authParameters
  2167.    field as part of the securityParameters. For this protocol, the
  2168.    authParameters field is the serialized octet string representing
  2169.    the MD5 digest of the wholeMsg.
  2170.  
  2171.    The digest is calculated over the wholeMsg so if a message is
  2172.    authenticated, that also means that all the fields in the message
  2173.    are intact and have not been tampered with.
  2174.  
  2175. 6.2.4  Input and Output of the MD5 Authentication Module
  2176.  
  2177.  
  2178.  
  2179.  
  2180. Blumenthal/Wijnen         Expires December  1997               [Page 37]
  2181.  
  2182. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2183.  
  2184.  
  2185.    This section describes the inputs and outputs that the MD5
  2186.    Authentication module expects and produces when the User-based
  2187.    Security module invokes the MD5 Authentication module for
  2188.    services.
  2189.  
  2190. 6.2.4.1  Input and Output when generating an SNMPv3 Message
  2191.  
  2192.    This MD5 authentication protocol assumes that the selection of the
  2193.    authKey is done by the caller and that the caller passes
  2194.    the secret key to be used. The abstract service interface is:
  2195.  
  2196.           authMsg(authKey, wholeMsg)
  2197.  
  2198.    Where:
  2199.  
  2200.           authKey
  2201.             The secret key to be used by the authentication algorithm.
  2202.           wholeMsg
  2203.             the message to be authenticated.
  2204.  
  2205.    Upon completion the authentication module returns information.
  2206.    The abstract service interface is:
  2207.  
  2208.         returnAuthMsg(wholeMsg, statusCode)
  2209.  
  2210.    Where:
  2211.  
  2212.         wholeMsg
  2213.           Same as in input, but with authParameters properly filled.
  2214.         statusCode
  2215.           The indicator of whether the message was successfully
  2216.           processed or not.
  2217.  
  2218.    Note, that <authParameters> is filled by the authentication module
  2219.    and this field should be already present in the <wholeMsg> before
  2220.    the MAC is generated.
  2221.  
  2222. 6.2.4.2  Input and Output when receiving an SNMPv3 Message
  2223.  
  2224.    This MD5 authentication protocol assumes that the selection of the
  2225.    authKey is done by the caller and that the caller passes
  2226.    the secret key to be used. The abstract service interface is:
  2227.  
  2228.         authIncomingMsg(authKey, authParameters, wholeMsg)
  2229.  
  2230.    Where:
  2231.  
  2232.         authKey
  2233.           The secret key to be used by the authentication algorithm.
  2234.         authParameters
  2235.           the authParameters from the incoming message.
  2236.  
  2237.  
  2238.  
  2239. Blumenthal/Wijnen         Expires December  1997               [Page 38]
  2240.  
  2241. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2242.  
  2243.  
  2244.         wholeMsg
  2245.           the message to be authenticated.
  2246.  
  2247.    Upon completion the authentication module returns information.
  2248.    The abstract service interface is:
  2249.  
  2250.         returnAuthIncomingMsg(wholeMsg, statusCode)
  2251.  
  2252.         wholeMsg
  2253.           Same as in input, data has been authenticated.
  2254.         statusCode
  2255.           The indicator of whether the message was successfully
  2256.           processed or not.
  2257.  
  2258. 6.3  Elements of Procedure
  2259.  
  2260.    This section describes the procedures for the Keyed-MD5
  2261.    authentication protocol.
  2262.  
  2263. 6.3.1  Processing an Outgoing Message
  2264.  
  2265.    This section describes the procedure followed by an SNMPv3 engine
  2266.    whenever it must authenticate an outgoing message using the
  2267.    imfAuthMD5Protocol.
  2268.  
  2269.    1)  The authParameters field is set to the serialization according
  2270.        to the rules in [RFC1906] of an octet string representing the
  2271.        secret (localized) authKey.
  2272.  
  2273.    2)  The secret (localized) authKey is then appended to the end of
  2274.        the wholeMsg.
  2275.  
  2276.    3)  The MD5-Digest is calculated according to [MD5]. Then the
  2277.        authParameters field is replaced with the calculated digest.
  2278.  
  2279.    4)  The wholeMsg (excluding the appended secret key) is then
  2280.        returned to the caller together with a statusCode of success.
  2281.  
  2282. 6.3.2  Processing an Incoming Message
  2283.  
  2284.    This section describes the procedure followed by an SNMPv3 engine
  2285.    whenever it must authenticate an incoming message using the
  2286.    imfAuthMD5Protocol.
  2287.  
  2288.    1)  If the digest received in the authParameters field is not
  2289.        16 octets long, then an error indication (authenticationError)
  2290.        is returned to the calling module.
  2291.  
  2292.    2)  The digest received in the authParameters field is saved.
  2293.  
  2294.    3)  The digest in the authParameters field is replaced by the
  2295.  
  2296.  
  2297.  
  2298. Blumenthal/Wijnen         Expires December  1997               [Page 39]
  2299.  
  2300. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2301.  
  2302.  
  2303.        secret (localized) authKey.
  2304.  
  2305.    4)  The secret (localized) authKey is then appended to the end of
  2306.        the wholeMsg.
  2307.  
  2308.    5)  The MD5-Digest is calculated according to [MD5].
  2309.        The authParameters field is replaced with the digest value
  2310.        that was saved in step 2).
  2311.  
  2312.    6)  Then the newly calculated digest is compared with the digest
  2313.        saved in step 2). If the digests do not match, then an error
  2314.        indication (authenticationError) is returned to the calling
  2315.        module.
  2316.  
  2317.    7)  The wholeMsg (excluding the appended secret key) and a
  2318.        statusCode of success are then returned to the caller.
  2319.  
  2320.  
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331.  
  2332.  
  2333.  
  2334.  
  2335.  
  2336.  
  2337.  
  2338.  
  2339.  
  2340.  
  2341.  
  2342.  
  2343.  
  2344.  
  2345.  
  2346.  
  2347.  
  2348.  
  2349.  
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357. Blumenthal/Wijnen         Expires December  1997               [Page 40]
  2358.  
  2359. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2360.  
  2361.  
  2362. 7.  DES Privacy Protocol
  2363.  
  2364.    This section describes the DES privacy protocol.
  2365.    This protocol is the first privacy protocol defined for the
  2366.    User-based Security model.
  2367.    Over time, other privacy protocols may be defined either
  2368.    as a replacement of this protocol or in addition to this protocol.
  2369.  
  2370.  
  2371. 7.1  Mechanisms
  2372.  
  2373.    - In support of data confidentiality, an encryption algorithm is
  2374.      required.  An appropriate portion of the message is encrypted
  2375.      prior to being transmitted. The User-based Security model
  2376.      specifies that the scopedPDU is the portion of the message
  2377.      that needs to be encrypted.
  2378.  
  2379.    - A secret value is in combination with a time value is used to
  2380.      create the en/decryption key and the initialization vector.
  2381.      The secret value is shared by all SNMPv3 engines authorized to
  2382.      originate messages on behalf of the appropriate user.
  2383.  
  2384.    - In order to not expose the shared secrets (keys) at all SNMPv3
  2385.      engines in case one of the engines is compromised, such secrets
  2386.      (keys) are localized for each authoritative SNMPv3 engine, see
  2387.      [Localized-Key].
  2388.  
  2389. 7.1.1.  Symmetric Encryption Protocol
  2390.  
  2391.    The Symmetric Encryption Protocol defined in this memo provides
  2392.    support for data confidentiality.  The designated portion of an
  2393.    SNMPv3 message is encrypted and included as part of the message
  2394.    sent to the recipient.
  2395.  
  2396.    This memo requires that if data confidentiality is supported by
  2397.    an SNMPv3 engine, this engine must implement at least the Data
  2398.    Encryption Standard (DES) in the Cipher Block Chaining mode of
  2399.    operation.
  2400.  
  2401.    Two organizations have published specifications defining the DES: the
  2402.    National Institute of Standards and Technology (NIST) [DES-NIST] and
  2403.    the American National Standards Institute [DES-ANSI].  There is a
  2404.    companion Modes of Operation specification for each definition
  2405.    (see [DESO-NIST] and [DESO-ANSI], respectively).
  2406.  
  2407.    The NIST has published three additional documents that implementors
  2408.    may find useful.
  2409.  
  2410.    - There is a document with guidelines for implementing and using the
  2411.      DES, including functional specifications for the DES and its modes
  2412.      of operation [DESG-NIST].
  2413.  
  2414.  
  2415.  
  2416. Blumenthal/Wijnen         Expires December  1997               [Page 41]
  2417.  
  2418. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2419.  
  2420.  
  2421.  
  2422.    - There is a specification of a validation test suite for the DES
  2423.      [DEST-NIST].  The suite is designed to test all aspects of the DES
  2424.      and is useful for pinpointing specific problems.
  2425.  
  2426.    - There is a specification of a maintenance test for the DES
  2427.      [DESM-NIST].  The test utilizes a minimal amount of data and
  2428.      processing to test all components of the DES.  It provides a
  2429.      simple yes-or-no indication of correct operation and is useful
  2430.      to run as part of an initialization step, e.g., when a computer
  2431.      re-boots.
  2432.  
  2433. 7.1.1.1  DES key and Initialization Vector.
  2434.  
  2435.    The first 8 bytes of the 16-byte secret (private privacy key) are
  2436.    used as a DES key.
  2437.    Since DES uses only 56 bits, the Least Significant Bit in each
  2438.    byte is disregarded.
  2439.  
  2440.    The Initialization Vector for encryption is obtained using the
  2441.    following procedure.
  2442.  
  2443.    The last 8 bytes of the 16-byte secret (private privacy key)
  2444.    are used as pre-IV.
  2445.  
  2446.    In order to ensure that IV for two different packets encrypted
  2447.    by the same key, are not the same (i.e. IV does not repeat) we
  2448.    need to "salt" the pre-IV with something unique per packet.
  2449.    An 8-byte octet string is used as the "salt". The concatenation
  2450.    of the generating engine's 32-bit snmpEngineBoots and a local
  2451.    32-bit integer that the encryption engine maintains is input to
  2452.    the "salt".  The 32-bit integer is initialized to a random value
  2453.    at boot time.  The 32-bit snmpEngineBoots is converted to the first
  2454.    4 bytes (Most Significant Byte first) of our "salt". The 32-bit
  2455.    integer is then converted to the last 4 bytes (Most Significant
  2456.    Byte first) of our "salt". The resulting "salt" is then XOR-ed
  2457.    with the pre-IV. The 8-byte salt is then put into the privParameters
  2458.    field as an octet-string.  The "salt" integer is incremented by one
  2459.    and wraps when it reaches the maximum value.
  2460.  
  2461.    The "salt" must be placed in the privParameters field to enable the
  2462.    receiving entity to compute the correct IV and to decrypt the
  2463.    message.
  2464.  
  2465.    How exactly the value of the "salt" (and thus of the IV) varies,
  2466.    is an implementation issue, as long as the measures are taken to
  2467.    avoid producing a duplicate IV.
  2468.  
  2469. 7.1.1.2  Data Encryption.
  2470.  
  2471.    The data to be encrypted is treated as sequence of octets. Its
  2472.  
  2473.  
  2474.  
  2475. Blumenthal/Wijnen         Expires December  1997               [Page 42]
  2476.  
  2477. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2478.  
  2479.  
  2480.    length should be an integral multiple of 8 - and if not, the
  2481.    data is padded at the end as necessary. The actual pad value
  2482.    is irrelevant.
  2483.  
  2484.    The data is encrypted in Cipher Block Chaining mode.
  2485.    The plaintext is divided into 64-bit blocks.
  2486.  
  2487.    The plaintext for each block is XOR-ed with the ciphertext
  2488.    of the previous block, the result is encrypted and the output
  2489.    of the encryption is the ciphertext for the block.
  2490.    This procedure is repeated until there are no more plaintext
  2491.    blocks.
  2492.  
  2493.    For the very first block, the Initialization Vector is used
  2494.    instead of the ciphertext of the previous block.
  2495.  
  2496. 7.1.1.3  Data Decryption
  2497.  
  2498.    Before decryption, the encrypted data length is verified.
  2499.    If the length of the octet sequence to be decrypted is not an
  2500.    integral multiple of 8 octets, the processing of the octet sequence
  2501.    is halted and an appropriate exception noted.  When decrypting, the
  2502.    padding is ignored.
  2503.  
  2504.    The first ciphertext block is decrypted, the decryption output is
  2505.    XOR-ed with the Initialization Vector, and the result is the first
  2506.    plaintext block.
  2507.  
  2508.    For each subsequent block, the ciphertext block is decrypted,
  2509.    the decryption output is XOR-ed with the previous ciphertext
  2510.    block and the result is the plaintext block.
  2511.  
  2512. 7.2  Elements of the DES Privacy Protocol
  2513.  
  2514.    This section contains definitions required to realize the privacy
  2515.    module defined by this memo.
  2516.  
  2517. 7.2.1.  SNMPv3 Users
  2518.  
  2519.    Data En/Decryption using this Symmetric Encryption Protocol makes use
  2520.    of a defined set of user identities.  For any SNMPv3 user on whose
  2521.    behalf a message must be en/decrypted at a particular SNMPv3 engine,
  2522.    that engine must have knowledge of that user.  An SNMPv3 engine that
  2523.    wishes to communicate with another SNMPv3 engine must also have
  2524.    knowledge of a user known to that engine, including knowledge of the
  2525.    applicable attributes of that user.
  2526.  
  2527.    A user and its attributes are defined as follows:
  2528.  
  2529.    <userName>
  2530.      An octet string representing the name of the user.
  2531.  
  2532.  
  2533.  
  2534. Blumenthal/Wijnen         Expires December  1997               [Page 43]
  2535.  
  2536. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2537.  
  2538.  
  2539.    <privKey>
  2540.      A user's secret key to be used as input for the DES key and IV.
  2541.  
  2542. 7.2.2.  EngineID
  2543.  
  2544.    The engineID value contained in an authenticated message specifies
  2545.    the authoritative SNMPv3 engine for that particular message.
  2546.    (see the definition of engineID in the SNMP Architecture document
  2547.    [SNMP-ARCH]).
  2548.  
  2549.    The user's (private) privacy key is normally different at
  2550.    each authoritative SNMPv3 engine and so the snmpEngineID is used
  2551.    to select the proper key for the authentication process.
  2552.  
  2553. 7.2.3.  SNMPv3 Messages Using this Privacy Protocol
  2554.  
  2555.    Messages using this privacy protocol carry a privParameters
  2556.    field as part of the securityParameters. For this protocol, the
  2557.    privParameters field is the serialized octet string representing
  2558.    the "salt" that was used to create the IV.
  2559.  
  2560. 7.2.4  Input and Output of the DES Privacy Module
  2561.  
  2562.    This section describes the inputs and outputs that the DES Privacy
  2563.    module expects and produces when the User-based Security module
  2564.    invokes the DES Privacy module for services.
  2565.  
  2566. 7.2.4.1  Input and Output when generating an SNMPv3 Message
  2567.  
  2568.    This DES privacy protocol assumes that the selection of the
  2569.    privKey is done by the caller and that the caller passes
  2570.    the secret key to be used. The abstract service interface is:
  2571.  
  2572.         encryptMsg(cryptKey, scopedPDU)
  2573.  
  2574.    Where:
  2575.  
  2576.         cryptKey
  2577.           The secret key to be used by the encryption algorithm.
  2578.         scopedPDU
  2579.           The data to be encrypted.
  2580.  
  2581.    Upon completion the privacy module returns information.
  2582.    The abstract service interface is:
  2583.  
  2584.         returnEncryptedMsg(encryptedPDU, privParameters, statusCode)
  2585.    Where:
  2586.         encryptedPDU
  2587.           The encrypted scopedPDU (encoded as an octet string).
  2588.         privParameters
  2589.           The privacy parameters (encoded as an octet string) that
  2590.  
  2591.  
  2592.  
  2593. Blumenthal/Wijnen         Expires December  1997               [Page 44]
  2594.  
  2595. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2596.  
  2597.  
  2598.           need to be sent in the outgoing message.
  2599.         statusCode
  2600.           The indicator of whether the PDU was encrypted successfully
  2601.           and if not, it indicates what went wrong.
  2602.  
  2603. 7.2.4.2  Input and Output when receiving an SNMPv3 Message
  2604.  
  2605.    This DES privacy protocol assumes that the selection of the
  2606.    privKey is done by the caller and that the caller passes
  2607.    the secret key to be used. The abstract service interface is:
  2608.  
  2609.          decryptMsg(cryptKey, privParameters, encryptedPDU)
  2610.  
  2611.    Where:
  2612.  
  2613.          cryptKey
  2614.            The secret key to be used by the decryption algorithm.
  2615.          privParameters
  2616.            The "salt" to be used to calculate the IV.
  2617.          encryptedPDU
  2618.            the data to be decrypted
  2619.  
  2620.    Upon completion the privacy module returns information.
  2621.    The abstract service interface is:
  2622.  
  2623.          returnDecryptedMsg(scopedPDU, statusCode)
  2624.  
  2625.    Where:
  2626.  
  2627.          scopedPDU
  2628.            The decrypted scopedPDU.
  2629.          statusCode
  2630.            The indicator whether the message was successfully decrypted.
  2631.  
  2632. 7.3  Elements of Procedure.
  2633.  
  2634.    This section describes the procedures for the DES privacy protocol.
  2635.  
  2636. 7.3.1  Processing an Outgoing Message
  2637.  
  2638.    This section describes the procedure followed by an SNMPv3 engine
  2639.    whenever it must encrypt part of an outgoing message using the
  2640.    imfPrivDESProtocol.
  2641.  
  2642.    1)  The secret (localized) cryptKey are used to construct the DES
  2643.        encryption key, the "salt" and the DES pre-IV (as described in
  2644.        7.1.1.1).
  2645.  
  2646.    2)  The authParameters field is set to the serialization according
  2647.        to the rules in [RFC1906] of an octet string representing the
  2648.        the "salt" string.
  2649.  
  2650.  
  2651.  
  2652. Blumenthal/Wijnen         Expires December  1997               [Page 45]
  2653.  
  2654. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2655.  
  2656.  
  2657.  
  2658.    2)  The scopedPDU is encrypted (as described in 7.1.1.2) and the
  2659.        encrypted data is serialized according to the rules in [RFC1906]
  2660.        as an octet string.
  2661.  
  2662.    3)  The the serialized octet string representing the encrypted
  2663.        scopedPDU together with the privParameters and a statusCode of
  2664.        success is returned to the caller.
  2665.  
  2666. 7.3.2  Processing an Incoming Message
  2667.  
  2668.    This section describes the procedure followed by an SNMPv3 engine
  2669.    whenever it must decrypt part of an incoming message using the
  2670.    imfPrivDESProtocol.
  2671.  
  2672.    1)  If the privParameters field is not an 8-byte octet string,
  2673.        then an error indication (privacyError) is returned to the
  2674.        calling module.
  2675.  
  2676.    2)  The "salt" is extracted from the privParameters field.
  2677.  
  2678.    3)  The secret (localized) cryptKey and the "salt" are then used
  2679.        to construct the DES decryption key and pre-IV
  2680.        (as described in 7.1.1.1).
  2681.  
  2682.    4)  The encryptedPDU is decrypted (as described in 7.1.1.3).
  2683.  
  2684.    5)  If the encryptedPDU cannot be decrypted, then an error
  2685.        indication (privacyError) is returned to the calling module.
  2686.  
  2687.    6)  The decrypted scopedPDU and a statusCode of success are returned
  2688.        to the calling module.
  2689.  
  2690.  
  2691.  
  2692.  
  2693.  
  2694.  
  2695.  
  2696.  
  2697.  
  2698.  
  2699.  
  2700.  
  2701.  
  2702.  
  2703.  
  2704.  
  2705.  
  2706.  
  2707.  
  2708.  
  2709.  
  2710.  
  2711. Blumenthal/Wijnen         Expires December  1997               [Page 46]
  2712.  
  2713. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2714.  
  2715.  
  2716. 8.  Editor's Addresses
  2717.  
  2718.    Co-editor   Uri Blumenthal
  2719.                IBM T. J. Watson Research
  2720.    postal:     30 Saw Mill River Pkwy,
  2721.                Hawthorne, NY 10532
  2722.                USA
  2723.    email:      uri@watson.ibm.com
  2724.    phone:      +1-914-784-7064
  2725.  
  2726.    Co-editor:  Bert Wijnen
  2727.                IBM T. J. Watson Research
  2728.    postal:     Schagen 33
  2729.                3461 GL Linschoten
  2730.                Netherlands
  2731.    email:      wijnen@vnet.ibm.com
  2732.    phone:      +31-348-432-794
  2733.  
  2734. 9.  Acknowledgements
  2735.  
  2736. This document is based on the recommendations of the SNMP Security and
  2737. Administrative Framework Evolution team, comprised of
  2738.  
  2739.     David Harrington (Cabletron Systems Inc.)
  2740.     Jeff Johnson (Cisco)
  2741.     David Levi (SNMP Research Inc.)
  2742.     John Linn (Openvision)
  2743.     Russ Mundy (Trusted Information Systems) chair
  2744.     Shawn Routhier (Epilogue)
  2745.     Glenn Waters (Nortel)
  2746.     Bert Wijnen (IBM T. J. Watson Research)
  2747.  
  2748. Further a lot of "cut and paste" material comes from RFC1910 and from
  2749. earlier draft documents from the SNMPv2u and SNMPv2* series.
  2750.  
  2751. Further more a special thanks is due to the SNMPv3 WG, specifically:
  2752.     ....
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770. Blumenthal/Wijnen         Expires December  1997               [Page 47]
  2771.  
  2772. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2773.  
  2774.  
  2775. 10.  Security Considerations
  2776.  
  2777. 10.1.  Recommended Practices
  2778.  
  2779.    This section describes practices that contribute to the secure,
  2780.    effective operation of the mechanisms defined in this memo.
  2781.  
  2782.    - A management station must discard SNMPv3 responses for which
  2783.      neither the msgID nor the request-id component or the represented
  2784.      management information corresponds to any currently outstanding
  2785.      request.
  2786.  
  2787.      Although it would be typical for a management station to do this
  2788.      as a matter of course, when using these security protocols it is
  2789.      significant due to the possibility of message duplication
  2790.      (malicious or otherwise).
  2791.  
  2792.    - A management station must generate unpredictable msgIDs and
  2793.      request-ids in authenticated messages in order to protect against
  2794.      the possibility of message duplication (malicious or otherwise).
  2795.      For example, start operations with msgID and/or request-id 0 is
  2796.      not a good idea. Initializing them with a pseudorandom number
  2797.      and then incrementing by one would be acceptable.
  2798.  
  2799.    - A management station should perform time synchronization using
  2800.      authenticated messages in order to protect against the possibility
  2801.      of message duplication (malicious or otherwise).
  2802.  
  2803.    - When sending state altering messages to a managed agent, a
  2804.      management station should delay sending successive messages to the
  2805.      managed agent until a positive acknowledgement is received for the
  2806.      previous message or until the previous message expires.
  2807.  
  2808.      No message ordering is imposed by the SNMPv3. Messages may be
  2809.      received in any order relative to their time of generation and
  2810.      each will be processed in the ordered received. Note that when an
  2811.      authenticated message is sent to a managed agent, it will be valid
  2812.      for a period of time of approximately 150 seconds under normal
  2813.      circumstances, and is subject to replay during this period.
  2814.      Indeed, a management station must cope with the loss and
  2815.      re-ordering of messages resulting from anomalies in the network
  2816.      as a matter of course.
  2817.  
  2818.      However, a managed object, snmpSetSerialNo [RFC1907], is
  2819.      specifically defined for use with SNMPv2 set operations in order
  2820.      to provide a mechanism to ensure the processing of SNMPv2 messages
  2821.      occurs in a specific order.
  2822.  
  2823.    - The frequency with which the secrets of an SNMPv3 user should be
  2824.      changed is indirectly related to the frequency of their use.
  2825.  
  2826.  
  2827.  
  2828.  
  2829. Blumenthal/Wijnen         Expires December  1997               [Page 48]
  2830.  
  2831. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2832.  
  2833.  
  2834.      Protecting the secrets from disclosure is critical to the overall
  2835.      security of the protocols. Frequent use of a secret provides a
  2836.      continued source of data that may be useful to a cryptanalyst in
  2837.      exploiting known or perceived weaknesses in an algorithm.
  2838.      Frequent changes to the secret avoid this vulnerability.
  2839.  
  2840.      Changing a secret after each use is generally regarded as the most
  2841.      secure practice, but a significant amount of overhead may be
  2842.      associated with that approach.
  2843.  
  2844.      Note, too, in a local environment the threat of disclosure may be
  2845.      less significant, and as such the changing of secrets may be less
  2846.      frequent.  However, when public data networks are the
  2847.      communication paths, more caution is prudent.
  2848.  
  2849. 10.2  Defining Users
  2850.  
  2851.    The mechanisms defined in this document employ the notion of "users"
  2852.    which map into "groups" and such "groups" have access rights.
  2853.    How "users" are defined is subject to the security policy of the
  2854.    network administration. For example, users could be individuals
  2855.    (e.g., "joe" or "jane"), or a particular role (e.g., "operator" or
  2856.    "administrator"), or a combination (e.g., "joe-operator",
  2857.    "jane-operator" or "joe-admin").  Furthermore, a "user" may be a
  2858.    logical entity, such as a manager station application or set
  2859.    of manager station applications, acting on behalf of an individual
  2860.    or role, or set of individuals, or set of roles, including
  2861.    combinations.
  2862.  
  2863.    Appendix A describes an algorithm for mapping a user "password" to a
  2864.    16 octet value for use as either a user's authentication key or
  2865.    privacy key (or both).  Note however, that using the same password
  2866.    (and therefore the same key) for both authentication and privacy is
  2867.    very poor security practice and should be strongly discouraged.
  2868.    Passwords are often generated, remembered, and input by a human.
  2869.    Human-generated passwords may be less than the 16 octets required
  2870.    by the authentication and privacy protocols, and brute force
  2871.    attacks can be quite easy on a relatively short ASCII character set.
  2872.    Therefore, the algorithm is Appendix A performs a transformation on
  2873.    the password.  If the Appendix A algorithm is used, SNMP
  2874.    implementations (and SNMP configuration applications) must ensure
  2875.    that passwords are at least 8 characters in length.
  2876.  
  2877.    Because the Appendix A algorithm uses such passwords (nearly)
  2878.    directly, it is very important that they not be easily guessed.  It
  2879.    is suggested that they be composed of mixed-case alphanumeric and
  2880.    punctuation characters that don't form words or phrases that might
  2881.    be found in a dictionary.  Longer passwords improve the security of
  2882.    the system.  Users may wish to input multiword phrases to make their
  2883.    password string longer while ensuring that it is memorable.
  2884.  
  2885.  
  2886.  
  2887.  
  2888. Blumenthal/Wijnen         Expires December  1997               [Page 49]
  2889.  
  2890. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2891.  
  2892.  
  2893.    Since it is infeasible for human users to maintain different
  2894.    passwords for every engine, but security requirements strongly
  2895.    discourage having the same key for more than one engine, SNMPv3
  2896.    employs a compromise proposed in [Localized-key].
  2897.    It derives the user keys for the SNMPv3 engines from user's password
  2898.    in such a way that it is practically impossible to either determine
  2899.    the user's password, or user's key for another SNMPv3 engine from
  2900.    any combination of user's keys on SNMPv3 engines.
  2901.  
  2902.    Note however, that if user's password is disclosed, key localization
  2903.    will not help and network security may be compromised in this case.
  2904.  
  2905. 10.3.  Conformance
  2906.  
  2907.    To be termed a "Secure SNMPv3 implementation" based on the User-base
  2908.    Security model, an SNMPv3 implementation:
  2909.  
  2910.    - must implement one or more Authentication Protocol(s). The MD5
  2911.      Authentication Protocol defined in this memo is one such protocol.
  2912.  
  2913.    - must, to the maximum extent possible, prohibit access to the
  2914.      secret(s) of each user about which it maintains information in a
  2915.      Local (security) Configuration Database (LCD) under all
  2916.      circumstances except as required to generate and/or validate
  2917.      SNMPv3 messages with respect to that user.
  2918.  
  2919.    - must implement the SNMP USEC MIB.
  2920.  
  2921.    In addition, an authoritative SNMPv3 engine must provide initial
  2922.    configuration in accordance with Appendix A.1.
  2923.  
  2924.    Implementation of a Privacy Protocol (the Symmetric Encryption
  2925.    Protocol defined in this memo is one such protocol) is optional.
  2926.  
  2927.  
  2928.  
  2929.  
  2930.  
  2931.  
  2932.  
  2933.  
  2934.  
  2935.  
  2936.  
  2937.  
  2938.  
  2939.  
  2940.  
  2941.  
  2942.  
  2943.  
  2944.  
  2945.  
  2946.  
  2947. Blumenthal/Wijnen         Expires December  1997               [Page 50]
  2948.  
  2949. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  2950.  
  2951.  
  2952. 11.  References
  2953.  
  2954. [RFC1902] The SNMPv2 Working Group, Case, J., McCloghrie, K.,
  2955.      Rose, M., and S., Waldbusser, "Structure of Management
  2956.      Information for Version  2 of the Simple Network Management
  2957.      Protocol (SNMPv2)", RFC 1905, January 1996.
  2958.  
  2959. [RFC1905] The SNMPv2 Working Group, Case, J., McCloghrie, K.,
  2960.      Rose, M., and S., Waldbusser, "Protocol Operations for
  2961.      Version 2 of the Simple Network Management Protocol (SNMPv2)",
  2962.      RFC 1905, January 1996.
  2963.  
  2964. [RFC1906] The SNMPv2 Working Group, Case, J., McCloghrie, K.,
  2965.      Rose, M., and S. Waldbusser, "Transport Mappings for
  2966.      Version 2 of the Simple Network Management Protocol (SNMPv2)",
  2967.      RFC 1906, January 1996.
  2968.  
  2969. [RFC1907] The SNMPv2 Working Group, Case, J., McCloghrie, K.,
  2970.      Rose, M., and S. Waldbusser, "Management Information Base for
  2971.      Version 2 of the Simple Network Management Protocol (SNMPv2)",
  2972.      RFC 1907 January 1996.
  2973.  
  2974. [RFC1908] The SNMPv2 Working Group, Case, J., McCloghrie, K.,
  2975.      Rose, M., and S. Waldbusser, "Coexistence between Version 1
  2976.      and Version 2 of the Internet-standard Network Management
  2977.      Framework", RFC 1908, January 1996.
  2978.  
  2979.  
  2980. [SNMP-ARCH] The SNMPv3 Working Group, Harrington, D., Wijnen, B.,
  2981.      "An Architecture for describing Internet Management Frameworks",
  2982.      draft-ietf-snmpv3-next-gen-arch-02.txt, June 1997.
  2983.  
  2984. [SNMPv3-MPC] The SNMPv3 Working Group, Wijnen, B., Harrington, D.,
  2985.      "Message Processing and Control Model for version 3 of the Simple
  2986.      Network Management Protocol (SNMPv3)",
  2987.      draft-ietf-snmpv3-mpc-01.txt, June 1997.
  2988.  
  2989. [SNMPv3-ACM] The SNMPv3 Working Group, Wijnen, B., Harrington, D.,
  2990.      "Access Control Model for Version 3 of the Simple Network
  2991.      Management Protocol (SNMPv3)", draft-ietf-snmpv3-acm-00.txt,
  2992.      June 1997.
  2993.  
  2994. [SNMPv3-USEC] The SNMPv3 Working Group, Blumenthal, U., Wijnen, B.
  2995.      "User-Based Security Model for version 3 of the Simple Network
  2996.      Management Protocol (SNMPv3)",
  2997.      draft-ietf-snmpv3-usec-01.txt, June 1997.
  2998.  
  2999. [Localized-Key] U. Blumenthal, N. C. Hien, B. Wijnen
  3000.      "Key Derivation for Network Management Applications"
  3001.      IEEE Network Magazine, April/May issue, 1997.
  3002.  
  3003.  
  3004.  
  3005.  
  3006. Blumenthal/Wijnen         Expires December  1997               [Page 51]
  3007.  
  3008. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  3009.  
  3010.  
  3011. [KEYED-MD5] Krawczyk, H.,
  3012.      "Keyed-MD5 for Message Authentication",
  3013.      Work in Progress, IBM, June 1995.
  3014.  
  3015. [MD5] Rivest, R.
  3016.      "Message Digest Algorithm MD5"
  3017.      RFC 1321.
  3018.  
  3019. [DES-NIST] Data Encryption Standard, National Institute of Standards
  3020.      and Technology.  Federal Information Processing Standard (FIPS)
  3021.      Publication 46-1.  Supersedes FIPS Publication 46, (January, 1977;
  3022.      reaffirmed January, 1988).
  3023.  
  3024. [DES-ANSI] Data Encryption Algorithm, American National Standards
  3025.      Institute.  ANSI X3.92-1981, (December, 1980).
  3026.  
  3027. [DESO-NIST] DES Modes of Operation, National Institute of Standards and
  3028.      Technology.  Federal Information Processing Standard (FIPS)
  3029.      Publication 81, (December, 1980).
  3030.  
  3031. [DESO-ANSI] Data Encryption Algorithm - Modes of Operation, American
  3032.      National Standards Institute.  ANSI X3.106-1983, (May 1983).
  3033.  
  3034. [DESG-NIST] Guidelines for Implementing and Using the NBS Data
  3035.      Encryption Standard, National Institute of Standards and
  3036.      Technology.  Federal Information Processing Standard (FIPS)
  3037.      Publication 74, (April, 1981).
  3038.  
  3039. [DEST-NIST] Validating the Correctness of Hardware Implementations of
  3040.      the NBS Data Encryption Standard, National Institute of Standards
  3041.      and Technology.  Special Publication 500-20.
  3042.  
  3043. [DESM-NIST] Maintenance Testing for the Data Encryption Standard,
  3044.      National Institute of Standards and Technology.
  3045.      Special Publication 500-61, (August, 1980).
  3046.  
  3047.  
  3048.  
  3049.  
  3050.  
  3051.  
  3052.  
  3053.  
  3054.  
  3055.  
  3056.  
  3057.  
  3058.  
  3059.  
  3060.  
  3061.  
  3062.  
  3063.  
  3064.  
  3065. Blumenthal/Wijnen         Expires December  1997               [Page 52]
  3066.  
  3067. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  3068.  
  3069.  
  3070. APPENDIX A - Installation
  3071.  
  3072. A.1.   Engine Installation Parameters
  3073.  
  3074. During installation, an SNMPv3 engine acting in an authoritative role
  3075. is configured with several parameters.  These include:
  3076.  
  3077. (1) one or more secrets
  3078.  
  3079.     These are the authentication/privacy secrets for the first user
  3080.     to be configured.
  3081.  
  3082.     One way to accomplish this is to have the installer enter a
  3083.     "password" for each required secret. The password is then
  3084.     algorithmically converted into the required secret by:
  3085.  
  3086.     - forming a string of length 1,048,576 octets by repeating the
  3087.       value of the password as often as necessary, truncating
  3088.       accordingly, and using the resulting string as the input to
  3089.       the MD5 algorithm [MD5].  The resulting digest, termed "digest1",
  3090.       is used in the next step.
  3091.  
  3092.     - a second string of length 44 octets is formed by concatenating
  3093.       digest1, the SNMPv3 engine's snmpEngineID value, and digest1.
  3094.       This string is used as input to the MD5 algorithm [MD5].
  3095.  
  3096.       The resulting digest is the required secret (see Appendix A.2).
  3097.  
  3098.     With these configured parameters, the SNMPv3 engine instantiates
  3099.     the following usecUserEntry in the usecUserTable:
  3100.  
  3101.                               no privacy support  privacy support
  3102.                               ------------------  ---------------
  3103.       usecUserEngineID        localEngineID       localEngineID
  3104.       usecUserName            "public"            "public"
  3105.       usecUserMiId            "public"            "public"
  3106.       usecUserGroupName       "public"            "public"
  3107.       usecUserCloseFrom       ZeroDotZero         ZeroDotZero
  3108.       usecUserAuthProtocol    imfAuthMD5Protocol  imfAuthMD5Protocol
  3109.       usecUserAuthKeyChange   ""                  ""
  3110.       usecUserAuthPublic      ""                  ""
  3111.       usecUserPrivProtocol    none                imfPrivDESProtocol
  3112.       usecUserPrivKeyChange   ""                  ""
  3113.       usecUserrivhPublic      ""                  ""
  3114.       usecUserStorageType     permanent           permanent
  3115.       usecUserStatus          active              active
  3116.  
  3117.  
  3118.  
  3119.  
  3120.  
  3121.  
  3122.  
  3123.  
  3124. Blumenthal/Wijnen         Expires December  1997               [Page 53]
  3125.  
  3126. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  3127.  
  3128.  
  3129. A.2.   Password to Key Algorithm
  3130.  
  3131. The following code fragment demonstrates the password to key
  3132. algorithm which can be used when mapping a password to an
  3133. authentication or privacy key. The calls to MD5 are as
  3134. documented in RFC1321 [RFC1321]
  3135.  
  3136. void password_to_key(
  3137.    u_char *password,    /* IN */
  3138.    u_int   passwordlen, /* IN */
  3139.    u_char *engineID,    /* IN  - ptr to 12 octet long snmpEngineID  */
  3140.    u_char *key)         /* OUT - caller's pointer to 16-byte buffer */
  3141. {
  3142.    MD5_CTX     MD;
  3143.    u_char     *cp, password_buf[64];
  3144.    u_long      password_index = 0;
  3145.    u_long      count = 0, i;
  3146.  
  3147.    MD5Init (&MD);   /* initialize MD5 */
  3148.  
  3149.    /**********************************************/
  3150.    /* Use while loop until we've done 1 Megabyte */
  3151.    /**********************************************/
  3152.    while (count < 1048576) {
  3153.       cp = password_buf;
  3154.       for (i = 0; i < 64; i++) {
  3155.           /*************************************************/
  3156.           /* Take the next byte of the password, wrapping  */
  3157.           /* to the beginning of the password as necessary.*/
  3158.           /*************************************************/
  3159.           *cp++ = password[password_index++ % passwordlen];
  3160.       }
  3161.       MDupdate (&MD, password_buf, 64);
  3162.       count += 64;
  3163.    }
  3164.    MD5Final (key, &MD);          /* tell MD5 we're done */
  3165.  
  3166.    /*****************************************************/
  3167.    /* Now localize the key with the engineID and pass   */
  3168.    /* through MD5 to produce final key                  */
  3169.    /*****************************************************/
  3170.    memcpy(password_buf, key, 16);
  3171.    memcpy(password_buf+16, engineID, 12);
  3172.    memcpy(password_buf+28, key, 16);
  3173.  
  3174.    MD5Init(&MD);
  3175.    MDupdate(&MD, password_buf, 44);
  3176.    MD5Final(key, &MD);
  3177.  
  3178.    return;
  3179. }
  3180.  
  3181.  
  3182.  
  3183. Blumenthal/Wijnen         Expires December  1997               [Page 54]
  3184.  
  3185. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  3186.  
  3187.  
  3188.  
  3189. A.3.   Password to Key Sample
  3190.  
  3191.    The following shows a sample output of the password to key algorithm.
  3192.  
  3193.    With a password of "maplesyrup" the output of the password to key
  3194.    algorithm before the key is localized with the engine's engineID is:
  3195.  
  3196.       '9f af 32 83 88 4e 92 83 4e bc 98 47 d8 ed d9 63'H
  3197.  
  3198.    After the intermediate key (shown above) is localized with the
  3199.    snmpEngineID value of:
  3200.  
  3201.       '00 00 00 00 00 00 00 00 00 00 00 02'H
  3202.  
  3203.    the final output of the password to key algorithm is:
  3204.  
  3205.       '52 6f 5e ed 9f cc e2 6f 89 64 c2 93 07 87 d8 2b'H
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.  
  3236.  
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242. Blumenthal/Wijnen         Expires December  1997               [Page 55]
  3243.  
  3244. Draft       User-based Security Model (USEC) for SNMPv3        June 1997
  3245.  
  3246.  
  3247. Table of Contents
  3248.  
  3249. 0.1 Issues                                                             1
  3250. 0.2 Change Log                                                         2
  3251. 1.  Introduction                                                       3
  3252. 1.1.  Threats                                                          3
  3253. 1.2.  Goals and Constraints                                            4
  3254. 1.3.  Security Services                                                5
  3255. 1.4.  Implementation Organization                                      6
  3256. 1.4.1.  Timeliness Module                                              6
  3257. 1.4.2.  Authentication Protocol                                        6
  3258. 1.4.3.  Privacy Protocol                                               7
  3259. 1.5  Protection against Message Replay, Delay and Redirection          7
  3260. 1.5.1   Authoritative SNMP Engine                                      7
  3261. 1.5.2   The following mechanisms are used:                             7
  3262. 2.  Elements of the Model                                             10
  3263. 2.1.  SNMPv3 Users                                                    10
  3264. 2.2.  Replay Protection                                               11
  3265. 2.2.1.  snmpEngineID                                                  11
  3266. 2.2.2.  engineBoots and engineTime                                    11
  3267.    2.3 for (re-)synchronization procedures).  Note, however, that the 12
  3268. 2.2.3.  Time Window                                                   12
  3269. 2.3.  Time Synchronization                                            12
  3270. 2.4.  SNMPv3 Messages Using this Model                                13
  3271. 2.5  Input and Output of the User-based Security Module               14
  3272. 2.5.1 Input and Output when generating an SNMPv3 Message              14
  3273. 2.5.2 Input and Output when receiving an SNMPv3 Message               15
  3274. 3.  Elements of Procedure                                             18
  3275. 3.1.  Processing an Outgoing Message                                  18
  3276. 3.2.  Processing an Incoming Message                                  20
  3277.        2.4, then the snmpInASNParseErrs counter [RFC1907] is          20
  3278. 4.  Discovery                                                         25
  3279. 5.  Definitions                                                       26
  3280. 6.  MD5 Authentication Protocol                                       36
  3281. 6.1  Mechanisms                                                       36
  3282. 6.1.1.  Digest Authentication Protocol                                36
  3283. 6.2  Elements of the Digest Authentication Protocol                   37
  3284. 6.2.1.  SNMPv3 Users                                                  37
  3285. 6.2.2.  EngineID                                                      37
  3286. 6.2.3.  SNMPv3 Messages Using this Authentication Protocol            37
  3287. 6.2.4  Input and Output of the MD5 Authentication Module              37
  3288. 6.2.4.1  Input and Output when generating an SNMPv3 Message           38
  3289. 6.2.4.2  Input and Output when receiving an SNMPv3 Message            38
  3290. 6.3  Elements of Procedure                                            39
  3291. 6.3.1  Processing an Outgoing Message                                 39
  3292. 6.3.2  Processing an Incoming Message                                 39
  3293. 7.  DES Privacy Protocol                                              41
  3294. 7.1  Mechanisms                                                       41
  3295. 7.1.1.  Symmetric Encryption Protocol                                 41
  3296. 7.1.1.1  DES key and Initialization Vector.                           42
  3297. 7.1.1.2  Data Encryption.                                             42
  3298. 7.1.1.3  Data Decryption                                              43
  3299. 7.2  Elements of the DES Privacy Protocol                             43
  3300. 7.2.1.  SNMPv3 Users                                                  43
  3301. 7.2.2.  EngineID                                                      44
  3302. 7.2.3.  SNMPv3 Messages Using this Privacy Protocol                   44
  3303. 7.2.4  Input and Output of the DES Privacy Module                     44
  3304. 7.2.4.1  Input and Output when generating an SNMPv3 Message           44
  3305. 7.2.4.2  Input and Output when receiving an SNMPv3 Message            45
  3306. 7.3  Elements of Procedure.                                           45
  3307. 7.3.1  Processing an Outgoing Message                                 45
  3308.        7.1.1.1).                                                      45
  3309. 7.3.2  Processing an Incoming Message                                 46
  3310. 8.  Editor's Addresses                                                47
  3311. 9.  Acknowledgements                                                  47
  3312. A.1.   Engine Installation Parameters                                 53
  3313. A.2.   Password to Key Algorithm                                      54
  3314. A.3.   Password to Key Sample                                         55
  3315.  
  3316.  
  3317.  
  3318. Blumenthal/Wijnen         Expires December  1997               [Page 56]
  3319.