aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-sasl-gssapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-sasl-gssapi.c')
-rw-r--r--camel/camel-sasl-gssapi.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index bbdb1b86ec..9faa1d8091 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -34,6 +34,7 @@
#include <gssapi/gssapi_generic.h>
#else /* HAVE_HEIMDAL_KRB5 */
#include <gssapi.h>
+#define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
#endif
#include <errno.h>
@@ -215,7 +216,6 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
}
str = g_strdup_printf ("%s@%s", sasl->service_name, h->h_name);
- printf ("FQDN: %s (%s)\n", h->h_name, str);
camel_free_host (h);
inbuf.value = str;
@@ -259,8 +259,6 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
break;
default:
gssapi_set_exception (major, minor, ex);
- printf ("gss_init_sec_context() exception\n");
- gss_release_buffer (&minor, &outbuf);
return NULL;
}
@@ -281,8 +279,6 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
major = gss_unwrap (&minor, priv->ctx, &inbuf, &outbuf, &conf_state, &qop);
if (major != GSS_S_COMPLETE) {
gssapi_set_exception (major, minor, ex);
- printf ("gss_unwrap() exception\n");
- gss_release_buffer (&minor, &outbuf);
return NULL;
}
@@ -309,14 +305,13 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
gss_release_buffer (&minor, &outbuf);
major = gss_wrap (&minor, priv->ctx, FALSE, qop, &inbuf, &conf_state, &outbuf);
- if (major != 0) {
+ if (major != GSS_S_COMPLETE) {
gssapi_set_exception (major, minor, ex);
- printf ("gss_wrap() exception\n");
- gss_release_buffer (&minor, &outbuf);
g_free (str);
return NULL;
}
+ g_free (str);
challenge = g_byte_array_new ();
g_byte_array_append (challenge, outbuf.value, outbuf.length);
gss_release_buffer (&minor, &outbuf);
@@ -326,7 +321,6 @@ gssapi_challenge (CamelSasl *sasl, GByteArray *token, CamelException *ex)
sasl->authenticated = TRUE;
break;
default:
- printf ("unknown state exception\n");
return NULL;
}