mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-07 10:40:28 +09:00
packet: On failure, do not use uninitialized crypto
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Anderson Toshiyuki Sasaki <ansasaki@redhat.com>
(cherry picked from commit e9e8292370)
This commit is contained in:
committed by
Andreas Schneider
parent
c888d9c690
commit
58c26f4823
@@ -1946,6 +1946,8 @@ ssh_packet_set_newkeys(ssh_session session,
|
||||
session->next_crypto->decryptkey,
|
||||
session->next_crypto->decryptIV);
|
||||
if (rc < 0) {
|
||||
/* On error, make sure it is not used */
|
||||
session->next_crypto->used = 0;
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
@@ -1954,6 +1956,8 @@ ssh_packet_set_newkeys(ssh_session session,
|
||||
session->next_crypto->encryptkey,
|
||||
session->next_crypto->encryptIV);
|
||||
if (rc < 0) {
|
||||
/* On error, make sure it is not used */
|
||||
session->next_crypto->used = 0;
|
||||
return SSH_ERROR;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user