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>
This commit is contained in:
Dirkjan Bussink
2019-02-08 19:37:35 +00:00
committed by Andreas Schneider
parent f055319efe
commit c6608c9211
3 changed files with 13 additions and 10 deletions

View File

@@ -81,7 +81,7 @@ int ssh_packet_decrypt(ssh_session session, uint8_t *destination, uint8_t *sourc
unsigned char *ssh_packet_encrypt(ssh_session session,
void *packet,
unsigned int len);
int ssh_packet_hmac_verify(ssh_session session,ssh_buffer buffer,
int ssh_packet_hmac_verify(ssh_session session, const void *data, size_t len,
unsigned char *mac, enum ssh_hmac_e type);
int ssh_packet_set_newkeys(ssh_session session,
enum ssh_crypto_direction_e direction);