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

Unknown message digest on node v10.12.0 #10

Closed
RichAyotte opened this issue Oct 11, 2018 · 8 comments
Closed

Unknown message digest on node v10.12.0 #10

RichAyotte opened this issue Oct 11, 2018 · 8 comments

Comments

@RichAyotte
Copy link

RichAyotte commented Oct 11, 2018

The following works fine on node v8.12.0 but fails with an Unknown message digest on v10.12.0

{
  host: 'sftp.my-site.com'
  , username: 'username'
  , password: 'password'
  , compress: true
  , algorithms: {
    kex: ['diffie-hellman-group1-sha1']
    , cipher: ['aes128-cbc']
    , serverHostKey: ['ssh-dss']
}

sftp.fastGet(file, `${targetPath}${file}`)

DEBUG

DEBUG: Parser: pktLen:1020,padLen:4,remainLen:1016
DEBUG: Parser: IN_PACKETDATA
DEBUG: Parser: IN_PACKETDATAAFTER, packet: KEXDH_REPLY
DEBUG: Checking host key format
DEBUG: Checking signature format
DEBUG: Verifying host fingerprint
DEBUG: Host accepted by default (no verification)
internal/crypto/sig.js:98
  this._handle.init(algorithm);
               ^

Error: Unknown message digest
    at new Verify (internal/crypto/sig.js:98:16)
    at Object.createVerify (crypto.js:141:10)
    at onKEXDH_REPLY (/home/rich/Projects/omn/backend/node_modules/ssh2-streams/lib/ssh.js:2876:25)
    at SSH2Stream.<anonymous> (/home/rich/Projects/omn/backend/node_modules/ssh2-streams/lib/ssh.js:215:45)
    at SSH2Stream.emit (events.js:182:13)
    at parse_KEXDH_REPLY (/home/rich/Projects/omn/backend/node_modules/ssh2-streams/lib/ssh.js:4220:8)
    at parse_KEX (/home/rich/Projects/omn/backend/node_modules/ssh2-streams/lib/ssh.js:4182:14)
    at parsePacket (/home/rich/Projects/omn/backend/node_modules/ssh2-streams/lib/ssh.js:4017:12)
    at SSH2Stream._transform (/home/rich/Projects/omn/backend/node_modules/ssh2-streams/lib/ssh.js:669:13)
    at SSH2Stream.Transform._read (_stream_transform.js:190:10)
    at SSH2Stream._read (/home/rich/Projects/omn/backend/node_modules/ssh2-streams/lib/ssh.js:251:15)
    at SSH2Stream.Transform._write (_stream_transform.js:178:12)
    at doWrite (_stream_writable.js:410:12)
    at writeOrBuffer (_stream_writable.js:394:5)
    at SSH2Stream.Writable.write (_stream_writable.js:294:11)
    at Socket.ondata (_stream_readable.js:666:20)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
@RichAyotte
Copy link
Author

This looks more like a https://github.com/mscdex/ssh2-streams issue. I'll post the error there.

@RichAyotte
Copy link
Author

The ssh2 and ssh2-streams dependencies are outdated in this package and are causing this issue.

The problem is fixed in the latest version of ssh2-streams 0.2.1 and ssh2 at 0.6.1.

@sanketbajoria
Copy link
Owner

Thanks a lot @RichAyotte for pointing it out. Let me fork a branch to test it out. if you could test it at your end, then i could publish it to npm.

@RichAyotte
Copy link
Author

@sanketbajoria thanks for creating the issue#10 branch. The octothorp "#" in the branch name is giving me/yarn a hard time though. Something like the following usually works but I'm not sure how to escape the the "#" in the branch name.

yarn add https://github.com/sanketbajoria/ssh2-promise.git#issue#10
I also tried a bunch of combinations like
yarn add https://github.com/sanketbajoria/ssh2-promise.git#issue%2310

Any ideas?

@sanketbajoria
Copy link
Owner

@RichAyotte , my bad. seems like yarn don't support it
yarnpkg/yarn#4881

I will rename the branch and push it again

@sanketbajoria
Copy link
Owner

I have renamed the branch from issue#10 to issue10

@RichAyotte
Copy link
Author

I've confirmed that the issue10 branch fixes the problem. Thank you.

sanketbajoria added a commit that referenced this issue Oct 16, 2018
#10 Unknown message digest on node v10.12.0
@sanketbajoria
Copy link
Owner

@RichAyotte Thanks a lot for confirming it. Merged it and pushed to npm repository

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