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/api/users.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/api') diff --git a/src/api/users.rs b/src/api/users.rs index d6950af..fc3f6dc 100644 --- a/src/api/users.rs +++ b/src/api/users.rs @@ -171,8 +171,8 @@ pub(crate) async fn put_own_key( Path(id): Path, body: String, ) -> Result { - let key = crate::access::sshsig::PublicKey::parse(body.trim()).map_err(|why| bad(&why))?; - own_key(&state, &user.0, id, Some(key.line()), false).await + let line = crate::access::sshsig::PublicKey::kept_line(body.trim()).map_err(|why| bad(&why))?; + own_key(&state, &user.0, id, Some(line), false).await } /// `DELETE /auth/keys/{id}`. -- cgit v1.3.1