Skip to content

Commit 5625892

Browse files
jonathanturcotteethomson
authored andcommitted
gssapi: delete half-built security context so auth can continue
1 parent 2174aa0 commit 5625892

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/transports/auth_negotiate.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,9 @@ static int negotiate_next_token(
128128
input_token.length = input_buf.size;
129129
input_token_ptr = &input_token;
130130
} else if (ctx->gss_context != GSS_C_NO_CONTEXT) {
131-
git_error_set(GIT_ERROR_NET, "could not restart authentication");
132-
error = -1;
133-
goto done;
131+
/* If we're given a half-built security context, delete it so auth can continue. */
132+
gss_delete_sec_context(&status_minor, &ctx->gss_context, GSS_C_NO_BUFFER);
133+
ctx->gss_context = GSS_C_NO_CONTEXT;
134134
}
135135

136136
mech = &negotiate_oid_spnego;

0 commit comments

Comments
 (0)