summaryrefslogtreecommitdiffstats
path: root/proxy/src
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-07-31 23:51:41 -0400
committerSimo Sorce <simo@redhat.com>2012-10-25 15:53:12 -0400
commit74349afbc53e1e8746a920d97183209ef97cc16f (patch)
treea746bad31c4f07cae8412802bb18ce2062193cd5 /proxy/src
parentef9cf5483a5716af2e6342b6ad92f3bf1504dea0 (diff)
downloadgss-proxy-74349afbc53e1e8746a920d97183209ef97cc16f.tar.gz
gss-proxy-74349afbc53e1e8746a920d97183209ef97cc16f.tar.xz
gss-proxy-74349afbc53e1e8746a920d97183209ef97cc16f.zip
Add function to convert remote context to local
Diffstat (limited to 'proxy/src')
-rw-r--r--proxy/src/mechglue/gss_plugin.c16
-rw-r--r--proxy/src/mechglue/gss_plugin.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gss_plugin.c b/proxy/src/mechglue/gss_plugin.c
index f573e12..f6757a1 100644
--- a/proxy/src/mechglue/gss_plugin.c
+++ b/proxy/src/mechglue/gss_plugin.c
@@ -365,3 +365,19 @@ uint32_t gpp_unmap_error(uint32_t err)
}
return err;
}
+
+uint32_t gpp_remote_to_local_ctx(uint32_t *minor, gssx_ctx **remote_ctx,
+ gss_ctx_id_t *local_ctx)
+{
+ gss_buffer_desc buf;
+ uint32_t maj;
+
+ gp_conv_gssx_to_buffer(&(*remote_ctx)->exported_context_token, &buf);
+
+ maj = gss_import_sec_context(minor, &buf, local_ctx);
+
+ xdr_free((xdrproc_t)xdr_gssx_ctx, (char *)(*remote_ctx));
+ *remote_ctx = NULL;
+
+ return maj;
+}
diff --git a/proxy/src/mechglue/gss_plugin.h b/proxy/src/mechglue/gss_plugin.h
index f57fa4c..9be4f3a 100644
--- a/proxy/src/mechglue/gss_plugin.h
+++ b/proxy/src/mechglue/gss_plugin.h
@@ -45,5 +45,7 @@ const gss_OID gpp_special_mech(const gss_OID mech_type);
gss_OID_set gpp_special_available_mechs(const gss_OID_set mechs);
uint32_t gpp_map_error(uint32_t err);
uint32_t gpp_unmap_error(uint32_t err);
+uint32_t gpp_remote_to_local_ctx(uint32_t *minor, gssx_ctx **remote_ctx,
+ gss_ctx_id_t *local_ctx);
#endif /* _GSS_PLUGIN_H_ */