(gss_adat): if accept_sec_context fails, syslog a reason and give a

temporary error message


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10885 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-03-14 23:06:58 +00:00
parent bcb2258324
commit dbe8ec17b6

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1998 - 2001 Kungliga Tekniska H<>gskolan * Copyright (c) 1998 - 2002 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -183,12 +183,12 @@ gss_adat(void *app_data, void *buf, size_t len)
d->delegated_cred_handle = malloc(sizeof(*d->delegated_cred_handle)); d->delegated_cred_handle = malloc(sizeof(*d->delegated_cred_handle));
if (d->delegated_cred_handle == NULL) { if (d->delegated_cred_handle == NULL) {
reply(500, "Out of memory"); reply(500, "Out of memory");
goto out; goto out;
} }
memset ((char*)d->delegated_cred_handle, 0, memset ((char*)d->delegated_cred_handle, 0,
sizeof(*d->delegated_cred_handle)); sizeof(*d->delegated_cred_handle));
maj_stat = gss_accept_sec_context (&min_stat, maj_stat = gss_accept_sec_context (&min_stat,
&d->context_hdl, &d->context_hdl,
@@ -200,7 +200,7 @@ gss_adat(void *app_data, void *buf, size_t len)
&output_token, &output_token,
NULL, NULL,
NULL, NULL,
&d->delegated_cred_handle); &d->delegated_cred_handle);
if(output_token.length) { if(output_token.length) {
if(base64_encode(output_token.value, output_token.length, &p) < 0) { if(base64_encode(output_token.value, output_token.length, &p) < 0) {
@@ -235,9 +235,22 @@ gss_adat(void *app_data, void *buf, size_t len)
reply(335, "ADAT=%s", p); reply(335, "ADAT=%s", p);
else else
reply(335, "OK, need more data"); reply(335, "OK, need more data");
} else } else {
reply(535, "foo?"); OM_uint32 new_stat;
out: OM_uint32 msg_ctx = 0;
gss_buffer_desc status_string;
gss_display_status(&new_stat,
min_stat,
GSS_C_MECH_CODE,
GSS_C_NO_OID,
&msg_ctx,
&status_string);
syslog(LOG_ERR, "gss_accept_sec_context: %s",
(char*)status_string.value);
gss_release_buffer(&new_stat, &status_string);
reply(431, "Security resource unavailable");
}
out:
free(p); free(p);
return 0; return 0;
} }