From f458055e9ce09a1c9b74403156a62fed1a8fbc76 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sun, 21 Jul 2013 10:58:30 +0200 Subject: [PATCH] gssapi: Cleanup ssh_gssapi_set_creds(). --- src/gssapi.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/gssapi.c b/src/gssapi.c index 32dd8975..c2b642a5 100644 --- a/src/gssapi.c +++ b/src/gssapi.c @@ -530,16 +530,23 @@ ssh_gssapi_creds ssh_gssapi_get_creds(ssh_session session){ return (ssh_gssapi_creds)session->gssapi->client_creds; } -/** @brief Set the forwadable ticket to be given to the server for authentication. +/** + * @brief Set the forwadable ticket to be given to the server for authentication. + * * @param[in] creds gssapi credentials handle. */ -void ssh_gssapi_set_creds(ssh_session session, const ssh_gssapi_creds creds){ - if (!session) +void ssh_gssapi_set_creds(ssh_session session, const ssh_gssapi_creds creds) +{ + if (session == NULL) { return; - if(!session->gssapi) + } + if (session->gssapi == NULL) { ssh_gssapi_init(session); - if(!session->gssapi) - return; + if (session->gssapi == NULL) { + return; + } + } + session->gssapi->client.client_deleg_creds = (gss_cred_id_t)creds; }