diff --git a/src/packet_crypt.c b/src/packet_crypt.c index 18df9dcb..168fcc72 100644 --- a/src/packet_crypt.c +++ b/src/packet_crypt.c @@ -255,6 +255,10 @@ int ssh_packet_hmac_verify(ssh_session session, } crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_IN); + if (crypto == NULL) { + return SSH_ERROR; + } + ctx = hmac_init(crypto->decryptMAC, hmac_digest_len(type), type); if (ctx == NULL) { return -1;