Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uknown decrypt failure after handshake #1061

Closed
bglasgo opened this issue Sep 3, 2021 · 2 comments
Closed

Uknown decrypt failure after handshake #1061

bglasgo opened this issue Sep 3, 2021 · 2 comments

Comments

@bglasgo
Copy link

bglasgo commented Sep 3, 2021

After working to add the ciphers and algos i needed to complete the handshake process, I run into a decryption error with seemingly no explanation. I can use the sshd command line on the same machine to make this connection without issues. Unfortunately the device doesnt offer any other options for ciphers than 3des-cbc. Anything else I can provide for info please let me know.

Local ident: 'SSH-2.0-ssh2js1.3.0'
Socket connected
Remote ident: 'SSH-2.0-RomSShell_4.31'
Outbound: Sending KEXINIT
Inbound: Handshake in progress
Handshake: (local) KEX method: diffie-hellman-group1-sha1
Handshake: (remote) KEX method: diffie-hellman-group1-sha1
Handshake: KEX algorithm: diffie-hellman-group1-sha1
Handshake: (local) Host key format: ssh-dss
Handshake: (remote) Host key format: ssh-dss
Handshake: Host key format: ssh-dss
Handshake: (local) C->S cipher: 3des-cbc
Handshake: (remote) C->S cipher: 3des-cbc
Handshake: C->S Cipher: 3des-cbc
Handshake: (local) S->C cipher: 3des-cbc
Handshake: (remote) S->C cipher: 3des-cbc
Handshake: S->C cipher: 3des-cbc
Handshake: (local) C->S MAC: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
Handshake: (remote) C->S MAC: hmac-sha1
Handshake: C->S MAC: hmac-sha1
Handshake: (local) S->C MAC: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
Handshake: (remote) S->C MAC: hmac-sha1
Handshake: S->C MAC: hmac-sha1
Handshake: (local) C->S compression: none,zlib@openssh.com,zlib
Handshake: (remote) C->S compression: none
Handshake: C->S compression: none
Handshake: (local) S->C compression: none,zlib@openssh.com,zlib
Handshake: (remote) S->C compression: none
Handshake: S->C compression: none
Outbound: Sending KEXDH_INIT
Received DH Reply
Host accepted by default (no verification)
Host accepted (verified)
Outbound: Sending NEWKEYS
Inbound: NEWKEYS
Verifying signature ...
Verified signature
Handshake completed
Outbound: Sending SERVICE_REQUEST (ssh-userauth)
events.js:377
throw er; // Unhandled 'error' event
^

Error: Unknown decrypt failure
at GenericDecipherBinding.decrypt

Here is my code which is mostly just a copy paste of the example except for the algorithms i provided.

const conn = new Client(); return new Promise((resolve, reject) => { conn.on('ready', () => { conn.exec(cmd, (err, stream) => { if (err) { reject(err) } stream.on('close', (code, signal) => { if (code !== 0) { reject(code) } conn.end() resolve(code) }).stderr.on('data', (data) => { reject(data) }) }) }).connect({ host: '0.0.0.0', port: 22, username: 'xxxxxxxx', password: 'xxxxxxxxxxx', algorithms: { kex: [ "diffie-hellman-group1-sha1" ], serverHostKey: ["ssh-dss"], cipher: ["3des-cbc"] }, debug: (s) => {console.log(s)} }) })

@mscdex mscdex closed this as completed in 56fd3de Sep 3, 2021
@mscdex
Copy link
Owner

mscdex commented Sep 3, 2021

I was able to duplicate the issue and it should be fixed now in the master branch. Please let me know if it works for you as well.

@bglasgo
Copy link
Author

bglasgo commented Sep 3, 2021

Awesome, that cleared up the blockage and I got past user authentication. I wish I could code as fast as you! That looked like a lot of stuff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants