diff options
Diffstat (limited to 'proxy/src')
-rw-r--r-- | proxy/src/mechglue/gss_plugin.c | 24 | ||||
-rw-r--r-- | proxy/src/mechglue/gss_plugin.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/proxy/src/mechglue/gss_plugin.c b/proxy/src/mechglue/gss_plugin.c index 724a008..03e219b 100644 --- a/proxy/src/mechglue/gss_plugin.c +++ b/proxy/src/mechglue/gss_plugin.c @@ -382,6 +382,30 @@ uint32_t gpp_remote_to_local_ctx(uint32_t *minor, gssx_ctx **remote_ctx, return maj; } +uint32_t gpp_copy_oid(uint32_t *minor, gss_OID in, gss_OID *out) +{ + gss_OID c; + + c = calloc(1, sizeof(gss_OID_desc)); + if (!c) { + *minor = ENOMEM; + return GSS_S_FAILURE; + } + + c->length = in->length; + c->elements = malloc(in->length); + if (!c->elements) { + free(c); + *minor = ENOMEM; + return GSS_S_FAILURE; + } + memcpy(c->elements, in->elements, in->length); + + *out = c; + *minor = 0; + return GSS_S_COMPLETE; +} + /* gssi_acquire_cred gssi_release_cred diff --git a/proxy/src/mechglue/gss_plugin.h b/proxy/src/mechglue/gss_plugin.h index 9be4f3a..ac5aa8a 100644 --- a/proxy/src/mechglue/gss_plugin.h +++ b/proxy/src/mechglue/gss_plugin.h @@ -47,5 +47,6 @@ 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); +uint32_t gpp_copy_oid(uint32_t *minor, gss_OID in, gss_OID *out); #endif /* _GSS_PLUGIN_H_ */ |