mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-10 10:26:47 +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->decryptkey,
|
||||||
session->next_crypto->decryptIV);
|
session->next_crypto->decryptIV);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
/* On error, make sure it is not used */
|
||||||
|
session->next_crypto->used = 0;
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1954,6 +1956,8 @@ ssh_packet_set_newkeys(ssh_session session,
|
|||||||
session->next_crypto->encryptkey,
|
session->next_crypto->encryptkey,
|
||||||
session->next_crypto->encryptIV);
|
session->next_crypto->encryptIV);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
|
/* On error, make sure it is not used */
|
||||||
|
session->next_crypto->used = 0;
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user