Skip to content

Commit 745466f

Browse files
tgauthCopilot
andauthored
[ssh-keygen] fix fido2 key filename translation on Windows (#826)
* replace colon in filename with underscore * Update ssh-keygen.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent f8cc7e7 commit 745466f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ssh-keygen.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3210,6 +3210,12 @@ sk_suffix(const char *application, const uint8_t *user, size_t userlen)
32103210
else
32113211
ret = xstrdup(application);
32123212

3213+
#ifdef WINDOWS
3214+
/* replace any additional colons with underscores so filename is valid */
3215+
while ((cp = strchr(ret, ':')) != NULL)
3216+
*cp = '_';
3217+
#endif
3218+
32133219
/* Count trailing zeros in user */
32143220
for (i = 0; i < userlen; i++) {
32153221
if (user[userlen - i - 1] != 0)

0 commit comments

Comments
 (0)