Eugeny / russh

Rust SSH client & server library
https://docs.rs/russh
950 stars 106 forks source link

Incorrect sha2 hash function for ecdh-sha2-nistp{384,521} #285

Closed gleason-m closed 5 months ago

gleason-m commented 5 months ago

282 added support for ecdh-sha2-nistp{256,384,521} key exchange algorithms, but uses sha2::Sha256 to compute the exchange hash for each algorithm. The sha2 hash used should adhere to the spec described in RFC 5656 Section 6.3. ecdh-sha2-nistp384 should be hashed using SHA384 and ecdh-sha2-nistp521 should be hashed using SHA512. Unclear if the same is true for fn compute_keys.

I may not have time to address this for several weeks, so raising an issue in case someone is willing and able to resolve in the meantime.