Try harder to provide better error message for digest messages.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21398 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
19
kdc/digest.c
19
kdc/digest.c
@@ -1331,10 +1331,24 @@ _kdc_do_digest(krb5_context context,
|
||||
version, ireq.u.ntlmRequest.username);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
default: {
|
||||
char *s;
|
||||
krb5_set_error_string(context, "unknown operation to digest");
|
||||
ret = EINVAL;
|
||||
|
||||
failed:
|
||||
|
||||
s = krb5_get_error_message(context, ret);
|
||||
if (s == NULL) {
|
||||
krb5_clear_error_string(context);
|
||||
goto out;
|
||||
}
|
||||
|
||||
kdc_log(context, config, 0, "Digest failed with: %s", s);
|
||||
|
||||
r.element = choice_DigestRepInner_error;
|
||||
r.u.error.reason = strdup("unknown/failed operation");
|
||||
r.u.error.reason = strdup("unknown error");
|
||||
krb5_free_error_string(context, s);
|
||||
if (r.u.error.reason == NULL) {
|
||||
krb5_set_error_string(context, "out of memory");
|
||||
ret = ENOMEM;
|
||||
@@ -1343,6 +1357,7 @@ _kdc_do_digest(krb5_context context,
|
||||
r.u.error.code = EINVAL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ASN1_MALLOC_ENCODE(DigestRepInner, buf.data, buf.length, &r, &size, ret);
|
||||
if (ret) {
|
||||
|
Reference in New Issue
Block a user