diff options
| author | Simo Sorce <simo@redhat.com> | 2012-09-13 16:17:19 -0400 |
|---|---|---|
| committer | Simo Sorce <simo@redhat.com> | 2012-09-14 17:02:16 -0400 |
| commit | bca8e86b4aebb123f71d8d503ca98050a64cfe73 (patch) | |
| tree | ba88add5fff9e2b0a632c36cb7b29674deb33a9d /src/lib/gssapi | |
| parent | ee288c64c191d5f127af23039d8508ebbcedd3e7 (diff) | |
| download | krb5-bca8e86b4aebb123f71d8d503ca98050a64cfe73.tar.gz krb5-bca8e86b4aebb123f71d8d503ca98050a64cfe73.tar.xz krb5-bca8e86b4aebb123f71d8d503ca98050a64cfe73.zip | |
New SPI call to import creds by oid
This extension makes it possible for an interposer to know which
interposed mechanism the mechglue intended to use when multiple
mechanisms are being interposed by the same plugin.
Diffstat (limited to 'src/lib/gssapi')
| -rw-r--r-- | src/lib/gssapi/mechglue/g_imp_cred.c | 12 | ||||
| -rw-r--r-- | src/lib/gssapi/mechglue/g_initialize.c | 2 | ||||
| -rw-r--r-- | src/lib/gssapi/mechglue/mglueP.h | 8 |
3 files changed, 20 insertions, 2 deletions
diff --git a/src/lib/gssapi/mechglue/g_imp_cred.c b/src/lib/gssapi/mechglue/g_imp_cred.c index a595e0b0ae..b4d9d62910 100644 --- a/src/lib/gssapi/mechglue/g_imp_cred.c +++ b/src/lib/gssapi/mechglue/g_imp_cred.c @@ -135,11 +135,19 @@ gss_import_cred(OM_uint32 *minor_status, gss_buffer_t token, goto error; } mech = gssint_get_mechanism(selected_mech); - if (mech == NULL || mech->gss_import_cred == NULL) { + if (mech == NULL || mech->gss_import_cred == NULL || + mech->gssspi_import_cred_by_mech == NULL) { status = GSS_S_DEFECTIVE_TOKEN; goto error; } - status = mech->gss_import_cred(minor_status, &mech_token, &mech_cred); + if (mech->gssspi_import_cred_by_mech) { + status = mech->gssspi_import_cred_by_mech(minor_status, + gssint_get_public_oid(selected_mech), + &mech_token, &mech_cred); + } else { + status = mech->gss_import_cred(minor_status, &mech_token, + &mech_cred); + } if (status != GSS_S_COMPLETE) { map_error(minor_status, mech); goto error; diff --git a/src/lib/gssapi/mechglue/g_initialize.c b/src/lib/gssapi/mechglue/g_initialize.c index 1fb4aeca7d..94d851e5d6 100644 --- a/src/lib/gssapi/mechglue/g_initialize.c +++ b/src/lib/gssapi/mechglue/g_initialize.c @@ -818,6 +818,7 @@ build_dynamicMech(void *dl, const gss_OID mech_type) GSS_ADD_DYNAMIC_METHOD(dl, mech, gssspi_acquire_cred_with_password); GSS_ADD_DYNAMIC_METHOD(dl, mech, gssspi_import_sec_context_for_mech); GSS_ADD_DYNAMIC_METHOD(dl, mech, gssspi_import_name_by_mech); + GSS_ADD_DYNAMIC_METHOD(dl, mech, gssspi_import_cred_by_mech); assert(mech_type != GSS_C_NO_OID); @@ -913,6 +914,7 @@ static int build_interMech(void *dl, gss_mech_info aMech) RESOLVE_GSSI_SYMBOL(dl, mech, gssspi, _acquire_cred_with_password); RESOLVE_GSSI_SYMBOL(dl, mech, gssspi, _import_sec_context_for_mech); RESOLVE_GSSI_SYMBOL(dl, mech, gssspi, _import_name_by_mech); + RESOLVE_GSSI_SYMBOL(dl, mech, gssspi, _import_cred_by_mech); mech->mech_type = *aMech->mech_type; aMech->mech = mech; diff --git a/src/lib/gssapi/mechglue/mglueP.h b/src/lib/gssapi/mechglue/mglueP.h index 86b0b76f35..b3bd67746e 100644 --- a/src/lib/gssapi/mechglue/mglueP.h +++ b/src/lib/gssapi/mechglue/mglueP.h @@ -666,6 +666,14 @@ typedef struct gss_config { gss_name_t* /* output_name */ /* */); + OM_uint32 (KRB5_CALLCONV *gssspi_import_cred_by_mech) + ( + OM_uint32 *, /* minor_status */ + gss_OID, /* mech_type */ + gss_buffer_t, /* token */ + gss_cred_id_t * /* cred_handle */ + /* */); + } *gss_mechanism; /* |
