Added Curl_gss_init_sec_context.

This function wraps our calls to gss_init_sec_context so that we
have a unified way to talk to GSSAPI.
This commit is contained in:
Julien Chaffraix
2011-06-10 08:16:06 -07:00
parent 6488e03f44
commit 20485a4885
6 changed files with 151 additions and 53 deletions

View File

@@ -37,6 +37,7 @@
#include <stdlib.h>
#endif
#include "gssapi.h"
#include "urldata.h"
#include "sendf.h"
#include "connect.h"
@@ -183,19 +184,19 @@ CURLcode Curl_SOCKS5_gssapi_negotiate(int sockindex,
/* As long as we need to keep sending some context info, and there's no */
/* errors, keep sending it... */
for(;;) {
gss_major_status = gss_init_sec_context(&gss_minor_status,
GSS_C_NO_CREDENTIAL,
&gss_context, server,
GSS_C_NULL_OID,
GSS_C_MUTUAL_FLAG |
GSS_C_REPLAY_FLAG,
0,
NULL,
gss_token,
NULL,
&gss_send_token,
&gss_ret_flags,
NULL);
gss_major_status = Curl_gss_init_sec_context(&gss_minor_status,
GSS_C_NO_CREDENTIAL,
&gss_context, server,
GSS_C_NULL_OID,
GSS_C_MUTUAL_FLAG |
GSS_C_REPLAY_FLAG,
0,
NULL,
gss_token,
NULL,
&gss_send_token,
&gss_ret_flags,
NULL);
if(gss_token != GSS_C_NO_BUFFER)
gss_release_buffer(&gss_status, &gss_recv_token);