diff options
author | Simo Sorce <simo@redhat.com> | 2012-02-09 01:31:30 -0500 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-02-09 01:36:07 -0500 |
commit | 0b357211ddfbcd0d6c9ea837b2975c69932903be (patch) | |
tree | a9d5f36331c007bc1535038e581c67c7379d4b0f /proxy | |
parent | 68ec1c0cfe7cd0e24fb6504808ddd0160c22c1e3 (diff) | |
download | gss-proxy-0b357211ddfbcd0d6c9ea837b2975c69932903be.tar.gz gss-proxy-0b357211ddfbcd0d6c9ea837b2975c69932903be.tar.xz gss-proxy-0b357211ddfbcd0d6c9ea837b2975c69932903be.zip |
gp_conv: Add function to import sec context
Diffstat (limited to 'proxy')
-rw-r--r-- | proxy/src/gp_conv.c | 16 | ||||
-rw-r--r-- | proxy/src/gp_conv.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/proxy/src/gp_conv.c b/proxy/src/gp_conv.c index 7855203..07d66c2 100644 --- a/proxy/src/gp_conv.c +++ b/proxy/src/gp_conv.c @@ -538,6 +538,22 @@ done: return ret; } +int gp_conv_gssx_to_ctx_id(gssx_ctx *in, gss_ctx_id_t *out) +{ + gss_buffer_desc export_buffer = GSS_C_EMPTY_BUFFER; + uint32_t ret_maj; + uint32_t ret_min; + + gp_conv_gssx_to_buffer(in->exported_context_token, &export_buffer); + + ret_maj = gss_import_sec_context(&ret_min, &export_buffer, out); + if (ret_maj) { + return EINVAL; + } + + return 0; +} + int gp_conv_status_to_gssx(struct gssx_call_ctx *call_ctx, uint32_t ret_maj, uint32_t ret_min, gss_OID mech, struct gssx_status *status) diff --git a/proxy/src/gp_conv.h b/proxy/src/gp_conv.h index 68e1b3a..3a8f952 100644 --- a/proxy/src/gp_conv.h +++ b/proxy/src/gp_conv.h @@ -60,6 +60,7 @@ int gp_conv_name_to_gssx_alloc(gss_name_t in, gssx_name **out); int gp_conv_gssx_to_name(gssx_name *in, gss_name_t *out); int gp_conv_ctx_id_to_gssx(gss_ctx_id_t *in, gssx_ctx *out); +int gp_conv_gssx_to_ctx_id(gssx_ctx *in, gss_ctx_id_t *out); int gp_conv_status_to_gssx(struct gssx_call_ctx *call_ctx, uint32_t ret_maj, uint32_t ret_min, |