diff options
author | Simo Sorce <simo@redhat.com> | 2012-05-17 00:40:30 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-08-31 16:26:38 -0400 |
commit | b9f8c9b5477ad12ffbd377a4d0f16133882f88f5 (patch) | |
tree | 34a0e5709bf33693e880901830a485410ef6298f /proxy/src | |
parent | 91213a899c4b577fb93d652065d02519a7f19398 (diff) | |
download | gss-proxy-b9f8c9b5477ad12ffbd377a4d0f16133882f88f5.tar.gz gss-proxy-b9f8c9b5477ad12ffbd377a4d0f16133882f88f5.tar.xz gss-proxy-b9f8c9b5477ad12ffbd377a4d0f16133882f88f5.zip |
Fix gpm_display_status
Fix some assumptions in gpm_display_status and make it clearly state
no error is available, when we do not have one. This is so that the plugin
code later on will know when to properly fall back to ask to the local
provider.
Diffstat (limited to 'proxy/src')
-rw-r--r-- | proxy/src/mechglue/gpm_display_status.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/proxy/src/mechglue/gpm_display_status.c b/proxy/src/mechglue/gpm_display_status.c index 633b18a..7f8f247 100644 --- a/proxy/src/mechglue/gpm_display_status.c +++ b/proxy/src/mechglue/gpm_display_status.c @@ -58,6 +58,7 @@ OM_uint32 gpm_display_status(OM_uint32 *minor_status, switch(status_type) { case GSS_C_GSS_CODE: if (tls_last_status && + tls_last_status->major_status == status_value && tls_last_status->major_status_string.utf8string_len) { ret = gp_copy_utf8string(&tls_last_status->major_status_string, &tmp); @@ -70,21 +71,20 @@ OM_uint32 gpm_display_status(OM_uint32 *minor_status, *minor_status = 0; return GSS_S_COMPLETE; } else { - return gss_display_status(minor_status, - status_value, - GSS_C_GSS_CODE, - GSS_C_NO_OID, - message_context, - status_string); + /* if we do not have it, make it clear */ + return GSS_S_UNAVAILABLE; } case GSS_C_MECH_CODE: - if (*message_context) { - /* we do not support multiple messages for now */ - *minor_status = EINVAL; - return GSS_S_FAILURE; - } if (tls_last_status && + tls_last_status->minor_status == status_value && tls_last_status->minor_status_string.utf8string_len) { + + if (*message_context) { + /* we do not support multiple messages for now */ + *minor_status = EINVAL; + return GSS_S_FAILURE; + } + ret = gp_copy_utf8string(&tls_last_status->minor_status_string, &tmp); if (ret) { @@ -94,14 +94,8 @@ OM_uint32 gpm_display_status(OM_uint32 *minor_status, status_string->value = tmp.utf8string_val; status_string->length = tmp.utf8string_len; } else { - status_string->value = strdup(strerror(status_value)); - if (!status_string->value) { - status_string->length = 0; - *minor_status = ENOMEM; - return GSS_S_FAILURE; - } else { - status_string->length = strlen(status_string->value) + 1; - } + /* if we do not have it, make it clear */ + return GSS_S_UNAVAILABLE; } *minor_status = 0; return GSS_S_COMPLETE; |