diff options
author | Dirkjan Bussink <d.bussink@gmail.com> | 2019-02-08 19:37:35 +0000 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-02-22 15:30:59 +0100 |
commit | c6608c921118268e233da03435d1d64f0e7449d7 (patch) | |
tree | ecdd0d48a9b5c6d233647f81dd555c7f6f00721e /src/packet.c | |
parent | f055319efe682cc3c2e6d2c1cf00b4fcd5c55ef4 (diff) | |
download | libssh-c6608c921118268e233da03435d1d64f0e7449d7.tar.gz libssh-c6608c921118268e233da03435d1d64f0e7449d7.tar.xz libssh-c6608c921118268e233da03435d1d64f0e7449d7.zip |
Refactor ssh_packet_hmac_verify to allow for direct buffer
This will make it easier to do Encrypt-then-MAC checks as those will be
on the direct encrypted data received before decrypting which means they
are not allocated in an ssh buffer at that point yet.
Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Reviewed-by: Jon Simons <jon@jonsimons.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/packet.c')
-rw-r--r-- | src/packet.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/packet.c b/src/packet.c index 1181ca7d..d0c5d60b 100644 --- a/src/packet.c +++ b/src/packet.c @@ -1186,7 +1186,8 @@ int ssh_packet_socket_callback(const void *data, size_t receivedlen, void *user) mac = packet_second_block + packet_remaining; rc = ssh_packet_hmac_verify(session, - session->in_buffer, + ssh_buffer_get(session->in_buffer), + ssh_buffer_get_len(session->in_buffer), mac, crypto->in_hmac); if (rc < 0) { |