sprinkel _gss_mg_error
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19928 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -227,7 +227,10 @@ OM_uint32 gss_accept_sec_context(OM_uint32 *minor_status,
|
||||
&delegated_mc);
|
||||
if (major_status != GSS_S_COMPLETE &&
|
||||
major_status != GSS_S_CONTINUE_NEEDED)
|
||||
{
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
return (major_status);
|
||||
}
|
||||
|
||||
if (!src_name) {
|
||||
m->gm_release_name(minor_status, &src_mn);
|
||||
|
@@ -43,8 +43,10 @@ _gss_copy_cred(struct _gss_mechanism_cred *mc)
|
||||
major_status = m->gm_inquire_cred_by_mech(&minor_status,
|
||||
mc->gmc_cred, mc->gmc_mech_oid,
|
||||
&name, &initiator_lifetime, &acceptor_lifetime, &cred_usage);
|
||||
if (major_status)
|
||||
if (major_status) {
|
||||
_gss_mg_error(m, major_status, minor_status);
|
||||
return (0);
|
||||
}
|
||||
|
||||
major_status = m->gm_add_cred(&minor_status,
|
||||
GSS_C_NO_CREDENTIAL, name, mc->gmc_mech_oid,
|
||||
@@ -52,8 +54,10 @@ _gss_copy_cred(struct _gss_mechanism_cred *mc)
|
||||
&cred, 0, 0, 0);
|
||||
m->gm_release_name(&minor_status, &name);
|
||||
|
||||
if (major_status)
|
||||
if (major_status) {
|
||||
_gss_mg_error(m, major_status, minor_status);
|
||||
return (0);
|
||||
}
|
||||
|
||||
new_mc = malloc(sizeof(struct _gss_mechanism_cred));
|
||||
if (!new_mc) {
|
||||
@@ -162,6 +166,7 @@ gss_add_cred(OM_uint32 *minor_status,
|
||||
acceptor_time_rec);
|
||||
|
||||
if (major_status) {
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
release_cred = (gss_cred_id_t)new_cred;
|
||||
gss_release_cred(&junk, &release_cred);
|
||||
free(mc);
|
||||
|
@@ -52,8 +52,10 @@ gss_canonicalize_name(OM_uint32 *minor_status,
|
||||
m = mn->gmn_mech;
|
||||
major_status = m->gm_canonicalize_name(minor_status,
|
||||
mn->gmn_name, mech_type, &new_canonical_name);
|
||||
if (major_status)
|
||||
if (major_status) {
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
return (major_status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we make a new name and mark it as an MN.
|
||||
|
@@ -67,6 +67,8 @@ gss_export_sec_context(OM_uint32 *minor_status,
|
||||
memcpy(p + 2, m->gm_mech_oid.elements, m->gm_mech_oid.length);
|
||||
memcpy(p + 2 + m->gm_mech_oid.length, buf.value, buf.length);
|
||||
gss_release_buffer(minor_status, &buf);
|
||||
} else {
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
}
|
||||
|
||||
return (major_status);
|
||||
|
@@ -119,6 +119,10 @@ _gss_import_export_name(OM_uint32 *minor_status,
|
||||
*/
|
||||
major_status = m->gm_import_name(minor_status,
|
||||
input_name_buffer, GSS_C_NT_EXPORT_NAME, &new_canonical_name);
|
||||
if (major_status != GSS_S_COMPLETE) {
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
return major_status;
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we make a new name and mark it as an MN.
|
||||
|
@@ -73,6 +73,7 @@ gss_import_sec_context(OM_uint32 *minor_status,
|
||||
major_status = m->gm_import_sec_context(minor_status,
|
||||
&buf, &ctx->gc_ctx);
|
||||
if (major_status != GSS_S_COMPLETE) {
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
free(ctx);
|
||||
} else {
|
||||
*context_handle = (gss_ctx_id_t) ctx;
|
||||
|
@@ -131,6 +131,7 @@ gss_init_sec_context(OM_uint32 * minor_status,
|
||||
&& major_status != GSS_S_CONTINUE_NEEDED) {
|
||||
if (allocated_ctx)
|
||||
free(ctx);
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
} else {
|
||||
*context_handle = (gss_ctx_id_t) ctx;
|
||||
}
|
||||
|
@@ -60,6 +60,7 @@ gss_inquire_context(OM_uint32 *minor_status,
|
||||
if (targ_name) *targ_name = 0;
|
||||
|
||||
if (major_status != GSS_S_COMPLETE) {
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
return (major_status);
|
||||
}
|
||||
|
||||
|
@@ -65,8 +65,10 @@ gss_inquire_cred_by_mech(OM_uint32 *minor_status,
|
||||
|
||||
major_status = m->gm_inquire_cred_by_mech(minor_status, mc, mech_type,
|
||||
&mn, initiator_lifetime, acceptor_lifetime, cred_usage);
|
||||
if (major_status != GSS_S_COMPLETE)
|
||||
if (major_status != GSS_S_COMPLETE) {
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
return (major_status);
|
||||
}
|
||||
|
||||
name = _gss_make_name(m, mn);
|
||||
if (!name) {
|
||||
|
@@ -58,10 +58,12 @@ gss_inquire_sec_context_by_oid (OM_uint32 *minor_status,
|
||||
if (m == NULL)
|
||||
return GSS_S_BAD_MECH;
|
||||
|
||||
if (m->gm_inquire_sec_context_by_oid != NULL)
|
||||
if (m->gm_inquire_sec_context_by_oid != NULL) {
|
||||
major_status = m->gm_inquire_sec_context_by_oid(minor_status,
|
||||
ctx->gc_ctx, desired_object, data_set);
|
||||
else
|
||||
if (major_status != GSS_S_COMPLETE)
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
} else
|
||||
major_status = GSS_S_BAD_MECH;
|
||||
|
||||
return major_status;
|
||||
|
@@ -62,7 +62,8 @@ _gss_find_mn(struct _gss_name *name, gss_OID mech)
|
||||
(name->gn_type.elements
|
||||
? &name->gn_type : GSS_C_NO_OID),
|
||||
&mn->gmn_name);
|
||||
if (major_status) {
|
||||
if (major_status != GSS_S_COMPLETE) {
|
||||
_gss_mg_error(m, major_status, minor_status);
|
||||
free(mn);
|
||||
return (0);
|
||||
}
|
||||
|
@@ -104,6 +104,9 @@ gss_set_cred_option (OM_uint32 *minor_status,
|
||||
&mc->gmc_cred, object, value);
|
||||
if (major_status == GSS_S_COMPLETE)
|
||||
one_ok = 1;
|
||||
else
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
|
||||
}
|
||||
}
|
||||
if (one_ok) {
|
||||
|
@@ -58,10 +58,12 @@ gss_set_sec_context_option (OM_uint32 *minor_status,
|
||||
if (m == NULL)
|
||||
return GSS_S_BAD_MECH;
|
||||
|
||||
if (m->gm_set_sec_context_option != NULL)
|
||||
if (m->gm_set_sec_context_option != NULL) {
|
||||
major_status = m->gm_set_sec_context_option(minor_status,
|
||||
&ctx->gc_ctx, object, value);
|
||||
else
|
||||
if (major_status != GSS_S_COMPLETE)
|
||||
_gss_mg_error(m, major_status, *minor_status);
|
||||
} else
|
||||
major_status = GSS_S_BAD_MECH;
|
||||
|
||||
return major_status;
|
||||
|
Reference in New Issue
Block a user