teleconsole
teleconsole copied to clipboard
RSA Encrypted keys not recognized
While using the -i option , if the private key is encrypted , teleconsole fails to connect .
Error:
asn1: structure error: tags don't match (16 vs {class:3 tag:1 length:76 isCompound:false}) {optional:false explicit:false application:false defaultValue:<nil> tag:<nil> stringType:0 timeType:0 set:false omitEmpty:false} pkcs1PrivateKey @2
Found this as a solution to a similar problem in another application (Solution)
Do DecryptPEMBlock() like this after pem.Decode() https://golang.org/src/crypto/x509/pem_decrypt_test.go#L15
Also, use IsEncryptedPEMBlock() to determine if decryption is needed.
On a related note to PR #40 , I think it's preferable for the session provider to only use the public key with the -i
switch (which does not need a passphrase). In that case, reading encrypted private keys would be moved to the responsibility of the ssh client on the session requester side, i.e. not within the scope of teleconsole -i ...
anymore