diff options
author | Simo Sorce <simo@redhat.com> | 2012-09-05 21:59:52 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-10-25 15:53:28 -0400 |
commit | 861a13f9f4a4e194b1a0cb9f950a28b13345317f (patch) | |
tree | 5f4cdb64ed316c1f4e55c286e84712041829e8c2 /proxy/src | |
parent | 74349afbc53e1e8746a920d97183209ef97cc16f (diff) | |
download | gss-proxy-861a13f9f4a4e194b1a0cb9f950a28b13345317f.tar.gz gss-proxy-861a13f9f4a4e194b1a0cb9f950a28b13345317f.tar.xz gss-proxy-861a13f9f4a4e194b1a0cb9f950a28b13345317f.zip |
Add function to ease copying oids
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 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_ */ |