diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-12-02 22:21:58 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-12-02 22:27:02 +0000 |
commit | 2b604eada534bc4aca4d4d24fc8847b61d399461 (patch) | |
tree | 21c51dc151a4ade91b52834e4f40e53908206757 /lib/http_negotiate.c | |
parent | 018b9d421a59cd9d45c33613440ff3e8f578bf0a (diff) | |
download | curl-2b604eada534bc4aca4d4d24fc8847b61d399461.tar.gz |
sasl_gssapi: Made log_gss_error() a common GSS-API function
Made log_gss_error() a common function so that it can be used in both
the http_negotiate code as well as the curl_sasl_gssapi code.
Diffstat (limited to 'lib/http_negotiate.c')
-rw-r--r-- | lib/http_negotiate.c | 33 |
1 files changed, 2 insertions, 31 deletions
diff --git a/lib/http_negotiate.c b/lib/http_negotiate.c index 8d9ccd28d..de009a49f 100644 --- a/lib/http_negotiate.c +++ b/lib/http_negotiate.c @@ -71,36 +71,6 @@ get_gss_name(struct connectdata *conn, bool proxy, gss_name_t *server) return GSS_ERROR(major_status) ? -1 : 0; } -static void -log_gss_error(struct connectdata *conn, OM_uint32 error_status, - const char *prefix) -{ - OM_uint32 maj_stat, min_stat; - OM_uint32 msg_ctx = 0; - gss_buffer_desc status_string; - char buf[1024]; - size_t len; - - snprintf(buf, sizeof(buf), "%s", prefix); - len = strlen(buf); - do { - maj_stat = gss_display_status(&min_stat, - error_status, - GSS_C_MECH_CODE, - GSS_C_NO_OID, - &msg_ctx, - &status_string); - if(sizeof(buf) > len + status_string.length + 1) { - snprintf(buf + len, sizeof(buf) - len, - ": %s", (char*) status_string.value); - len += status_string.length; - } - gss_release_buffer(&min_stat, &status_string); - } while(!GSS_ERROR(maj_stat) && msg_ctx != 0); - - infof(conn->data, "%s\n", buf); -} - /* returning zero (0) means success, everything else is treated as "failure" with no care exactly what the failure was */ int Curl_input_negotiate(struct connectdata *conn, bool proxy, @@ -159,7 +129,8 @@ int Curl_input_negotiate(struct connectdata *conn, bool proxy, if(GSS_ERROR(major_status)) { if(output_token.value) gss_release_buffer(&discard_st, &output_token); - log_gss_error(conn, minor_status, "gss_init_sec_context() failed: "); + Curl_gss_log_error(conn->data, minor_status, + "gss_init_sec_context() failed: "); return -1; } |