diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-08-22 06:46:34 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 15:02:25 -0500 |
commit | b39330c4873d4c3923a577e89690fc0e43b0c61a (patch) | |
tree | 882a09a9e2ef446d3662ac542d1bf60fb8e7dfb2 /source4/heimdal/kdc/digest.c | |
parent | db24e606f10902de49891e32600403274ece16da (diff) | |
download | samba-b39330c4873d4c3923a577e89690fc0e43b0c61a.tar.gz samba-b39330c4873d4c3923a577e89690fc0e43b0c61a.tar.bz2 samba-b39330c4873d4c3923a577e89690fc0e43b0c61a.zip |
r24614: Merge with current lorikeet-heimdal. This brings us one step closer
to an alpha release.
Andrew Bartlett
(This used to be commit 30e02747d511630659c59eafec8d28f58605943b)
Diffstat (limited to 'source4/heimdal/kdc/digest.c')
-rw-r--r-- | source4/heimdal/kdc/digest.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source4/heimdal/kdc/digest.c b/source4/heimdal/kdc/digest.c index 801449fe5e..358ca5ad56 100644 --- a/source4/heimdal/kdc/digest.c +++ b/source4/heimdal/kdc/digest.c @@ -34,7 +34,7 @@ #include "kdc_locl.h" #include <hex.h> -RCSID("$Id: digest.c 21241 2007-06-20 11:30:19Z lha $"); +RCSID("$Id: digest.c 21606 2007-07-17 07:03:25Z lha $"); #define MS_CHAP_V2 0x20 #define CHAP_MD5 0x10 @@ -975,7 +975,7 @@ _kdc_do_digest(krb5_context context, } kdc_log(context, config, 0, "Digest %s request successful %s", - ireq.u.digestRequest.type, from); + ireq.u.digestRequest.type, ireq.u.digestRequest.username); break; } @@ -1227,7 +1227,7 @@ _kdc_do_digest(krb5_context context, version = 1; if (flags & NTLM_NEG_NTLM2_SESSION) { - char sessionhash[MD5_DIGEST_LENGTH]; + unsigned char sessionhash[MD5_DIGEST_LENGTH]; MD5_CTX md5ctx; if ((config->digests_allowed & NTLM_V1_SESSION) == 0) { @@ -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) { |