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

add support for [email protected] hmac-sha2-256-etm@open… #93

Merged
merged 1 commit into from
Jul 4, 2022

Conversation

mpet
Copy link
Contributor

@mpet mpet commented Jun 27, 2022

add support for digests [email protected] [email protected] in trilead-ssh2 original implementation by Kenny Root in sshlib

@kuisathaverat
Copy link
Contributor

kuisathaverat commented Jun 27, 2022

I've rerun the CI again, it seems the changes break a couple of tests

@mpet
Copy link
Contributor Author

mpet commented Jun 28, 2022

I checked this exception:
Caused by: java.io.IOException: mark/reset not supported at java.io.InputStream.reset(InputStream.java:348) at com.trilead.ssh2.crypto.cipher.CipherInputStream.peekPlain(CipherInputStream.java:160) at com.trilead.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:257) at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:706) at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502) at java.lang.Thread.run(Thread.java:750)
So I guess the inputstream directly does not support mark in this case. So I changed to BufferedInputStream that according to javadoc supports it.

"A BufferedInputStream adds functionality to another input stream-namely, the ability to buffer the input and to support the mark and reset methods. When the BufferedInputStream is created, an internal buffer array is created. As bytes from the stream are read or skipped, the internal buffer is refilled as necessary from the contained input stream, many bytes at a time. The mark operation remembers a point in the input stream and the reset operation causes all the bytes read since the most recent mark operation to be reread before new bytes are taken from the contained input stream."

Will add a new commit.

@mpet mpet force-pushed the trilead_ssh2_hmac_sha2_etms branch from f6ae01e to de37a8d Compare June 28, 2022 07:07
@mpet
Copy link
Contributor Author

mpet commented Jun 28, 2022

@kuisathaverat I have now pushed a new commit. Will the test cases start automatically?

@mpet
Copy link
Contributor Author

mpet commented Jun 28, 2022

I found that tests are automatically triggered. Now I can see a different problem.
Caused by: java.io.IOException: Remote sent corrupt MAC. at com.trilead.ssh2.transport.TransportConnection.checkMacMatches(TransportConnection.java:321) at com.trilead.ssh2.transport.TransportConnection.receiveMessage(TransportConnection.java:263) at com.trilead.ssh2.transport.TransportManager.receiveLoop(TransportManager.java:706) at com.trilead.ssh2.transport.TransportManager$1.run(TransportManager.java:502) at java.lang.Thread.run(Thread.java:750)

I will investigate.

@kuisathaverat
Copy link
Contributor

do not forget to add a unit test to validate the new functionality.

@mpet
Copy link
Contributor Author

mpet commented Jun 28, 2022

@kuisathaverat I will try to fix the unit tests failing but I am not sure why it fails currently.

…sh.com in trilead-ssh2 org. impl. Kenny Root
@mpet mpet force-pushed the trilead_ssh2_hmac_sha2_etms branch from de37a8d to 16fc41d Compare June 28, 2022 12:40
@mpet mpet requested a review from a team as a code owner June 28, 2022 12:40
@mpet
Copy link
Contributor Author

mpet commented Jun 28, 2022

@kuisathaverat I have fixed the unit tests so they are not failing anymore.

@kuisathaverat
Copy link
Contributor

kuisathaverat commented Jun 28, 2022

It LGTM, but I want to perform a test using the SSH build Agents plugin that has more e2e tests than the library, give me a couple of days to find some time.

@mpet
Copy link
Contributor Author

mpet commented Jun 28, 2022

@kuisathaverat thx! Greatly appreciated. Just curious what is a "SSN build Agents plugin". Where can I read about it?

@kuisathaverat
Copy link
Contributor

SSH build Agents plugin is one of plugins that uses this library in Jenkins

@mpet
Copy link
Contributor Author

mpet commented Jul 1, 2022

@kuisathaverat any result of the testing?

@mpet
Copy link
Contributor Author

mpet commented Jul 4, 2022

@kuisathaverat friendly reminder :-)

@kuisathaverat kuisathaverat merged commit 546f979 into jenkinsci:main Jul 4, 2022
@mpet mpet deleted the trilead_ssh2_hmac_sha2_etms branch July 5, 2022 05:47
@mpet
Copy link
Contributor Author

mpet commented Jul 5, 2022

@kuisathaverat thanks a great deal for you prompt assistance!

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

Successfully merging this pull request may close these issues.

3 participants