diff options
author | Ken Raeburn <raeburn@mit.edu> | 2007-08-16 22:55:06 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2007-08-16 22:55:06 +0000 |
commit | c15ec7751a7d7c1d97dbeb1dd88dda2a328515e0 (patch) | |
tree | 824bd8c158b1c5b72913515953c7e8576399d912 /src/lib/gssapi/mechglue/g_unseal.c | |
parent | 9db2f5eb745287654117e70032d05dd9f5a91a3f (diff) | |
download | krb5-c15ec7751a7d7c1d97dbeb1dd88dda2a328515e0.zip krb5-c15ec7751a7d7c1d97dbeb1dd88dda2a328515e0.tar.gz krb5-c15ec7751a7d7c1d97dbeb1dd88dda2a328515e0.tar.bz2 |
remap mechanism-specific status codes in mechglue/spnego
This patch creates a mapping in the mechglue/spnego code to modify
mechanism status codes when passing them back to the application, so
that mechglue's display_status dispatcher can determine the correct
mechanism to dispatch to.
This is part of the "get enhanced error messages from gssapi
applications" project; ticket 5590 has updates to the Kerberos 5
mechanism to extract enhanced error messages (when there are any) from
the Kerberos library.
util/gen.pl, util/t_*.pm: New code generation script and templates.
lib/gssapi/generic: Add a new, global mapping that enumerates the
{mechOID,status} pairs as they're seen, allowing a magic mechOID value
to indicate com_err error codes from mechglue and spnego, and
reserving status code 0 for unknown errors. Preload the Kerberos
"wrong principal" error code once for each mechanism OID used for
Kerberos, so the entries get fixed positions (1-3) in the table.
lib/gssapi/gss_libinit.c: Call the initializer and destructor
functions.
lib/gssapi/mechglue, lib/gssapi/spnego: Enter all mechanism-generated
or locally-generated status codes into the mapping table, and return
the table index to the application. Do the reverse in display_status,
to get the messages from the mechanism..
lib/rpc: Define new function gssrpcint_printf to use for debugging
instead of printf, to redirect output away from dejagnu; add a couple
more debugging calls. Check for minor status codes 1-3 now instead of
KRB5KRB_AP_WRONG_PRINC.
tests/dejagnu/krb-standalone/gssftp.exp: Test getting more detailed
error messages back, by having the ftp client attempt to authenticate
to a non-existent service, and examining the error message for the
service principal name.
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19831 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/gssapi/mechglue/g_unseal.c')
-rw-r--r-- | src/lib/gssapi/mechglue/g_unseal.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/gssapi/mechglue/g_unseal.c b/src/lib/gssapi/mechglue/g_unseal.c index 56f5673..be7a8de 100644 --- a/src/lib/gssapi/mechglue/g_unseal.c +++ b/src/lib/gssapi/mechglue/g_unseal.c @@ -80,7 +80,7 @@ int * qop_state; mech = gssint_get_mechanism (ctx->mech_type); if (mech) { - if (mech->gss_unseal) + if (mech->gss_unseal) { status = mech->gss_unseal( mech->context, minor_status, @@ -89,7 +89,9 @@ int * qop_state; output_message_buffer, conf_state, qop_state); - else + if (status != GSS_S_COMPLETE) + map_error(minor_status, mech); + } else status = GSS_S_UNAVAILABLE; return(status); |