set minor_status

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@5857 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1999-04-07 12:09:50 +00:00
parent 4c55325e92
commit 9bef97b773
4 changed files with 354 additions and 324 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998 Kungliga Tekniska H<>gskolan
* Copyright (c) 1998, 1999 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -114,12 +114,16 @@ OM_uint32 gss_display_status
asprintf (&buf, "%s %s",
calling_error(GSS_CALLING_ERROR(status_value)),
routine_error(GSS_ROUTINE_ERROR(status_value)));
if (buf == NULL)
if (buf == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
} else if (status_type == GSS_C_MECH_CODE) {
buf = strdup(krb5_get_err_text (gssapi_krb5_context, status_value));
if (buf == NULL)
if (buf == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
} else
return GSS_S_BAD_STATUS;

View File

@@ -72,12 +72,13 @@ init_auth
outbuf.length = 0;
outbuf.data = NULL;
*minor_status = 0;
*context_handle = malloc(sizeof(**context_handle));
if (*context_handle == NULL)
if (*context_handle == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
(*context_handle)->auth_context = NULL;
(*context_handle)->source = NULL;
@@ -88,6 +89,7 @@ init_auth
kret = krb5_auth_con_init (gssapi_krb5_context,
&(*context_handle)->auth_context);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -132,6 +134,7 @@ init_auth
kret = krb5_cc_default (gssapi_krb5_context, &ccache);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -140,6 +143,7 @@ init_auth
ccache,
&(*context_handle)->source);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -148,6 +152,7 @@ init_auth
target_name,
&(*context_handle)->target);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -156,7 +161,7 @@ init_auth
this_cred.client = (*context_handle)->source;
this_cred.server = (*context_handle)->target;
this_cred.times.endtime = 0;
this_cred.session.keytype = KEYTYPE_DES;
this_cred.session.keytype = ETYPE_DES_CBC_CRC;
kret = krb5_get_credentials (gssapi_krb5_context,
KRB5_TC_MATCH_KEYTYPE,
@@ -165,6 +170,7 @@ init_auth
&cred);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -177,6 +183,7 @@ init_auth
flags,
&cksum);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -206,6 +213,7 @@ init_auth
&authenticator);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -218,6 +226,7 @@ init_auth
&outbuf);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -225,8 +234,10 @@ init_auth
ret = gssapi_krb5_encapsulate (&outbuf,
output_token,
"\x01\x00");
if (ret)
if (ret) {
*minor_status = kret;
goto failure;
}
if (flags & GSS_C_MUTUAL_FLAG) {
return GSS_S_CONTINUE_NEEDED;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998 Kungliga Tekniska H<>gskolan
* Copyright (c) 1998, 1999 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -114,12 +114,16 @@ OM_uint32 gss_display_status
asprintf (&buf, "%s %s",
calling_error(GSS_CALLING_ERROR(status_value)),
routine_error(GSS_ROUTINE_ERROR(status_value)));
if (buf == NULL)
if (buf == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
} else if (status_type == GSS_C_MECH_CODE) {
buf = strdup(krb5_get_err_text (gssapi_krb5_context, status_value));
if (buf == NULL)
if (buf == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
} else
return GSS_S_BAD_STATUS;

View File

@@ -72,12 +72,13 @@ init_auth
outbuf.length = 0;
outbuf.data = NULL;
*minor_status = 0;
*context_handle = malloc(sizeof(**context_handle));
if (*context_handle == NULL)
if (*context_handle == NULL) {
*minor_status = ENOMEM;
return GSS_S_FAILURE;
}
(*context_handle)->auth_context = NULL;
(*context_handle)->source = NULL;
@@ -88,6 +89,7 @@ init_auth
kret = krb5_auth_con_init (gssapi_krb5_context,
&(*context_handle)->auth_context);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -132,6 +134,7 @@ init_auth
kret = krb5_cc_default (gssapi_krb5_context, &ccache);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -140,6 +143,7 @@ init_auth
ccache,
&(*context_handle)->source);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -148,6 +152,7 @@ init_auth
target_name,
&(*context_handle)->target);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -156,7 +161,7 @@ init_auth
this_cred.client = (*context_handle)->source;
this_cred.server = (*context_handle)->target;
this_cred.times.endtime = 0;
this_cred.session.keytype = KEYTYPE_DES;
this_cred.session.keytype = ETYPE_DES_CBC_CRC;
kret = krb5_get_credentials (gssapi_krb5_context,
KRB5_TC_MATCH_KEYTYPE,
@@ -165,6 +170,7 @@ init_auth
&cred);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -177,6 +183,7 @@ init_auth
flags,
&cksum);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -206,6 +213,7 @@ init_auth
&authenticator);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -218,6 +226,7 @@ init_auth
&outbuf);
if (kret) {
*minor_status = kret;
ret = GSS_S_FAILURE;
goto failure;
}
@@ -225,8 +234,10 @@ init_auth
ret = gssapi_krb5_encapsulate (&outbuf,
output_token,
"\x01\x00");
if (ret)
if (ret) {
*minor_status = kret;
goto failure;
}
if (flags & GSS_C_MUTUAL_FLAG) {
return GSS_S_CONTINUE_NEEDED;