diff options
author | Jakub Jelen <jjelen@redhat.com> | 2018-11-22 15:57:37 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2019-01-09 10:14:56 +0100 |
commit | 8e0c047031d69bdf882f550886e3dd43afd8db05 (patch) | |
tree | 0ffd94b05abc4693c92efe60492fca690bd9dd32 /src/messages.c | |
parent | 8d9026666190eecc55548899461b83a4f6cf45ce (diff) | |
download | libssh-8e0c047031d69bdf882f550886e3dd43afd8db05.tar.gz libssh-8e0c047031d69bdf882f550886e3dd43afd8db05.tar.xz libssh-8e0c047031d69bdf882f550886e3dd43afd8db05.zip |
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>
Diffstat (limited to 'src/messages.c')
-rw-r--r-- | src/messages.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/messages.c b/src/messages.c index 4c83cf0b..9be800bb 100644 --- a/src/messages.c +++ b/src/messages.c @@ -683,13 +683,13 @@ static ssh_buffer ssh_msg_userauth_build_digest(ssh_session session, const char *service, ssh_string algo) { - struct ssh_crypto_struct *crypto = - session->current_crypto ? session->current_crypto : - session->next_crypto; + struct ssh_crypto_struct *crypto = NULL; ssh_buffer buffer; ssh_string str=NULL; int rc; + crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_IN); + buffer = ssh_buffer_new(); if (buffer == NULL) { return NULL; |