server config FEATURE public API for hashing a password - #639
Merged
Merged
Conversation
Roytak
reviewed
Sep 10, 2026
Split the salt generation and the crypt(3) call out of nc_server_config_add_ssh_user_password() into a static helper and expose nc_server_config_hash_password() on top of it. No behaviour change. The public function takes a whole iana-crypt-hash 'crypt-hash' value and hashes only "$0$<clear-text>", returning NULL for a value that is already a digest. That keeps the "$0$" rule in one place, next to the auth path that relies on it as well, instead of in every caller. Lets a caller get just the digest, without building an ietf-netconf-server subtree around it or duplicating the crypt code and its libcrypt dependency. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
niklas-moser
force-pushed
the
export-password-hashing
branch
from
September 15, 2026 10:04
6f4adf3 to
31659d8
Compare
Roytak
approved these changes
Sep 15, 2026
michalvasko
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Splits the salt generation and the crypt(3) call out of nc_server_config_add_ssh_user_password() into a public nc_server_config_hash_password(). No behaviour change.
Today the logic is only reachable through a function that builds an entire ietf-netconf-server subtree around the result. A caller that wants just the digest has to duplicate the crypt code and take on a libcrypt dependency of its own — which is what CESNET/Netopeer2# would otherwise have to do.
Motivation is: O-RAN WG11 R004, and 3GPP TS 33.117 clause 4.2.3.4.3.1 behind it, don't let a deployment ship clear-text credentials in a datastore, so Netopeer2 has to hash a "$0$" password at commit time