summaryrefslogtreecommitdiffstats
path: root/proxy/src/gp_conv.c
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-03-22 01:18:19 -0400
committerSimo Sorce <simo@redhat.com>2012-04-15 15:00:49 -0400
commit9c6e6122208d1ebfc0d1edbb79dd3ae71e368c60 (patch)
treef14835e6de5e9cbd178e4641eed066c8052ef62c /proxy/src/gp_conv.c
parent781d0f14cc295cee0973337f81fa7d2598ff8359 (diff)
downloadgss-proxy-9c6e6122208d1ebfc0d1edbb79dd3ae71e368c60.tar.gz
gss-proxy-9c6e6122208d1ebfc0d1edbb79dd3ae71e368c60.tar.xz
gss-proxy-9c6e6122208d1ebfc0d1edbb79dd3ae71e368c60.zip
Move ctx_id function and add export type option
Move the function to export a context to gssx_ctx or import into gp_export.c Add function to check for exported_context_type option in call_ctx
Diffstat (limited to 'proxy/src/gp_conv.c')
-rw-r--r--proxy/src/gp_conv.c103
1 files changed, 0 insertions, 103 deletions
diff --git a/proxy/src/gp_conv.c b/proxy/src/gp_conv.c
index d87a45b..0eab8e7 100644
--- a/proxy/src/gp_conv.c
+++ b/proxy/src/gp_conv.c
@@ -462,109 +462,6 @@ done:
return ret_maj;
}
-uint32_t gp_conv_ctx_id_to_gssx(uint32_t *min, gss_ctx_id_t *in, gssx_ctx *out)
-{
- uint32_t ret_maj;
- uint32_t ret_min;
- gss_name_t src_name = GSS_C_NO_NAME;
- gss_name_t targ_name = GSS_C_NO_NAME;
- gss_buffer_desc export_buffer = GSS_C_EMPTY_BUFFER;
- uint32_t lifetime_rec;
- gss_OID mech_type;
- uint32_t ctx_flags;
- int is_locally_initiated;
- int is_open;
- int ret;
-
- /* TODO: For mechs that need multiple roundtrips to complete */
- /* out->state; */
-
- /* we do not need the client to release anything nutil we handle state */
- out->needs_release = false;
-
- ret_maj = gss_inquire_context(&ret_min, *in, &src_name, &targ_name,
- &lifetime_rec, &mech_type, &ctx_flags,
- &is_locally_initiated, &is_open);
- if (ret_maj) {
- goto done;
- }
-
- ret = gp_conv_oid_to_gssx(mech_type, &out->mech);
- if (ret) {
- ret_maj = GSS_S_FAILURE;
- ret_min = ret;
- goto done;
- }
-
- ret_maj = gp_conv_name_to_gssx(&ret_min, src_name, &out->src_name);
- if (ret_maj) {
- goto done;
- }
-
- ret_maj = gp_conv_name_to_gssx(&ret_min, targ_name, &out->targ_name);
- if (ret_maj) {
- goto done;
- }
-
- out->lifetime = lifetime_rec;
-
- out->ctx_flags = ctx_flags;
-
- if (is_locally_initiated) {
- out->locally_initiated = true;
- }
-
- if (is_open) {
- out->open = true;
- }
-
- /* note: once converted the original context token is not usable anymore,
- * so this must be the last call to use it */
- ret_maj = gss_export_sec_context(&ret_min, in, &export_buffer);
- if (ret_maj) {
- ret_maj = GSS_S_FAILURE;
- ret_min = ENOMEM;
- goto done;
- }
- ret = gp_conv_buffer_to_gssx(&export_buffer, &out->exported_context_token);
- if (ret) {
- ret_maj = GSS_S_FAILURE;
- ret_min = ret;
- goto done;
- }
-
- /* Leave this empty, used only on the way in for init_sec_context */
- /* out->gssx_option */
-
-done:
- *min = ret_min;
- gss_release_name(&ret_min, &src_name);
- gss_release_name(&ret_min, &targ_name);
- gss_release_buffer(&ret_min, &export_buffer);
- if (ret_maj) {
- xdr_free((xdrproc_t)xdr_gssx_OID, (char *)&out->mech);
- xdr_free((xdrproc_t)xdr_gssx_name, (char *)&out->src_name);
- xdr_free((xdrproc_t)xdr_gssx_name, (char *)&out->targ_name);
- }
- return ret_maj;
-}
-
-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)