mlab-lattice / lattice

Apache License 2.0
1 stars 3 forks source link

validate ssh key contents #257

Closed kevindrosendahl closed 5 years ago

kevindrosendahl commented 5 years ago

when resolving a system definition, improperly formatted ssh keys simply return a "ssh: no key found" error right now.

this is due to how golang.org/x/crypto/ssh.ParseRawPrivateKey (and from there encoding/pem.Block.Decode) handles values that are not PEM encoded. it simply returns that error if no valid pem encoded value was found in the string. probably want to try decoding ourselves first, and returning a better error