diff options
author | Simo Sorce <simo@redhat.com> | 2012-07-31 23:51:41 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-08-28 08:25:52 +0200 |
commit | 034348652936efcae423d3b1bd4d9729bb68c712 (patch) | |
tree | 7b8240d3d24b231c31c0a6a1cd0ff1e6a39d6f0a | |
parent | ba2854952c59a6ffc9d2529f2b76934b7f9c5f90 (diff) | |
download | gss-proxy-034348652936efcae423d3b1bd4d9729bb68c712.tar.gz gss-proxy-034348652936efcae423d3b1bd4d9729bb68c712.tar.xz gss-proxy-034348652936efcae423d3b1bd4d9729bb68c712.zip |
Add function to convert remote context to local
-rw-r--r-- | proxy/src/mechglue/gss_plugin.c | 16 | ||||
-rw-r--r-- | proxy/src/mechglue/gss_plugin.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gss_plugin.c b/proxy/src/mechglue/gss_plugin.c index fcb3010..0c990ad 100644 --- a/proxy/src/mechglue/gss_plugin.c +++ b/proxy/src/mechglue/gss_plugin.c @@ -347,6 +347,22 @@ 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; +} + /* gssi_acquire_cred gssi_release_cred diff --git a/proxy/src/mechglue/gss_plugin.h b/proxy/src/mechglue/gss_plugin.h index f16bc95..0f0759f 100644 --- a/proxy/src/mechglue/gss_plugin.h +++ b/proxy/src/mechglue/gss_plugin.h @@ -44,5 +44,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 /* _GGS_PLUGIN_H_ */ |