1
1

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.
Этот коммит содержится в:
Will Cosgrove 2017-12-11 11:31:57 -08:00 коммит произвёл GitHub
родитель 616fd4d1b3
Коммит a7df51164d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23

Просмотреть файл

@ -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 */