diff options
Diffstat (limited to 'proxy/src/gp_conv.c')
-rw-r--r-- | proxy/src/gp_conv.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/proxy/src/gp_conv.c b/proxy/src/gp_conv.c index 0eab8e7..a4b8fa0 100644 --- a/proxy/src/gp_conv.c +++ b/proxy/src/gp_conv.c @@ -340,6 +340,7 @@ uint32_t gp_conv_name_to_gssx(uint32_t *min, gss_name_t in, gssx_name *out) gss_buffer_desc name_buffer = GSS_C_EMPTY_BUFFER; gss_OID name_type; gss_buffer_desc exported_name = GSS_C_EMPTY_BUFFER; + gss_buffer_desc exported_composite_name = GSS_C_EMPTY_BUFFER; int ret; ret_maj = gss_display_name(&ret_min, in, &name_buffer, &name_type); @@ -377,17 +378,37 @@ uint32_t gp_conv_name_to_gssx(uint32_t *min, gss_name_t in, gssx_name *out) } } - /* out->exported_composite_name */ + ret_maj = gss_export_name_composite(&ret_min, in, &exported_composite_name); + if (ret_maj == 0) { + ret = gp_conv_buffer_to_gssx(&exported_composite_name, &out->exported_composite_name); + if (ret) { + ret_maj = GSS_S_FAILURE; + ret_min = ret; + goto done; + } + } else { + /* In case the error is GSS_S_NAME_NOT_MN the name was not + * canonicalized but that is ok we simply do not export the name + * in this case */ + if (ret_maj != GSS_S_NAME_NOT_MN) { + goto done; + } + } + + ret_maj = GSS_S_COMPLETE; + /* out->name_attributes */ done: *min = ret_min; gss_release_buffer(&ret_min, &name_buffer); gss_release_buffer(&ret_min, &exported_name); + gss_release_buffer(&ret_min, &exported_composite_name); if (ret_maj) { xdr_free((xdrproc_t)xdr_gssx_buffer, (char *)&out->display_name); xdr_free((xdrproc_t)xdr_gssx_OID, (char *)&out->name_type); xdr_free((xdrproc_t)xdr_gssx_buffer, (char *)&out->exported_name); + xdr_free((xdrproc_t)xdr_gssx_buffer, (char *)&out->exported_composite_name); } return ret_maj; } |