From c2e566599aed088973b5a5be2bb04ee69cee5c7a Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 9 Nov 2026 02:49:25 +0000 Subject: access: keep an SSH key's comment A key's line was stored as the key alone (`ssh-ed25519 `), whatever comment it came with, both from `PUT /auth/keys/` and from `--bootstrap-keys`. Now its comment is kept after it (`PublicKey::kept_line`), the spaces between its words made one. The comment checks nothing: every use of a key parses the line, and the parse reads the key alone. --- src/access/registry.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/access/registry.rs') diff --git a/src/access/registry.rs b/src/access/registry.rs index 4ee51ff..01e6ba9 100644 --- a/src/access/registry.rs +++ b/src/access/registry.rs @@ -206,7 +206,7 @@ pub(crate) fn first_users( let keys = users .get_mut(name) .ok_or_else(|| format!("bootstrap-keys: {name:?} isn't among bootstrap-users"))?; - let key = super::sshsig::PublicKey::parse(line) + let kept = super::sshsig::PublicKey::kept_line(line) .map_err(|why| format!("bootstrap-keys: {name}'s key: {why}"))?; let comment = line .split_whitespace() @@ -219,7 +219,7 @@ pub(crate) fn first_users( .find(|id| !keys.contains_key(id)) .expect("a free name"), }; - keys.insert(id, key.line()); + keys.insert(id, kept); } Ok(users) } -- cgit v1.3.1