add some krb5_{set,clear}_error_string
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9937 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -58,6 +58,7 @@ verify_checksum(krb5_context context,
|
||||
|
||||
if (buf == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
goto out;
|
||||
}
|
||||
|
||||
@@ -97,15 +98,18 @@ krb5_rd_safe(krb5_context context,
|
||||
return ret;
|
||||
if (safe.pvno != 5) {
|
||||
ret = KRB5KRB_AP_ERR_BADVERSION;
|
||||
krb5_clear_error_string (context);
|
||||
goto failure;
|
||||
}
|
||||
if (safe.msg_type != krb_safe) {
|
||||
ret = KRB5KRB_AP_ERR_MSG_TYPE;
|
||||
krb5_clear_error_string (context);
|
||||
goto failure;
|
||||
}
|
||||
if (!krb5_checksum_is_keyed(context, safe.cksum.cksumtype)
|
||||
|| !krb5_checksum_is_collision_proof(context, safe.cksum.cksumtype)) {
|
||||
ret = KRB5KRB_AP_ERR_INAPP_CKSUM;
|
||||
krb5_clear_error_string (context);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@@ -117,6 +121,7 @@ krb5_rd_safe(krb5_context context,
|
||||
auth_context->remote_address,
|
||||
safe.safe_body.s_address)) {
|
||||
ret = KRB5KRB_AP_ERR_BADADDR;
|
||||
krb5_clear_error_string (context);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@@ -128,6 +133,7 @@ krb5_rd_safe(krb5_context context,
|
||||
auth_context->local_address,
|
||||
safe.safe_body.r_address)) {
|
||||
ret = KRB5KRB_AP_ERR_BADADDR;
|
||||
krb5_clear_error_string (context);
|
||||
goto failure;
|
||||
}
|
||||
|
||||
@@ -141,6 +147,7 @@ krb5_rd_safe(krb5_context context,
|
||||
safe.safe_body.usec == NULL ||
|
||||
abs(*safe.safe_body.timestamp - sec) > context->max_skew) {
|
||||
ret = KRB5KRB_AP_ERR_SKEW;
|
||||
krb5_clear_error_string (context);
|
||||
goto failure;
|
||||
}
|
||||
}
|
||||
@@ -157,6 +164,7 @@ krb5_rd_safe(krb5_context context,
|
||||
&& *safe.safe_body.seq_number !=
|
||||
auth_context->remote_seqnumber)) {
|
||||
ret = KRB5KRB_AP_ERR_BADORDER;
|
||||
krb5_clear_error_string (context);
|
||||
goto failure;
|
||||
}
|
||||
auth_context->remote_seqnumber++;
|
||||
@@ -170,6 +178,7 @@ krb5_rd_safe(krb5_context context,
|
||||
outbuf->data = malloc(outbuf->length);
|
||||
if (outbuf->data == NULL) {
|
||||
ret = ENOMEM;
|
||||
krb5_set_error_string (context, "malloc: out of memory");
|
||||
goto failure;
|
||||
}
|
||||
memcpy (outbuf->data, safe.safe_body.user_data.data, outbuf->length);
|
||||
|
Reference in New Issue
Block a user