summaryrefslogtreecommitdiffstats
path: root/src/lib/gssapi/mechglue
Commit message (Collapse)AuthorAgeFilesLines
* Fix import_sec_context with interposersSimo Sorce2013-03-241-21/+14
| | | | | | | | | | | | | | | | | | The code was correctly selecting the mechanism to execute, but it was improperly setting the mechanism type of the internal context when the selected mechanism was that of an interposer and vice versa. When an interposer is involved the internal context is that of the interposer, so the mechanism type of the context needs to be the interposer oid. Conversely, when an interposer re-enters gssapi and presents a token with a special oid, the mechanism called is the real mechanism, and the context returned is a real mechanism context. In this case the mechanism type of the context needs to be that of the real mechanism. ticket: 7592 target_version: 1.11.2 tags: pullup
* make dependGreg Hudson2013-03-241-5/+4
|
* Eliminate unused variablesGreg Hudson2013-03-151-1/+0
|
* Modernize k5bufGreg Hudson2013-02-141-7/+7
| | | | | | Rename the krb5int_buf_ family of functions to use the k5_ prefix for brevity. Reformat some k5buf implementation code to match current practices.
* make dependGreg Hudson2013-01-101-1/+1
| | | | | Mostly this gets rid of the trailing space on line 2 after bb76891f5386526bdf91bc790c614fc9296cb5fa.
* Separate clpreauth and kdcpreauth interfacesGreg Hudson2012-12-191-2/+2
| | | | | | | Since there is no overlap between the clpreauth and kdcpreauth interface declarations, there's no particular reason to combine them into one header. For backward compatibility and convenience, leave behind a preauth_plugin.h which includes both.
* Style cleanup for internal error handlingGreg Hudson2012-12-191-1/+1
| | | | | | | Fix style issues in kerrs.c and errors.c. Rename error handling functions to use shorter k5_ prefix. Eliminate an inoperable krb5int_set_error() call in gic_opte_alloc and convert the other call to use krb5_set_error_message().
* Build fixes for windowsBen Kaduk2012-12-051-1/+1
| | | | | | | | | | | | Add entries to OBJS and SRCS as well as STLIBOBJS. Use KRB5_CALLCONV at function definition as well as declaration. Declare missing variable in _WIN32-conditional code. ticket: 7479 (new) tags: pullup target_version: 1.11
* Don't use void * arithmetic in interposed_oidGreg Hudson2012-10-131-1/+2
|
* Add SPI calls to import objects by mech oidSimo Sorce2012-10-026-17/+85
| | | | | | | | | | An interposer mech needs to be able to handle multiple mechanisms. When importing a mech token for a name, cred, or context, the interposer mech needs to know the mech type of the token being imported. To make this work, add SPI calls which accept a mech type argument. [ghudson@mit.edu: Stylistic changes, commit squashing, commit message]
* Use interposer mechanisms in mechglue functionsSimo Sorce2012-10-0214-112/+183
| | | | | | | | | | Wherever a GSSAPI mechglue function accepts a mech OID from the caller, use gssint_select_mech_type() to choose the mechanism to use. Wherever a mechglue function outputs a mech OID to the caller, use gssint_get_public_oid() or gssint_make_public_oid_set() to expose the public mech OID. [ghudson@mit.edu: Stylistic changes, commit squashing, commit message]
* Add primitives for using interposed mechanismsSimo Sorce2012-10-022-4/+152
| | | | | | | | | | Add gssint_select_mechanism() to determine what mechanism to use for a caller-specified OID, gssint_get_public_oid() to determine what mechanism to expose to the caller, and gssint_make_public_oid_set to translate an array of mech OIDs into a set of public OIDs. In gssint_get_mechanism(), match interposed OIDs as well as real ones. [ghudson@mit.edu: Stylistic changes, commit squashing, commit message]
* Add support for loading interposer modulesSimo Sorce2012-10-022-24/+247
| | | | | | | | | | | | Extend the syntax of the gss mech config file to allow a module type delimited by triangle brackets. If the module type is "interposer", flag the mechanism entry as being an interposer mechanism. A module marked as an interposer is loaded immediately (so it can interpose a built-in mechanism) and produces a list of OIDs to interpose. Interposer mechanisms are not exposed to applications. [ghudson@mit.edu: Stylistic changes, commit squashing, commit message]
* Refactor gss mech config parserGreg Hudson2012-09-171-85/+53
| | | | Use helper functions to shorten and clarify loadConfigFile.
* Delete unused internal mechglue functionsGreg Hudson2012-09-172-125/+0
| | | | | | | Get rid of gssint_get_mechanisms, gssint_mech_to_oid, and gssint_oid_to_mech, which constructed a list of mechanism names and mapped between mech names and OIDs. These functions were only used by gss_inquire_mechs_for_name, which now uses gss_indicate_mechs instead.
* Simplify gss_inquire_mechs_for_nameGreg Hudson2012-09-171-68/+45
| | | | | | | | | Use gss_indicate_mechs instead of gssint_get_mechanisms and gssint_mech_to_oid to iterate over the list of mechanism OIDs. Use a static helper to determine whether a mech supports a name type, avoiding most of the work done in the for loop. Use a cleanup handler. Don't leave partial results in the output parameter on error.
* Avoid leaks on gss_accept_sec_context errorsSimo Sorce2012-09-161-4/+5
| | | | | | | | | | | | | | | Failure handling during the postprocessing of mech->gss_accept_sec_context was inconsistent. In one case we delete the output token but leave the partly-constructed context present in *context_handle (violating RFC 2744 if this is the first call); in other cases we leave the output token in the caller's buffer but do destroy the partly-constructed context. Make this more consistent by always destroying the output token and partly-constructed context. (RFC 2744 prefers, but does not require, leaving the partly-constructed context present on error if it was present on entry. At the moment we are ignoring that preference.) [ghudson@mit.edu: Rewrote commit message with more details]
* make dependGreg Hudson2012-09-121-0/+16
|
* Introduce gss_export_cred and gss_import_credGreg Hudson2012-09-114-0/+300
| | | | | | | | Add gss_export_cred and gss_import_cred mechglue functions to serialize and unserialize GSSAPI credential handles. Mechanism implementations and tests will follow. ticket: 7354 (new)
* Add support for GSS_C_NT_COMPOSITE_EXPORTLuke Howard2012-08-311-1/+1
| | | | ticket: 7347 (new)
* Fix memory leak in gss_add_credGreg Hudson2012-08-301-0/+3
| | | | | The most recent commit to g_acquire_cred.c allocates an OID set to pass to the mech, but never releases it. Fix that.
* Use gssalloc in more parts of GSSAPIGreg Hudson2012-08-112-2/+2
| | | | | | | | | Fix some GSSAPI buffer allocations which were missed in 800358b1790ef82710af0b6021c6ff2dca2b0de7: gss_export_sec_context, gss_display_name, and IAKERB and SPNEGO token construction. ticket: 7233 (new) tags: pullup
* Remove gss_mechanism_extSimo Sorce2012-08-083-110/+24
| | | | | | | | This function did not serve any useful purpose. Remove it and the special case it creates; move the only function it contained to the main gss_mechanism structure where it belongs. Note that the function name is preserved so that loadable modules are not affected by this change.
* Pass the actual mech oid in creds functionsSimo Sorce2012-08-062-11/+34
| | | | | | This way the mechanism handler knows what mech type is intended. This allows plugin that implement multiple mechanisms or interposer plugins to know what they are being asked to do.
* Reuse code to free gss_mech_info structureSimo Sorce2012-08-051-21/+4
|
* Make gss_ctx_id_t truly opaqueSimo Sorce2012-08-035-6/+6
| | | | | | This allows us to still use it for type safety in the APIs while at the same time prevent code from trying to dereference internal_ctx_id by mistake.
* Fix oid set construction in gss_inquire_cred()Kevin Wasserman2012-08-021-22/+10
| | | | | | | | | | | Use gssapi calls to construct the oid sets. It is not safe on windows to use malloc to hand-construct the set and then call gss_release_oid_set() to clean it up. Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com> ticket: 7227 (new) tags: pullup
* Introduce credential store extensionsSimo Sorce2012-07-203-32/+210
| | | | | | | | | Add new APIs gss_acquire_cred_from, gss_add_cred_from, and gss_store_cred_into, which take additional argments to specify the location of the credential storage using a key-value map, where keys are interpreted by the mechanisms. ticket: 7217 (new)
* In g_oid_ops.c, remove an unneeded declarationSimo Sorce2012-07-181-3/+0
| | | | The code that used it is no longer in this file.
* Avoid mapping GSSAPI minor code on successGreg Hudson2012-07-081-1/+2
| | | | | | | | | In gssint_import_internal_name, don't map the minor code from mech->gss_duplicate_name if it returned successfully. Fixes an "unexpected non-zero minor status" error reported by SAP's gsstest when it invokes gss_canonicalize_name(). ticket: 7194 (new)
* Use first mech's status in gss_acquire_credGreg Hudson2012-06-031-3/+11
| | | | | | | | | | | If we can't acquire creds for any mech in gss_acquire_cred, return the status of the first mech instead of the last mech, as it's more useful in the typical case (where the first mech is krb5 and the last mech is SPNEGO). This error reporting is not ideal when the user was expecting to use some mech other than krb5, but it's about as good as things were prior to #6894. ticket: 6973
* Initialize gss_get_name_attribute output buffersGreg Hudson2012-02-141-0/+8
| | | | | | | | | | | | GSS functions which accept gss_buffer_t output arguments should initialize those buffers to empty on startup (see gss_wrap, for instance). Do so for gss_get_name_attribute in the mechglue. ticket: 7089 target_version: 1.10.1 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25700 dc483132-0cff-0310-8789-dd5450dbe970
* make dependTom Yu2011-10-141-325/+331
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25344 dc483132-0cff-0310-8789-dd5450dbe970
* Use gssalloc memory management where appropriateSam Hartman2011-10-145-6/+6
| | | | | | | | | | gss_buffer_t may be freed in a different module from where they are allocated so it is not safe to use strdup/malloc/calloc/free. similarly, gss_OID_set need to use gssalloc functions. Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25332 dc483132-0cff-0310-8789-dd5450dbe970
* Simplify gss_indicate_mechs() by using generic_gss_copy_oid_setSam Hartman2011-10-141-52/+3
| | | | | | | | | ...instead of hand-duplicating all the logic therein. Also makes the switch to using gssalloc functions with oid_sets easier. Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25329 dc483132-0cff-0310-8789-dd5450dbe970
* Initialize localname on error in gss_localnameGreg Hudson2011-10-061-4/+5
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25316 dc483132-0cff-0310-8789-dd5450dbe970
* Windows fixes: remove unreferenced; use sizeof to compute array sizeSam Hartman2011-09-281-2/+1
| | | | | | Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25272 dc483132-0cff-0310-8789-dd5450dbe970
* WhitespaceGreg Hudson2011-09-212-66/+68
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25224 dc483132-0cff-0310-8789-dd5450dbe970
* * New implementation to map a gss name to localnameSam Hartman2011-09-213-56/+75
| | | | | | | | | | | | | | | | * Write gss_pname_to_uid in terms of gss_localname; suppress on win32 * Add test for gss_pname_to_uid indirectly testing gss_localname * gss_localname is the SPI, not gss_pname_to_uid * fix some const gss_OID->gss_const_oid Signed-off-by: Sam Hartman <hartmans@painless-security.com> gss_localname: map gss name to localname git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25222 dc483132-0cff-0310-8789-dd5450dbe970
* Formatting fixesGreg Hudson2011-09-191-203/+219
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25209 dc483132-0cff-0310-8789-dd5450dbe970
* On Windows, parse mechanism info from Registry instead of mech fileSam Hartman2011-09-191-169/+351
| | | | | | | | | | | Currently the code parses @sysconfdir@/gss/mech as a set of GSS mechanisms to dynamically load. On Windows this should come from the registry. Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com> Signed-off-by: Sam Hartman <hartmans@debian.org> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25198 dc483132-0cff-0310-8789-dd5450dbe970
* Eliminate the mechglue union cred auxinfo fieldGreg Hudson2011-09-058-242/+65
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25152 dc483132-0cff-0310-8789-dd5450dbe970
* Reindent per krb5-batch-reindent.el.Ken Raeburn2011-09-042-15/+15
| | | | | | | Some minor reformatting added in places to avoid exceeding 80 columns. Used Emacs 22.1 built-in C mode. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25144 dc483132-0cff-0310-8789-dd5450dbe970
* Fix style issues in r25087Greg Hudson2011-08-292-3/+3
| | | | | | | | | | | * Function names should be at the beginning of lines in definitions. * Changes should not create lines >79 characters. * Continuation lines should align after left parens when appropriate. Also, krb5_gss_accept_sec_context_ext and acquire_accept_cred are not gss mechanism functions and should not have been tagged. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25116 dc483132-0cff-0310-8789-dd5450dbe970
* Fix major status handling in gss_acquire_credGreg Hudson2011-08-111-0/+1
| | | | | | | | | | | If we have at least one cred element after the mech loop, reset major before continuing on, or we could mistakenly return a failure status from the last mech (and free the returned creds). Reported by aberry@likewise.com. ticket: 6944 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25097 dc483132-0cff-0310-8789-dd5450dbe970
* WhitespaceGreg Hudson2011-08-091-1/+1
| | | | | | Also remove the erroneously added gssapi_err_krb5 error table sources. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25091 dc483132-0cff-0310-8789-dd5450dbe970
* call gssint_mecherrmap_init() from gssint_mechglue_init()Sam Hartman2011-08-091-0/+1
| | | | | | | Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com> Signed-off-by: Sam Hartman <hartmans@painless-security.com> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25090 dc483132-0cff-0310-8789-dd5450dbe970
* Use KRB5_CALLCONV for all gss mechanism functions. Also wrap #include ↵Sam Hartman2011-08-096-64/+66
| | | | | | | | | <unistd.h> with #ifdef HAVE_UNISTD_H in g_authorize_localname.c Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com> Signed-off-by: Sam Hartman <hartmans@painless-security.com> git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25087 dc483132-0cff-0310-8789-dd5450dbe970
* Fix gss_set_cred_option cred creation with no nameGreg Hudson2011-07-221-6/+8
| | | | | | | | | | | When creating a cred in the mechglue with gss_acquire_cred, the mechanism is allowed to return no name from gss_inquire_cred. But in the analagous operation in gss_set_cred_option, that would result in an error from gss_display_name. Make the call to gss_display_name conditional on the mechanism name being set. Reported by Andrew Bartlett. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25037 dc483132-0cff-0310-8789-dd5450dbe970
* make dependEzra Peisach2011-07-011-8/+8
| | | | git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25007 dc483132-0cff-0310-8789-dd5450dbe970