diff options
author | Simo Sorce <simo@redhat.com> | 2012-09-05 21:59:52 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-09-14 16:26:37 -0400 |
commit | 8d914f4a22082eb54ef76ec63a0d5ba05e8aaf2d (patch) | |
tree | 78640c0f58159d4670656eb08e790c5396330fe5 /proxy/src | |
parent | f3d21a3835bdc6027e7385a0463d8a8c731ba9f6 (diff) | |
download | gss-proxy-8d914f4a22082eb54ef76ec63a0d5ba05e8aaf2d.tar.gz gss-proxy-8d914f4a22082eb54ef76ec63a0d5ba05e8aaf2d.tar.xz gss-proxy-8d914f4a22082eb54ef76ec63a0d5ba05e8aaf2d.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 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_ */ |