summaryrefslogtreecommitdiffstats
path: root/proxy/src/mechglue
Commit message (Collapse)AuthorAgeFilesLines
* Add helpers to store and retrieve encrypted credsSimo Sorce2015-12-013-6/+149
| | | | | | | | This will allow to (ab)use the krb5 ccache to store encrypted credentials in the user's ccache for later reuse. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Robbie Harwoood <rharwood@redhat.com>
* Add gss_acquire_cred_impersonate_name supportSimo Sorce2015-12-013-6/+138
| | | | | | | | This is used by a client that wants to peform a s4u2self operation using its server credentials. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Robbie Harwoood <rharwood@redhat.com>
* Fix formatting on noncompliant copyright linesRobbie Harwood2015-09-0412-289/+12
| | | | | Signed-off-by: Robbie Harwood <rharwood@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix handling of context initializationSimo Sorce2015-03-301-5/+7
| | | | | | | | | | | | | | If a previous call has decided to use only local (to the process) credentials, then we need to override all the way to the end. A previous patch also swapped the order in which credential handler and context handler are initialized, make sure also to swap the fallback checks. Set the behavior to the process default only if it wasn't forced to local. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Lukas Slebodnik <lslebodn@redhat.com>
* Properly handle security contexts on errorSimo Sorce2015-03-243-27/+47
| | | | | | | | | | | | | | | | On error we need to make sure we do not return a pointer to a security context that may have been already freed. So make sure to always unconditionally return the context that we've been returned by our callees. Also reorganize the code so we do not accidently wipe the context and leak memoy on error. This fixed a double-free bug found by NFS folks @ Red Hat Fixes: https://fedorahosted.org/gss-proxy/ticket/137 Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Nathaniel McCallum <npmccallum@redhat.com>
* Zero out the outputs of display_nameSimo Sorce2015-01-221-0/+5
| | | | | | | | | | The mechglue expects the mechanism function to zero them in all cases. Otherwise on error it will later try to free the output buffer value which can be an arbitrary pointer. This will cause a segfault or worse in glibc's free(). Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Roland Mainz <rmainz@redhat.com>
* Fix potential segfault in gssi_inquire_context().Günther Deschner2014-02-051-2/+2
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Use secure_getenv in client and mechglue moduleSimo Sorce2013-11-211-2/+2
| | | | | | | | | | proxymehc.so may be used in setuid binaries so follow best security practices and use secure_getenv() if available. Fallback to poorman emulation when secure_getenv() is not available. Resolves: https://fedorahosted.org/gss-proxy/ticket/110 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix calling gpm_inquire_cred_by_mechSimo Sorce2013-11-191-1/+2
| | | | | | | | | | | We need to pass the real mechanism oid here, not the spcial oid. special oids are used exclusively by the interposer and gssapi machinery that calls the interposer, they must never be propagated to clients or servers. https://fedorahosted.org/gss-proxy/ticket/107 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add way to return regular oid from specialSimo Sorce2013-11-192-13/+43
| | | | | | | | | | In some cases we need to pass on the corresponding real oid, after we are given a special oid. Add helper functions to do that. https://fedorahosted.org/gss-proxy/ticket/107 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix LOCAL_FIRST behaviorSimo Sorce2013-10-181-20/+19
| | | | | | | | | We were erroneously returning and never falling back if LOCAL_FIRST was selected. Correct also the remote first fallback flow. Resolves: https://fedorahosted.org/gss-proxy/ticket/105 Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Coverity fixes.Simo Sorce2013-06-271-1/+1
| | | | | | | | | | | Fix a 4 coverity issues, ranging from memory leaks, to uninitialized variables, to potential NULL derefernce. Also a TOCTOU report that is in one of the accessory test scripts. The bug itself is not reallya TOCTOU, but the check done in the script is unecessary, so I just removed it. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Disable gss_export_name_composite() for now.Günther Deschner2013-05-161-1/+3
| | | | | | | | | | We first need to fix our tests and implementation. Temporary workaround for: https://fedorahosted.org/gss-proxy/ticket/81 Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Neutralize gssi_export_name.Simo Sorce2013-05-161-22/+2
| | | | | | | | We do not want to generate an exported name buffer. Let's the mechglue code in MIT generate it for use from the display name. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Fix typo in gssi_import_name_by_mech().Günther Deschner2013-05-151-2/+2
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add --with-gpp-default-behavior configure switch.Günther Deschner2013-05-151-4/+5
| | | | | | | | Only LOCAL_ONLY,LOCAL_FIRST and REMOTE_FIRST allowed. REMOTE_ONLY is recognized but configure aborts as long as it is not supported. Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Use gp_boolean_is_true from interposer plugin's GSS_USE_PROXY check.Günther Deschner2013-04-261-1/+2
| | | | | Signed-off-by: Günther Deschner <gdeschner@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Import names as remote name by default.Simo Sorce2013-04-101-14/+21
| | | | | | | | | | | Always use remote name by default, otherwise canonicalization will loose information about the original name, for example it will convert names of the special type GSS_C_NT_STRING_UID_NAME or GSS_NT_MACHINE_UID_NAME in a non reversible way and the proxy will not be a le to use them as intended (for impersonation by trusted services). Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Remove unused variablesSimo Sorce2013-04-031-2/+0
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix a few more resource leaksSimo Sorce2013-04-032-2/+3
| | | | | | Still a couple resource leaks after the last Coverity scan Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix dereference after null checks found by CoveritySimo Sorce2013-04-032-3/+7
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix resource leaks found by CoveritySimo Sorce2013-04-034-17/+29
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix uninizialized variables found by CoveritySimo Sorce2013-04-032-8/+8
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add client side support to set allowed enctypesSimo Sorce2013-03-271-1/+92
| | | | | | | | | When using remote credentials, intercept set_cred_option calls and register an option into the existing set of crdentials with the request to set allowed entypes at the first use of said crdentials. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Add helper function to check for krb5 oidSimo Sorce2013-03-272-0/+15
| | | | | | | | | | The krb5 mechanism supports multiple oids for historical reasons. Add a function to generically check if a mech oid is any of the krb5 mechanism known oids for functions that do not care which exact oid is being used of the krb5 family. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Günther Deschner <gdeschner@redhat.com>
* Use token wrapper in gpp_remote_lo_local_ctxSimo Sorce2013-03-221-4/+39
| | | | | We need to do the wrapping in order to get back an actual local context. Otherwise we get back an interposed context from gssapi.
* Create helper function to wrap tokenSimo Sorce2013-03-223-20/+34
| | | | Wrap the token in a helper function so that the code can be reused elsewhere.
* Fix gssi_context_time for remote calls.Günther Deschner2013-03-141-4/+3
| | | | | | lifetime is alredy returned as remaining seconds of lifetime. Signed-off-by: Simo Sorce <simo@redhat.com>
* Fix gssi_import_sec_context_by_mech()Günther Deschner2013-03-141-1/+1
| | | | | | Use spmech->length as we are replacing the original oid with spmech. Signed-off-by: Simo Sorce <simo@redhat.com>
* mechglue: add trace debuggingGünther Deschner2013-03-1411-0/+131
| | | | | | This is enabled via --with-gssidebug. Signed-off-by: Simo Sorce <simo@redhat.com>
* mechglue: initialize gpp cred_handle in gssi_acquire_cred_with_password().Günther Deschner2013-02-221-1/+1
|
* mechglue: fix gssi_set_cred_option() arguments.Günther Deschner2013-02-222-4/+4
|
* interposer-plugin: Fix MIT 1.11 gssi_import_sec_context_by_mech symbol name.Günther Deschner2013-02-152-8/+8
|
* Change interposer usage, clients need to set GSS_USE_PROXY=1|YES.Günther Deschner2013-01-151-2/+5
| | | | | | The variable _GSSPROXY_LOOPS has been changed in favor of GSS_USE_PROXY. From now on, applications needs to explicitly enable the usage of the gssproxy interposer inception.
* Implement export_name_compositeGünther Deschner2012-10-252-0/+28
|
* Implement internal_release_oidSimo Sorce2012-10-252-0/+27
|
* Implement misc spi callsSimo Sorce2012-10-252-0/+218
|
* Implement privacy/integrity mechglue wrappersSimo Sorce2012-10-252-0/+420
|
* Implement indicate mechs related mechglue wrappersSimo Sorce2012-10-252-0/+217
|
* Implement name related mechglue wrappersSimo Sorce2012-10-252-0/+456
|
* Implement display status mechglue wrappersSimo Sorce2012-10-252-0/+75
|
* Implement init sec context mechglue wrapperSimo Sorce2012-10-252-0/+226
|
* Implement accept sec context mechglue wrappersSimo Sorce2012-10-252-0/+167
|
* Implement context related mechglue wrappersSimo Sorce2012-10-252-0/+460
| | | | | Use the new spi call in order to be able to properly implement a context locally.
* Implement cred related mechglue wrappersSimo Sorce2012-10-253-0/+831
|
* Add name handle wrapperSimo Sorce2012-10-252-0/+71
|
* Add context handle wrapperSimo Sorce2012-10-251-0/+5
|
* Add cred handle wrapperSimo Sorce2012-10-251-0/+5
|
* Add function to ease copying oidsSimo Sorce2012-10-252-0/+25
|
* Add function to convert remote context to localSimo Sorce2012-10-252-0/+18
|