summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Turcotte <jonathanturcotte@outlook.com>2019-09-20 12:06:11 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2020-01-24 09:54:28 -0600
commit5625892b2c0e3767eccda6cb5ad38fabce3647e0 (patch)
treef422974698c69db1807090b0efc32b2dc03f0d83
parent2174aa0ac25e07d55fd758d9d5846e34de0403f2 (diff)
downloadlibgit2-5625892b2c0e3767eccda6cb5ad38fabce3647e0.tar.gz
gssapi: delete half-built security context so auth can continue
-rw-r--r--src/transports/auth_negotiate.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/transports/auth_negotiate.c b/src/transports/auth_negotiate.c
index d06bf746f..e1fa803ed 100644
--- a/src/transports/auth_negotiate.c
+++ b/src/transports/auth_negotiate.c
@@ -128,9 +128,9 @@ static int negotiate_next_token(
input_token.length = input_buf.size;
input_token_ptr = &input_token;
} else if (ctx->gss_context != GSS_C_NO_CONTEXT) {
- git_error_set(GIT_ERROR_NET, "could not restart authentication");
- error = -1;
- goto done;
+ /* If we're given a half-built security context, delete it so auth can continue. */
+ gss_delete_sec_context(&status_minor, &ctx->gss_context, GSS_C_NO_BUFFER);
+ ctx->gss_context = GSS_C_NO_CONTEXT;
}
mech = &negotiate_oid_spnego;