diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2018-06-28 17:52:58 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2018-06-29 14:41:14 +0200 |
commit | 206f3ff895d3d822ac4f23426136537129f9f062 (patch) | |
tree | 59728e18437ec9308d14a50082ef831b5b158612 /src/packet_crypt.c | |
parent | 81b4320318966e83678641a06717c301b071971b (diff) | |
download | libssh-206f3ff895d3d822ac4f23426136537129f9f062.tar.gz libssh-206f3ff895d3d822ac4f23426136537129f9f062.tar.xz libssh-206f3ff895d3d822ac4f23426136537129f9f062.zip |
Rest in Peace SSHv1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src/packet_crypt.c')
-rw-r--r-- | src/packet_crypt.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/packet_crypt.c b/src/packet_crypt.c index b2f075c4..7306e4b3 100644 --- a/src/packet_crypt.c +++ b/src/packet_crypt.c @@ -151,7 +151,6 @@ unsigned char *ssh_packet_encrypt(ssh_session session, void *data, uint32_t len) crypto->aead_encrypt(crypto, data, out, len, session->current_crypto->hmacbuf, session->send_seq); } else { - if (session->version == 2) { ctx = hmac_init(session->current_crypto->encryptMAC, hmac_digest_len(type), type); if (ctx == NULL) { SAFE_FREE(out); @@ -168,18 +167,13 @@ unsigned char *ssh_packet_encrypt(ssh_session session, void *data, uint32_t len) } ssh_print_hexa("Packet hmac", session->current_crypto->hmacbuf, hmac_digest_len(type)); #endif - } - crypto->encrypt(crypto, data, out, len); + crypto->encrypt(crypto, data, out, len); } memcpy(data, out, len); explicit_bzero(out, len); SAFE_FREE(out); - if (session->version == 2) { - return session->current_crypto->hmacbuf; - } - - return NULL; + return session->current_crypto->hmacbuf; } /** |