mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-12 15:41:16 +03:00
packet: Introduce a new function to access crypto
And remove most of the direct access to the structure throughout the code Signed-off-by: Jakub Jelen <jjelen@redhat.com> Reviewed-by: Daiki Ueno <dueno@redhat.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
committed by
Andreas Schneider
parent
8d90266661
commit
8e0c047031
11
src/server.c
11
src/server.c
@@ -1048,6 +1048,7 @@ int ssh_message_auth_interactive_request(ssh_message msg, const char *name,
|
||||
|
||||
int ssh_auth_reply_success(ssh_session session, int partial)
|
||||
{
|
||||
struct ssh_crypto_struct *crypto = NULL;
|
||||
int r;
|
||||
|
||||
if (session == NULL) {
|
||||
@@ -1068,14 +1069,16 @@ int ssh_auth_reply_success(ssh_session session, int partial)
|
||||
|
||||
r = ssh_packet_send(session);
|
||||
|
||||
if (session->current_crypto && session->current_crypto->delayed_compress_out) {
|
||||
crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_OUT);
|
||||
if (crypto != NULL && crypto->delayed_compress_out) {
|
||||
SSH_LOG(SSH_LOG_PROTOCOL, "Enabling delayed compression OUT");
|
||||
session->current_crypto->do_compress_out = 1;
|
||||
crypto->do_compress_out = 1;
|
||||
}
|
||||
|
||||
if (session->current_crypto && session->current_crypto->delayed_compress_in) {
|
||||
crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_IN);
|
||||
if (crypto != NULL && crypto->delayed_compress_in) {
|
||||
SSH_LOG(SSH_LOG_PROTOCOL, "Enabling delayed compression IN");
|
||||
session->current_crypto->do_compress_in = 1;
|
||||
crypto->do_compress_in = 1;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user