Blame tests/schema/yang/ietf/iana-crypt-hash.yang

Packit Service 311553
module iana-crypt-hash {
Packit Service 311553
  namespace "urn:ietf:params:xml:ns:yang:iana-crypt-hash";
Packit Service 311553
  prefix ianach;
Packit Service 311553
Packit Service 311553
  organization "IANA";
Packit Service 311553
  contact
Packit Service 311553
    "        Internet Assigned Numbers Authority
Packit Service 311553
Packit Service 311553
     Postal: ICANN
Packit Service 311553
             12025 Waterfront Drive, Suite 300
Packit Service 311553
             Los Angeles, CA  90094-2536
Packit Service 311553
             United States
Packit Service 311553
Packit Service 311553
     Tel:    +1 310 301 5800
Packit Service 311553
     E-Mail: iana@iana.org>";
Packit Service 311553
  description
Packit Service 311553
    "This YANG module defines a type for storing passwords
Packit Service 311553
     using a hash function and features to indicate which hash
Packit Service 311553
     functions are supported by an implementation.
Packit Service 311553
Packit Service 311553
     The latest revision of this YANG module can be obtained from
Packit Service 311553
     the IANA web site.
Packit Service 311553
Packit Service 311553
     Requests for new values should be made to IANA via
Packit Service 311553
     email (iana@iana.org).
Packit Service 311553
Packit Service 311553
     Copyright (c) 2014 IETF Trust and the persons identified as
Packit Service 311553
     authors of the code.  All rights reserved.
Packit Service 311553
Packit Service 311553
     Redistribution and use in source and binary forms, with or
Packit Service 311553
     without modification, is permitted pursuant to, and subject
Packit Service 311553
     to the license terms contained in, the Simplified BSD License
Packit Service 311553
     set forth in Section 4.c of the IETF Trust's Legal Provisions
Packit Service 311553
     Relating to IETF Documents
Packit Service 311553
     (http://trustee.ietf.org/license-info).
Packit Service 311553
Packit Service 311553
     The initial version of this YANG module is part of RFC 7317;
Packit Service 311553
     see the RFC itself for full legal notices.";
Packit Service 311553
Packit Service 311553
  revision 2014-08-06 {
Packit Service 311553
    description
Packit Service 311553
      "Initial revision.";
Packit Service 311553
    reference
Packit Service 311553
      "RFC 7317: A YANG Data Model for System Management";
Packit Service 311553
  }
Packit Service 311553
Packit Service 311553
  typedef crypt-hash {
Packit Service 311553
    type string {
Packit Service 311553
      pattern
Packit Service 311553
        '$0$.*'
Packit Service 311553
      + '|$1$[a-zA-Z0-9./]{1,8}$[a-zA-Z0-9./]{22}'
Packit Service 311553
      + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}'
Packit Service 311553
      + '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}';
Packit Service 311553
    }
Packit Service 311553
    description
Packit Service 311553
      "The crypt-hash type is used to store passwords using
Packit Service 311553
       a hash function.  The algorithms for applying the hash
Packit Service 311553
       function and encoding the result are implemented in
Packit Service 311553
       various UNIX systems as the function crypt(3).
Packit Service 311553
Packit Service 311553
       A value of this type matches one of the forms:
Packit Service 311553
Packit Service 311553
         $0$<clear text password>
Packit Service 311553
         $<id>$<salt>$<password hash>
Packit Service 311553
         $<id>$<parameter>$<salt>$<password hash>
Packit Service 311553
Packit Service 311553
       The '$0$' prefix signals that the value is clear text.  When
Packit Service 311553
       such a value is received by the server, a hash value is
Packit Service 311553
       calculated, and the string '$<id>$<salt>$' or
Packit Service 311553
       $<id>$<parameter>$<salt>$ is prepended to the result.  This
Packit Service 311553
       value is stored in the configuration data store.
Packit Service 311553
       If a value starting with '$<id>$', where <id> is not '0', is
Packit Service 311553
       received, the server knows that the value already represents a
Packit Service 311553
       hashed value and stores it 'as is' in the data store.
Packit Service 311553
Packit Service 311553
       When a server needs to verify a password given by a user, it
Packit Service 311553
       finds the stored password hash string for that user, extracts
Packit Service 311553
       the salt, and calculates the hash with the salt and given
Packit Service 311553
       password as input.  If the calculated hash value is the same
Packit Service 311553
       as the stored value, the password given by the client is
Packit Service 311553
       accepted.
Packit Service 311553
Packit Service 311553
       This type defines the following hash functions:
Packit Service 311553
Packit Service 311553
         id | hash function | feature
Packit Service 311553
         ---+---------------+-------------------
Packit Service 311553
          1 | MD5           | crypt-hash-md5
Packit Service 311553
          5 | SHA-256       | crypt-hash-sha-256
Packit Service 311553
          6 | SHA-512       | crypt-hash-sha-512
Packit Service 311553
Packit Service 311553
       The server indicates support for the different hash functions
Packit Service 311553
       by advertising the corresponding feature.";
Packit Service 311553
    reference
Packit Service 311553
      "IEEE Std 1003.1-2008 - crypt() function
Packit Service 311553
       RFC 1321: The MD5 Message-Digest Algorithm
Packit Service 311553
       FIPS.180-4.2012: Secure Hash Standard (SHS)";
Packit Service 311553
  }
Packit Service 311553
Packit Service 311553
  feature crypt-hash-md5 {
Packit Service 311553
    description
Packit Service 311553
      "Indicates that the device supports the MD5
Packit Service 311553
       hash function in 'crypt-hash' values.";
Packit Service 311553
    reference "RFC 1321: The MD5 Message-Digest Algorithm";
Packit Service 311553
  }
Packit Service 311553
Packit Service 311553
  feature crypt-hash-sha-256 {
Packit Service 311553
    description
Packit Service 311553
      "Indicates that the device supports the SHA-256
Packit Service 311553
       hash function in 'crypt-hash' values.";
Packit Service 311553
    reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
Packit Service 311553
  }
Packit Service 311553
Packit Service 311553
Packit Service 311553
Packit Service 311553
Packit Service 311553
Packit Service 311553
Packit Service 311553
Packit Service 311553
Packit Service 311553
  feature crypt-hash-sha-512 {
Packit Service 311553
    description
Packit Service 311553
      "Indicates that the device supports the SHA-512
Packit Service 311553
       hash function in 'crypt-hash' values.";
Packit Service 311553
    reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
Packit Service 311553
  }
Packit Service 311553
Packit Service 311553
}