PowerShell / Win32-OpenSSH

Win32 port of OpenSSH
7.36k stars 757 forks source link

unexpected "key enrollment failed: invalid format" #2231

Open HPicatto opened 4 months ago

HPicatto commented 4 months ago

Prerequisites

Steps to reproduce

update open-ssh to last version on windows uisng: Start-Process -NoNewWindow msiexec.exe -ArgumentList "/i <full_path_to>\OpenSSH-Win64-v9.4.0.msi ADDLOCAL=Client ADD_PATH=1" -Wait restart powershell ssh-keygen -t ed25519-sk -f $env:USERPROFILE\.ssh\id_ed25519_sk

Expected behavior

key should be generated after requesting to touch the yubikey

Actual behavior

Generating public/private ed25519-sk key pair.
You may need to touch your authenticator to authorize key generation.
Key enrollment failed: invalid format

this prompt is received without even requesting to touch the key


### Error details

_No response_

### Environment data

```PowerShell
Name                           Value
----                           -----
PSVersion                      5.1.22621.2506
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22621.2506
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Version

OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2

Visuals

image

poupryc commented 4 months ago

While generation worked on my side, ssh-keygen -K returned Unable to load resident keys: invalid format too. image

JuliansLab commented 2 months ago

Same for me!

Fedora40, OpenSSH_9.6p1, OpenSSL 3.2.1 30 Jan 2024, libfido2-1.14.0-4.fc40.x86_64 Yubico 5NFC 5.27

master-hax commented 2 months ago

FYI ssh-keygen -K needs to be run as an administrator on Windows, unlike ssh-keygen -t

it is unfortunate that the error message is a vague "invalid format"