Using OpenSSH_8.9p1 Ubuntu-3ubuntu0.7
on WSL, ssh-keygen
refuses a key it previously generated, outputting error:
do_convert_from_ssh2: parse key: invalid format
Reproduction
$ cd /tmp/some_directory
$ ssh-keygen -f id_rsa -m RFC4716 -N ''
[... nominal output ...]
$ ssh-keygen -i -f id_rsa -m RFC4716
do_convert_from_ssh2: parse key: invalid format
$ ssh-keygen -i -f id_rsa
do_convert_from_ssh2: parse key: invalid format
As this is a test/trashed private key, I can share it with you:
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAABlwAAAAdzc2gtcn
NhAAAAAwEAAQAAAYEA9M/XxwykVVEXmXFTJl7Dbn5lhfnYhY94nDquc8dfuE00AnRMuL6d
OG+bPWf916ku/++eWz/Epb/W7DsbAd0YNx4C2L0Rd/EqGzQr6TCM4fgLkXd2h98wOQ24yJ
D/Wy7fYlp/hAPomrx50cR29TmAG4yopCPOMc1aPUjylMJHPflbm0icEeh7R/rFKA2OSUj9
LD0GCgQb1TLSyQ6BgrustkDMbzF52j4k3g/PSvzmMpoFg4HI61OecS4wxwwANi+kiXC/FS
AUEWhxuHt45B5SwkSGhskD0yCE/RLQhcrqZb4H3dwabDCkbc1bXGIyoE1okDy9PJakG65Z
xSR1QzZqNarr1+lvMPcftwxzOePeTyqMgmoYujXCGv7ehdsyFkDSth0zrcylW9EVuADnSS
DFVcgbdxPj8mVJ0txO7Pn4ksfo/muR8RCI8yHvlM/doZcgq38IhWzh0WpJAJbQPI/RK8ia
w8h+6jGr/EGoNjtApAXXgpwMLiEagj5ut0lWpYiTAAAFiGhq6YVoaumFAAAAB3NzaC1yc2
EAAAGBAPTP18cMpFVRF5lxUyZew25+ZYX52IWPeJw6rnPHX7hNNAJ0TLi+nThvmz1n/dep
Lv/vnls/xKW/1uw7GwHdGDceAti9EXfxKhs0K+kwjOH4C5F3doffMDkNuMiQ/1su32Jaf4
QD6Jq8edHEdvU5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V8iuOMfeLm15SZ/40P5c9XgAnBhyMgE22LynZEUrfvq
90VyubjPX5/8R8goUSn1wuRC4o333QbYguVmKqRh02ZFMI9igAAADBAPjAvzz9RLTWuQMh
Tib0uuH+AsRb8ExOg0xXiFazjmt/9iDi3GnFUbuxzeCntCKIXvGlcwH+KvroekeIHcqnac
054o/6dH21gJX6FxkleBjPOXXYipHSSpqg7GX97gtQDajzyzKR7KFru+3Nxdvc13Xkd+Op
R6WJoeNAnoaVJMtLGPrtJWc/ywrgLbKGA73hKoecQmwlKaspvBVZNyehzg+2o6Pxl1hChb
y+rpgsGpgHKbTLSIQEmA52dUZgGjjS0wAAAMEA+/Gz6hKHXxfJQRERaAlLkKaC3HiXXdp2
Zx10aKDuQuI+TVYBdL7qHDScDY4kHkONEOoO3QN6d7v5umBGpBHyCckxvBhKWpTZTDzCUY
HXLjoWU/EG68Nj+vh3R0Xx8QY7/ccqDYnW/P/ZFz/ByLLbDOBR2Nu25dC/FdAiiEeR9+U2
18gTSBKCX6jYx/SAkbAMzBE8LM7eTw8bXIxP3MXvysuZQMWKxT8ArL4lxX+WS3izcEBAbr
hb486LxiNlPVtBAAAAEnlzY0BMVDBQQVIwMTA5MjkzMA==
-----END OPENSSH PRIVATE KEY-----
(note: lines are correctly separated by singles 0x0a, and the file correctly shows a final 0x0a)
My end goal is to convert this key for use with openssl pkeyutl -decrypt -inkey ${converted_key_file}
. What am I doing wrong?