From c79f816c323f5d17f9e45f78fd08df72bd6c5f7a Mon Sep 17 00:00:00 2001 From: Julien Chaffraix Date: Fri, 12 Nov 2010 08:20:50 -0800 Subject: krb5: Use GSS_ERROR to check for error. This is the advised way of checking for errors in the GSS-API RFC. Also added some '\n' to the error message so that they are not mixed with other outputs. --- lib/krb5.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/krb5.c b/lib/krb5.c index 2530395d1..d94ca27bc 100644 --- a/lib/krb5.c +++ b/lib/krb5.c @@ -259,8 +259,8 @@ krb5_auth(void *app_data, struct connectdata *conn) gssresp = NULL; } - if(maj != GSS_S_COMPLETE && maj != GSS_S_CONTINUE_NEEDED) { - Curl_infof(data, "Error creating security context"); + if(GSS_ERROR(maj)) { + Curl_infof(data, "Error creating security context\n"); ret = AUTH_ERROR; break; } @@ -268,7 +268,7 @@ krb5_auth(void *app_data, struct connectdata *conn) if(output_buffer.length != 0) { if(Curl_base64_encode(data, (char *)output_buffer.value, output_buffer.length, &p) < 1) { - Curl_infof(data, "Out of memory base64-encoding"); + Curl_infof(data, "Out of memory base64-encoding\n"); ret = AUTH_CONTINUE; break; } @@ -299,7 +299,7 @@ krb5_auth(void *app_data, struct connectdata *conn) _gssresp.length = Curl_base64_decode(p + 5, (unsigned char **) &_gssresp.value); if(_gssresp.length < 1) { - Curl_failf(data, "Out of memory base64-encoding"); + Curl_failf(data, "Out of memory base64-encoding\n"); ret = AUTH_CONTINUE; break; } -- cgit v1.2.3