summaryrefslogtreecommitdiffstats
path: root/proxy/src/gp_export.c
diff options
context:
space:
mode:
authorGünther Deschner <gdeschner@redhat.com>2012-06-25 12:09:47 +0200
committerSimo Sorce <simo@redhat.com>2012-06-25 17:13:21 -0400
commit889c081ca6acda82b77d0accb2f59413767397bf (patch)
tree75dbfdeef61d4c90685d2d5ab9724fcab7c5b769 /proxy/src/gp_export.c
parent8ff4a02c7876a1a139c1d9fb446d4d00a586a258 (diff)
downloadgss-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/gp_export.c')
-rw-r--r--proxy/src/gp_export.c28
1 files changed, 28 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 */