diff --git a/kdc/digest.c b/kdc/digest.c index e34039eaa..833ac5cc0 100644 --- a/kdc/digest.c +++ b/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) {