Package iana-crypt-hash module 07/102207/3
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 22 Aug 2022 15:40:24 +0000 (17:40 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 1 Nov 2022 17:28:35 +0000 (18:28 +0100)
This is a useful registry, make sure we package it. Since this model
comes from RFC7317, which also defines ietf-system.yang, we break our
usual feature packaging for now. This will be revised once we have the
tools to correctly indicate ietf-system being implemented (or not).

JIRA: MDSAL-768
Change-Id: I5c0bb5f97290a91718c90b66ffea4872887443cf
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
artifacts/pom.xml
features/features-mdsal/pom.xml
features/odl-mdsal-model-rfc7317-iana-crypt-hash/pom.xml [new file with mode: 0644]
features/pom.xml
model/iana/iana-crypt-hash/pom.xml [new file with mode: 0644]
model/iana/iana-crypt-hash/src/main/yang/iana-crypt-hash@2014-08-06.yang [new file with mode: 0644]
model/iana/pom.xml

index 7e64e1fd8e60c75559f56585ba34658c06927acc..eca7edf44d5dc513455a5ea8602b92eb774a33eb 100644 (file)
                 <version>11.0.0-SNAPSHOT</version>
             </dependency>
 
+            <!-- RFC7317 -->
+            <dependency>
+                <groupId>org.opendaylight.mdsal.binding.model.iana</groupId>
+                <artifactId>iana-crypt-hash</artifactId>
+                <version>11.0.0-SNAPSHOT</version>
+            </dependency>
+
             <!-- RFC7952 -->
             <dependency>
                 <groupId>org.opendaylight.mdsal.binding.model.ietf</groupId>
                 <classifier>features</classifier>
                 <type>xml</type>
             </dependency>
+            <dependency>
+                <groupId>org.opendaylight.mdsal.model</groupId>
+                <artifactId>odl-mdsal-model-rfc7317-iana-crypt-hash</artifactId>
+                <version>11.0.0-SNAPSHOT</version>
+                <classifier>features</classifier>
+                <type>xml</type>
+            </dependency>
             <dependency>
                 <groupId>org.opendaylight.mdsal.model</groupId>
                 <artifactId>odl-mdsal-model-rfc7952</artifactId>
index 26b23b365ffac59c0224676de7b77b9fa8b72b31..7a258ab31b4e54e61adeda2cb847cc524a2a7b61 100644 (file)
             <classifier>features</classifier>
             <type>xml</type>
         </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.model</groupId>
+            <artifactId>odl-mdsal-model-rfc7317-iana-crypt-hash</artifactId>
+            <classifier>features</classifier>
+            <type>xml</type>
+        </dependency>
         <dependency>
             <groupId>org.opendaylight.mdsal.model</groupId>
             <artifactId>odl-mdsal-model-rfc7952</artifactId>
diff --git a/features/odl-mdsal-model-rfc7317-iana-crypt-hash/pom.xml b/features/odl-mdsal-model-rfc7317-iana-crypt-hash/pom.xml
new file mode 100644 (file)
index 0000000..2ba040d
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright © 2022 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>feature-parent</artifactId>
+        <version>11.0.0-SNAPSHOT</version>
+        <relativePath>../feature-parent</relativePath>
+    </parent>
+
+    <groupId>org.opendaylight.mdsal.model</groupId>
+    <artifactId>odl-mdsal-model-rfc7317-iana-crypt-hash</artifactId>
+    <version>11.0.0-SNAPSHOT</version>
+    <packaging>feature</packaging>
+
+    <name>OpenDaylight :: MD-SAL :: Model :: RFC7317 iana-crypt-hash</name>
+    <description>iana-crypt-hash module from RFC7317</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.opendaylight.mdsal</groupId>
+            <artifactId>odl-mdsal-binding-base</artifactId>
+            <classifier>features</classifier>
+            <type>xml</type>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.mdsal.binding.model.iana</groupId>
+            <artifactId>iana-crypt-hash</artifactId>
+        </dependency>
+    </dependencies>
+</project>
index 3e246d1e253f3ca535dfd4963b38d9872ce6d4e2..9d060294872c2fd3fe2629a3a5f1ed43363fa5d7 100644 (file)
@@ -74,6 +74,7 @@
         <!-- Standards -->
         <module>odl-mdsal-model-rfc6991</module>
         <module>odl-mdsal-model-rfc7224</module>
+        <module>odl-mdsal-model-rfc7317-iana-crypt-hash</module>
         <module>odl-mdsal-model-rfc7952</module>
         <module>odl-mdsal-model-rfc8040</module>
         <module>odl-mdsal-model-rfc8072</module>
diff --git a/model/iana/iana-crypt-hash/pom.xml b/model/iana/iana-crypt-hash/pom.xml
new file mode 100644 (file)
index 0000000..0006317
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- vi: set et smarttab sw=4 tabstop=4: -->
+<!--
+ Copyright (c) 2022 PANTHEON.tech, s.r.o. and others.  All rights reserved.
+
+ This program and the accompanying materials are made available under the
+ terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+    <parent>
+        <groupId>org.opendaylight.mdsal</groupId>
+        <artifactId>binding-parent</artifactId>
+        <version>11.0.0-SNAPSHOT</version>
+        <relativePath>../../../binding/binding-parent</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.opendaylight.mdsal.binding.model.iana</groupId>
+    <artifactId>iana-crypt-hash</artifactId>
+    <version>11.0.0-SNAPSHOT</version>
+    <packaging>bundle</packaging>
+
+    <name>${project.artifactId}</name>
+    <description>iana-crypt-hash@2014-08-06.yang</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>com.google.guava</groupId>
+            <artifactId>guava</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.opendaylight.yangtools</groupId>
+            <artifactId>yang-common</artifactId>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/model/iana/iana-crypt-hash/src/main/yang/iana-crypt-hash@2014-08-06.yang b/model/iana/iana-crypt-hash/src/main/yang/iana-crypt-hash@2014-08-06.yang
new file mode 100644 (file)
index 0000000..44c4674
--- /dev/null
@@ -0,0 +1,120 @@
+module iana-crypt-hash {
+  namespace "urn:ietf:params:xml:ns:yang:iana-crypt-hash";
+  prefix ianach;
+
+  organization "IANA";
+  contact
+    "        Internet Assigned Numbers Authority
+
+     Postal: ICANN
+             12025 Waterfront Drive, Suite 300
+             Los Angeles, CA  90094-2536
+             United States
+
+     Tel:    +1 310 301 5800
+     E-Mail: iana@iana.org>";
+  description
+    "This YANG module defines a type for storing passwords
+     using a hash function and features to indicate which hash
+     functions are supported by an implementation.
+
+     The latest revision of this YANG module can be obtained from
+     the IANA web site.
+
+     Requests for new values should be made to IANA via
+     email (iana@iana.org).
+
+     Copyright (c) 2014 IETF Trust and the persons identified as
+     authors of the code.  All rights reserved.
+
+     Redistribution and use in source and binary forms, with or
+     without modification, is permitted pursuant to, and subject
+     to the license terms contained in, the Simplified BSD License
+     set forth in Section 4.c of the IETF Trust's Legal Provisions
+     Relating to IETF Documents
+     (http://trustee.ietf.org/license-info).
+
+     The initial version of this YANG module is part of RFC 7317;
+     see the RFC itself for full legal notices.";
+
+  revision 2014-08-06 {
+    description
+      "Initial revision.";
+    reference
+      "RFC 7317: A YANG Data Model for System Management";
+  }
+
+  typedef crypt-hash {
+    type string {
+      pattern
+        '$0$.*'
+      + '|$1$[a-zA-Z0-9./]{1,8}$[a-zA-Z0-9./]{22}'
+      + '|$5$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{43}'
+      + '|$6$(rounds=\d+$)?[a-zA-Z0-9./]{1,16}$[a-zA-Z0-9./]{86}';
+    }
+    description
+      "The crypt-hash type is used to store passwords using
+       a hash function.  The algorithms for applying the hash
+       function and encoding the result are implemented in
+       various UNIX systems as the function crypt(3).
+
+       A value of this type matches one of the forms:
+
+         $0$<clear text password>
+         $<id>$<salt>$<password hash>
+         $<id>$<parameter>$<salt>$<password hash>
+
+       The '$0$' prefix signals that the value is clear text.  When
+       such a value is received by the server, a hash value is
+       calculated, and the string '$<id>$<salt>$' or
+       $<id>$<parameter>$<salt>$ is prepended to the result.  This
+       value is stored in the configuration data store.
+       If a value starting with '$<id>$', where <id> is not '0', is
+       received, the server knows that the value already represents a
+       hashed value and stores it 'as is' in the data store.
+
+       When a server needs to verify a password given by a user, it
+       finds the stored password hash string for that user, extracts
+       the salt, and calculates the hash with the salt and given
+       password as input.  If the calculated hash value is the same
+       as the stored value, the password given by the client is
+       accepted.
+
+       This type defines the following hash functions:
+
+         id | hash function | feature
+         ---+---------------+-------------------
+          1 | MD5           | crypt-hash-md5
+          5 | SHA-256       | crypt-hash-sha-256
+          6 | SHA-512       | crypt-hash-sha-512
+
+       The server indicates support for the different hash functions
+       by advertising the corresponding feature.";
+    reference
+      "IEEE Std 1003.1-2008 - crypt() function
+       RFC 1321: The MD5 Message-Digest Algorithm
+       FIPS.180-4.2012: Secure Hash Standard (SHS)";
+  }
+
+  feature crypt-hash-md5 {
+    description
+      "Indicates that the device supports the MD5
+       hash function in 'crypt-hash' values.";
+    reference "RFC 1321: The MD5 Message-Digest Algorithm";
+  }
+
+  feature crypt-hash-sha-256 {
+    description
+      "Indicates that the device supports the SHA-256
+       hash function in 'crypt-hash' values.";
+    reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
+  }
+
+  feature crypt-hash-sha-512 {
+    description
+      "Indicates that the device supports the SHA-512
+       hash function in 'crypt-hash' values.";
+    reference "FIPS.180-4.2012: Secure Hash Standard (SHS)";
+  }
+
+}
index 10f311bf29e99bbb3f0d0929027128bc71d5e023..8f6a6ff9918030d291140413dea0e91a6f77169e 100644 (file)
@@ -28,6 +28,9 @@
         <!-- RFC7224 and updates -->
         <module>iana-if-type</module>
 
+        <!-- RFC7317 and updates -->
+        <module>iana-crypt-hash</module>
+
         <!-- RFC8294 and updates -->
         <module>iana-routing-types</module>