1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +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:
Jakub Jelen
2018-11-22 15:57:37 +01:00
committed by Andreas Schneider
parent 8d90266661
commit 8e0c047031
11 changed files with 150 additions and 92 deletions

View File

@@ -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;