From 640521d61716707f8ed5cb0d85e3926909427ae2 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Mon, 22 Aug 2022 17:40:24 +0200 Subject: [PATCH] Package iana-crypt-hash module 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 --- artifacts/pom.xml | 14 ++ features/features-mdsal/pom.xml | 6 + .../pom.xml | 38 ++++++ features/pom.xml | 1 + model/iana/iana-crypt-hash/pom.xml | 38 ++++++ .../main/yang/iana-crypt-hash@2014-08-06.yang | 120 ++++++++++++++++++ model/iana/pom.xml | 3 + 7 files changed, 220 insertions(+) create mode 100644 features/odl-mdsal-model-rfc7317-iana-crypt-hash/pom.xml create mode 100644 model/iana/iana-crypt-hash/pom.xml create mode 100644 model/iana/iana-crypt-hash/src/main/yang/iana-crypt-hash@2014-08-06.yang diff --git a/artifacts/pom.xml b/artifacts/pom.xml index 7e64e1fd8e..eca7edf44d 100644 --- a/artifacts/pom.xml +++ b/artifacts/pom.xml @@ -489,6 +489,13 @@ 11.0.0-SNAPSHOT + + + org.opendaylight.mdsal.binding.model.iana + iana-crypt-hash + 11.0.0-SNAPSHOT + + org.opendaylight.mdsal.binding.model.ietf @@ -798,6 +805,13 @@ features xml + + org.opendaylight.mdsal.model + odl-mdsal-model-rfc7317-iana-crypt-hash + 11.0.0-SNAPSHOT + features + xml + org.opendaylight.mdsal.model odl-mdsal-model-rfc7952 diff --git a/features/features-mdsal/pom.xml b/features/features-mdsal/pom.xml index 26b23b365f..7a258ab31b 100644 --- a/features/features-mdsal/pom.xml +++ b/features/features-mdsal/pom.xml @@ -187,6 +187,12 @@ features xml + + org.opendaylight.mdsal.model + odl-mdsal-model-rfc7317-iana-crypt-hash + features + xml + org.opendaylight.mdsal.model odl-mdsal-model-rfc7952 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 index 0000000000..2ba040d6af --- /dev/null +++ b/features/odl-mdsal-model-rfc7317-iana-crypt-hash/pom.xml @@ -0,0 +1,38 @@ + + + + 4.0.0 + + org.opendaylight.mdsal + feature-parent + 11.0.0-SNAPSHOT + ../feature-parent + + + org.opendaylight.mdsal.model + odl-mdsal-model-rfc7317-iana-crypt-hash + 11.0.0-SNAPSHOT + feature + + OpenDaylight :: MD-SAL :: Model :: RFC7317 iana-crypt-hash + iana-crypt-hash module from RFC7317 + + + + org.opendaylight.mdsal + odl-mdsal-binding-base + features + xml + + + org.opendaylight.mdsal.binding.model.iana + iana-crypt-hash + + + diff --git a/features/pom.xml b/features/pom.xml index 3e246d1e25..9d06029487 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -74,6 +74,7 @@ odl-mdsal-model-rfc6991 odl-mdsal-model-rfc7224 + odl-mdsal-model-rfc7317-iana-crypt-hash odl-mdsal-model-rfc7952 odl-mdsal-model-rfc8040 odl-mdsal-model-rfc8072 diff --git a/model/iana/iana-crypt-hash/pom.xml b/model/iana/iana-crypt-hash/pom.xml new file mode 100644 index 0000000000..00063172fb --- /dev/null +++ b/model/iana/iana-crypt-hash/pom.xml @@ -0,0 +1,38 @@ + + + + + + + org.opendaylight.mdsal + binding-parent + 11.0.0-SNAPSHOT + ../../../binding/binding-parent + + + 4.0.0 + org.opendaylight.mdsal.binding.model.iana + iana-crypt-hash + 11.0.0-SNAPSHOT + bundle + + ${project.artifactId} + iana-crypt-hash@2014-08-06.yang + + + + com.google.guava + guava + + + org.opendaylight.yangtools + yang-common + + + 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 index 0000000000..44c4674f89 --- /dev/null +++ b/model/iana/iana-crypt-hash/src/main/yang/iana-crypt-hash@2014-08-06.yang @@ -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$ + $$$ + $$$$ + + 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 '$$$' or + $$$$ is prepended to the result. This + value is stored in the configuration data store. + If a value starting with '$$', where 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)"; + } + +} diff --git a/model/iana/pom.xml b/model/iana/pom.xml index 10f311bf29..8f6a6ff991 100644 --- a/model/iana/pom.xml +++ b/model/iana/pom.xml @@ -28,6 +28,9 @@ iana-if-type + + iana-crypt-hash + iana-routing-types -- 2.36.6