From d5fc6e14b0b4f240b3b225487637c265471a9fc7 Mon Sep 17 00:00:00 2001 From: Isaac Boukris Date: Tue, 29 Mar 2016 17:13:46 +0300 Subject: GSS: make Curl_gss_log_error more verbose Also display the GSS_C_GSS_CODE (major code) when specified instead of only GSS_C_MECH_CODE (minor code). In addition, the old code was printing a colon twice after the prefix and also miscalculated the length of the buffer in between calls to gss_display_status (the length of ": " was missing). Also, gss_buffer is not guaranteed to be NULL terminated and thus need to restrict reading by its length. Closes #738 --- lib/vauth/spnego_gssapi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/vauth/spnego_gssapi.c') diff --git a/lib/vauth/spnego_gssapi.c b/lib/vauth/spnego_gssapi.c index 9aa96dfdb..2f50daaa5 100644 --- a/lib/vauth/spnego_gssapi.c +++ b/lib/vauth/spnego_gssapi.c @@ -102,7 +102,8 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data, GSS_C_NT_HOSTBASED_SERVICE, &nego->server_name); if(GSS_ERROR(major_status)) { - Curl_gss_log_error(data, minor_status, "gss_import_name() failed: "); + Curl_gss_log_error(data, "gss_import_name() failed: ", + major_status, minor_status); free(spn); @@ -150,8 +151,8 @@ CURLcode Curl_auth_decode_spnego_message(struct SessionHandle *data, if(output_token.value) gss_release_buffer(&unused_status, &output_token); - Curl_gss_log_error(data, minor_status, - "gss_init_sec_context() failed: "); + Curl_gss_log_error(data, "gss_init_sec_context() failed: ", + major_status, minor_status); return CURLE_OUT_OF_MEMORY; } -- cgit v1.2.3