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

hmac-sha2-512 - Corrupted MAC on input with OpenSSH #8258

Closed
twisted-trac opened this issue Mar 28, 2016 · 5 comments
Closed

hmac-sha2-512 - Corrupted MAC on input with OpenSSH #8258

twisted-trac opened this issue Mar 28, 2016 · 5 comments

Comments

@twisted-trac
Copy link

adiroiban's avatar @adiroiban reported
Trac ID trac#8258
Type defect
Created 2016-03-28 01:20:40Z

I have

$ ssh -V
OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.6, OpenSSL 1.0.1f 6 Jan 2014

Against the ./docs/conch/examples/sshsimpleserver.py example from trunk I run

$ sftp -P 5022 -vv -oKexAlgorithms=diffie-hellman-group14-sha1 -oMACs=hmac-sha2-512 user@localhost

debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
Corrupted MAC on input.
Disconnecting: Packet corrupt
Couldn't read packet: Connection reset by peer

Searchable metadata
trac-id__8258 8258
type__defect defect
reporter__adiroiban adiroiban
priority__normal normal
milestone__None None
branch__ 
branch_author__ 
status__closed closed
resolution__fixed fixed
component__conch conch
keywords__None None
time__1459128040926555 1459128040926555
changetime__1563643964847258 1563643964847258
version__None None
owner__hawkowl hawkowl
cc__z3p cc__twm
@twisted-trac
Copy link
Author

adiroiban's avatar @adiroiban commented

I have tried with paramiko 1.16.0 and I got the same issue.

The initial key exchange part went fine, but it fails once I try to request a service.

@twisted-trac
Copy link
Author

ryban's avatar @ryban set owner to @ryban
@ryban set status to assigned

I've confirmed that adding more rounds to the hasher as described in the email thread (https://twistedmatrix.com/pipermail/twisted-python/2017-March/031336.html) and RFC4253 fixes the issue. Adding more bytes to the generated output won't affect existing algorithms since they consume as many bytes as they need from the beginning of the digest.

@twisted-trac
Copy link
Author

ryban's avatar @ryban commented

PR: #1163

@twisted-trac
Copy link
Author

hawkowl's avatar @hawkowl set owner to @hawkowl
@hawkowl set status to new

LGTM!

@twisted-trac
Copy link
Author

Ryan Van Gilder's avatar Ryan Van Gilder set status to closed

In changeset 5b203b2

#!CommitTicketReference repository="" revision="5b203b267f9869f2bd6e3ed17dcdaafa1fa227d3"
Merge ryban:8258-ryban-hmac-sha2-512-fix: Fix SSH not generating correct keys when using hmac-sha2-512 with SHA1 based KEX algorithms

Author: ryban, jamohamm
Reviewer: hawkowl
Fixes: ticket:8258

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

No branches or pull requests

2 participants