diff options
Diffstat (limited to 'proxy')
-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 f6757a1..d1d5ec7 100644 --- a/proxy/src/mechglue/gss_plugin.c +++ b/proxy/src/mechglue/gss_plugin.c @@ -381,3 +381,27 @@ 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; +} 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_ */ |