mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-20 02:42:09 +03:00
Fixed incorrect reference to decrypted block
Fixed incorrectly copied memory from p->buf into init instead of from the decrypted buffer block. The only reason this worked was because the crypt() function decrypts the value in-place and overwrites p->buf. I'm working on a fork that no longer does this and exposed this bug.
This commit is contained in:
@@ -420,7 +420,7 @@ int _libssh2_transport_read(LIBSSH2_SESSION * session)
|
||||
}
|
||||
/* save the first 5 bytes of the decrypted package, to be
|
||||
used in the hash calculation later down. */
|
||||
memcpy(p->init, &p->buf[p->readidx], 5);
|
||||
memcpy(p->init, block, 5);
|
||||
} else {
|
||||
/* the data is plain, just copy it verbatim to
|
||||
the working block buffer */
|
||||
|
||||
Reference in New Issue
Block a user