aboutsummaryrefslogtreecommitdiff
path: root/src/gssapi.c
diff options
context:
space:
mode:
authorJakub Jelen <jjelen@redhat.com>2018-11-22 15:57:37 +0100
committerAndreas Schneider <asn@cryptomilk.org>2019-01-09 10:14:56 +0100
commit8e0c047031d69bdf882f550886e3dd43afd8db05 (patch)
tree0ffd94b05abc4693c92efe60492fca690bd9dd32 /src/gssapi.c
parent8d9026666190eecc55548899461b83a4f6cf45ce (diff)
downloadlibssh-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/gssapi.c')
-rw-r--r--src/gssapi.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gssapi.c b/src/gssapi.c
index d043ab75..f2ca38df 100644
--- a/src/gssapi.c
+++ b/src/gssapi.c
@@ -435,8 +435,10 @@ SSH_PACKET_CALLBACK(ssh_packet_userauth_gssapi_token_server){
#endif /* WITH_SERVER */
-static ssh_buffer ssh_gssapi_build_mic(ssh_session session){
- ssh_buffer mic_buffer;
+static ssh_buffer ssh_gssapi_build_mic(ssh_session session)
+{
+ struct ssh_crypto_struct *crypto = NULL;
+ ssh_buffer mic_buffer = NULL;
int rc;
mic_buffer = ssh_buffer_new();
@@ -445,10 +447,11 @@ static ssh_buffer ssh_gssapi_build_mic(ssh_session session){
return NULL;
}
+ crypto = ssh_packet_get_current_crypto(session, SSH_DIRECTION_BOTH);
rc = ssh_buffer_pack(mic_buffer,
"dPbsss",
- session->current_crypto->digest_len,
- (size_t)session->current_crypto->digest_len, session->current_crypto->session_id,
+ crypto->digest_len,
+ (size_t)crypto->digest_len, crypto->session_id,
SSH2_MSG_USERAUTH_REQUEST,
session->gssapi->user,
"ssh-connection",