diff options
author | Günther Deschner <gdeschner@redhat.com> | 2012-06-25 12:09:47 +0200 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-06-25 17:13:21 -0400 |
commit | 889c081ca6acda82b77d0accb2f59413767397bf (patch) | |
tree | 75dbfdeef61d4c90685d2d5ab9724fcab7c5b769 /proxy/src | |
parent | 8ff4a02c7876a1a139c1d9fb446d4d00a586a258 (diff) | |
download | gss-proxy-889c081ca6acda82b77d0accb2f59413767397bf.tar.gz gss-proxy-889c081ca6acda82b77d0accb2f59413767397bf.tar.xz gss-proxy-889c081ca6acda82b77d0accb2f59413767397bf.zip |
Add gp_find_and_free_cred().
Guenther
Signed-off-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'proxy/src')
-rw-r--r-- | proxy/src/gp_export.c | 28 | ||||
-rw-r--r-- | proxy/src/gp_export.h | 2 |
2 files changed, 30 insertions, 0 deletions
diff --git a/proxy/src/gp_export.c b/proxy/src/gp_export.c index 74438da..35b40dd 100644 --- a/proxy/src/gp_export.c +++ b/proxy/src/gp_export.c @@ -449,6 +449,34 @@ int gp_find_cred(struct gp_service *svc, return gp_import_gssx_cred(ring_buffer, &handle, out); } +int gp_find_and_free_cred(struct gp_service *svc, + gssx_cred *cred) +{ + struct gp_ring_buffer *ring_buffer; + struct gp_credential_handle handle; + gss_cred_id_t gss_cred; + int ret; + + ring_buffer = gp_service_get_ring_buffer(svc); + if (!ring_buffer) { + return EINVAL; + } + + ret = gp_conv_octet_string_to_cred_handle(&cred->cred_handle_reference, + &handle); + if (ret) { + return ret; + } + + ret = gp_import_gssx_cred(ring_buffer, &handle, &gss_cred); + if (ret) { + return ret; + } + + gp_free_ring_buffer_cred(ring_buffer->creds[handle.index]); + + return 0; +} /* Exported Contexts */ diff --git a/proxy/src/gp_export.h b/proxy/src/gp_export.h index 9f18956..5606c65 100644 --- a/proxy/src/gp_export.h +++ b/proxy/src/gp_export.h @@ -35,6 +35,8 @@ uint32_t gp_export_gssx_cred(uint32_t *min, struct gp_service *svc, gss_cred_id_t *in, gssx_cred *out); int gp_find_cred(struct gp_service *svc, gssx_cred *cred, gss_cred_id_t *out); +int gp_find_and_free_cred(struct gp_service *svc, + gssx_cred *cred); int gp_get_exported_context_type(struct gssx_call_ctx *ctx); uint32_t gp_export_ctx_id_to_gssx(uint32_t *min, int type, |