remap mechanism-specific status codes in mechglue/spnego
authorKen Raeburn <raeburn@mit.edu>
Thu, 16 Aug 2007 22:55:06 +0000 (22:55 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 16 Aug 2007 22:55:06 +0000 (22:55 +0000)
commitc15ec7751a7d7c1d97dbeb1dd88dda2a328515e0
tree824bd8c158b1c5b72913515953c7e8576399d912
parent9db2f5eb745287654117e70032d05dd9f5a91a3f
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
43 files changed:
src/lib/gssapi/generic/Makefile.in
src/lib/gssapi/generic/gssapiP_generic.h
src/lib/gssapi/generic/maptest.c [new file with mode: 0644]
src/lib/gssapi/generic/util_errmap.c [new file with mode: 0644]
src/lib/gssapi/gss_libinit.c
src/lib/gssapi/mechglue/g_accept_sec_context.c
src/lib/gssapi/mechglue/g_acquire_cred.c
src/lib/gssapi/mechglue/g_canon_name.c
src/lib/gssapi/mechglue/g_compare_name.c
src/lib/gssapi/mechglue/g_context_time.c
src/lib/gssapi/mechglue/g_delete_sec_context.c
src/lib/gssapi/mechglue/g_dsp_name.c
src/lib/gssapi/mechglue/g_dsp_status.c
src/lib/gssapi/mechglue/g_dup_name.c
src/lib/gssapi/mechglue/g_exp_sec_context.c
src/lib/gssapi/mechglue/g_glue.c
src/lib/gssapi/mechglue/g_imp_name.c
src/lib/gssapi/mechglue/g_imp_sec_context.c
src/lib/gssapi/mechglue/g_init_sec_context.c
src/lib/gssapi/mechglue/g_initialize.c
src/lib/gssapi/mechglue/g_inq_context.c
src/lib/gssapi/mechglue/g_inq_cred.c
src/lib/gssapi/mechglue/g_inq_names.c
src/lib/gssapi/mechglue/g_mechname.c
src/lib/gssapi/mechglue/g_oid_ops.c
src/lib/gssapi/mechglue/g_process_context.c
src/lib/gssapi/mechglue/g_rel_cred.c
src/lib/gssapi/mechglue/g_seal.c
src/lib/gssapi/mechglue/g_sign.c
src/lib/gssapi/mechglue/g_store_cred.c
src/lib/gssapi/mechglue/g_unseal.c
src/lib/gssapi/mechglue/g_verify.c
src/lib/gssapi/mechglue/mglueP.h
src/lib/gssapi/mechglue/oid_ops.c
src/lib/gssapi/spnego/spnego_mech.c
src/lib/rpc/auth_gssapi_misc.c
src/lib/rpc/svc_auth_gssapi.c
src/tests/dejagnu/krb-standalone/gssftp.exp
src/util/gen.pl [new file with mode: 0644]
src/util/t_array.pm [new file with mode: 0644]
src/util/t_enum.pm [new file with mode: 0644]
src/util/t_template.pm [new file with mode: 0644]
src/util/t_tsenum.pm [new file with mode: 0644]