diff options
author | Günther Deschner <gdeschner@redhat.com> | 2012-06-18 13:54:36 +0200 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-06-25 17:00:45 -0400 |
commit | 2c1530def138a8a1caaf82d31b93994090406e80 (patch) | |
tree | c934caa0b1afe0b6f5070ce077520b79b6ec4eef | |
parent | 594f96fb6c612fb60da72f84615b1406f2be01e9 (diff) | |
download | gss-proxy-2c1530def138a8a1caaf82d31b93994090406e80.tar.gz gss-proxy-2c1530def138a8a1caaf82d31b93994090406e80.tar.xz gss-proxy-2c1530def138a8a1caaf82d31b93994090406e80.zip |
Pass down struct gp_service to import and export credential calls.
Guenther
Signed-off-by: Simo Sorce <simo@redhat.com>
-rw-r--r-- | proxy/src/gp_export.c | 5 | ||||
-rw-r--r-- | proxy/src/gp_export.h | 5 | ||||
-rw-r--r-- | proxy/src/gp_rpc_accept_sec_context.c | 3 | ||||
-rw-r--r-- | proxy/src/gp_rpc_acquire_cred.c | 5 | ||||
-rw-r--r-- | proxy/src/gp_rpc_init_sec_context.c | 2 | ||||
-rw-r--r-- | proxy/src/gp_rpc_release_handle.c | 2 |
6 files changed, 15 insertions, 7 deletions
diff --git a/proxy/src/gp_export.c b/proxy/src/gp_export.c index 93f3460..8b9ee24 100644 --- a/proxy/src/gp_export.c +++ b/proxy/src/gp_export.c @@ -31,6 +31,7 @@ #include "gp_conv.h" #include "gp_export.h" #include "gp_debug.h" +#include "gp_proxy.h" #include <gssapi/gssapi_krb5.h> #include <pwd.h> #include <grp.h> @@ -254,6 +255,7 @@ static uint32_t gp_read_gss_creds_from_ring_buffer(uint32_t *min, } uint32_t gp_export_gssx_cred(uint32_t *min, + struct gp_service *svc, gss_cred_id_t *in, gssx_cred *out) { uint32_t ret_maj; @@ -365,7 +367,8 @@ int gp_import_gssx_cred(octet_string *in, gss_cred_id_t *out) return 0; } -int gp_find_cred(gssx_cred *cred, gss_cred_id_t *out) +int gp_find_cred(struct gp_service *svc, + gssx_cred *cred, gss_cred_id_t *out) { return gp_import_gssx_cred(&cred->cred_handle_reference, out); } diff --git a/proxy/src/gp_export.h b/proxy/src/gp_export.h index 91d904c..0bf76b5 100644 --- a/proxy/src/gp_export.h +++ b/proxy/src/gp_export.h @@ -29,10 +29,13 @@ #include <gssapi/gssapi.h> #include "rpcgen/gss_proxy.h" +struct gp_service; + uint32_t gp_export_gssx_cred(uint32_t *min, + struct gp_service *svc, gss_cred_id_t *in, gssx_cred *out); int gp_import_gssx_cred(octet_string *in, gss_cred_id_t *out); -int gp_find_cred(gssx_cred *cred, gss_cred_id_t *out); +int gp_find_cred(struct gp_service *svc, gssx_cred *cred, gss_cred_id_t *out); int gp_get_exported_context_type(struct gssx_call_ctx *ctx); uint32_t gp_export_ctx_id_to_gssx(uint32_t *min, int type, diff --git a/proxy/src/gp_rpc_accept_sec_context.c b/proxy/src/gp_rpc_accept_sec_context.c index 53ff5dc..eb93471 100644 --- a/proxy/src/gp_rpc_accept_sec_context.c +++ b/proxy/src/gp_rpc_accept_sec_context.c @@ -67,7 +67,7 @@ int gp_accept_sec_context(struct gssproxy_ctx *gpctx, } if (asca->cred_handle) { - ret = gp_find_cred(asca->cred_handle, &ach); + ret = gp_find_cred(gpsvc, asca->cred_handle, &ach); if (ret) { ret_maj = GSS_S_NO_CRED; ret_min = ret; @@ -148,6 +148,7 @@ int gp_accept_sec_context(struct gssproxy_ctx *gpctx, goto done; } ret_maj = gp_export_gssx_cred(&ret_min, + gpsvc, &dch, ascr->delegated_cred_handle); if (ret_maj) { goto done; diff --git a/proxy/src/gp_rpc_acquire_cred.c b/proxy/src/gp_rpc_acquire_cred.c index 4940ad7..31e6346 100644 --- a/proxy/src/gp_rpc_acquire_cred.c +++ b/proxy/src/gp_rpc_acquire_cred.c @@ -50,7 +50,7 @@ int gp_acquire_cred(struct gssproxy_ctx *gpctx, acr = &res->acquire_cred; if (aca->input_cred_handle) { - ret = gp_find_cred(aca->input_cred_handle, &in_cred); + ret = gp_find_cred(gpsvc, aca->input_cred_handle, &in_cred); if (ret) { ret_maj = GSS_S_NO_CRED; ret_min = ret; @@ -171,7 +171,8 @@ int gp_acquire_cred(struct gssproxy_ctx *gpctx, ret_min = ENOMEM; goto done; } - ret_maj = gp_export_gssx_cred(&ret_min, &out_cred, acr->output_cred_handle); + ret_maj = gp_export_gssx_cred(&ret_min, gpsvc, + &out_cred, acr->output_cred_handle); if (ret_maj) { goto done; } diff --git a/proxy/src/gp_rpc_init_sec_context.c b/proxy/src/gp_rpc_init_sec_context.c index 76ade3a..474ace0 100644 --- a/proxy/src/gp_rpc_init_sec_context.c +++ b/proxy/src/gp_rpc_init_sec_context.c @@ -67,7 +67,7 @@ int gp_init_sec_context(struct gssproxy_ctx *gpctx, } if (isca->cred_handle) { - ret = gp_find_cred(isca->cred_handle, &ich); + ret = gp_find_cred(gpsvc, isca->cred_handle, &ich); if (ret) { ret_maj = GSS_S_NO_CRED; ret_min = ret; diff --git a/proxy/src/gp_rpc_release_handle.c b/proxy/src/gp_rpc_release_handle.c index a25458c..0a59872 100644 --- a/proxy/src/gp_rpc_release_handle.c +++ b/proxy/src/gp_rpc_release_handle.c @@ -48,7 +48,7 @@ int gp_release_handle(struct gssproxy_ctx *gpctx, ret_min = 0; break; case GSSX_C_HANDLE_CRED: - ret = gp_find_cred(&rha->cred_handle.gssx_handle_u.cred_info, &cred); + ret = gp_find_cred(gpsvc, &rha->cred_handle.gssx_handle_u.cred_info, &cred); if (ret) { ret_maj = GSS_S_UNAVAILABLE; ret_min = 0; |