reorder to show slot here ntlmv2 code will be placed.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19475 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-12-20 17:27:17 +00:00
parent afff6fd22a
commit 7576da2827

View File

@@ -748,6 +748,7 @@ _kdc_do_digest(krb5_context context,
krb5_principal clientprincipal;
unsigned char challange[8];
uint32_t flags;
Key *key = NULL;
r.element = choice_DigestRepInner_ntlmResponse;
r.u.ntlmResponse.success = 0;
@@ -803,9 +804,11 @@ _kdc_do_digest(krb5_context context,
}
krb5_data_free(&buf);
if (flags & NTLM_NEG_NTLM) {
struct ntlm_buf answer;
Key *key;
if ((flags & NTLM_NEG_NTLM) == 0) {
ret = EINVAL;
krb5_set_error_string(context, "NTLM not negotiated");
goto out;
}
ret = hdb_enctype2key(context, &user->entry,
ETYPE_ARCFOUR_HMAC_MD5, &key);
@@ -814,6 +817,13 @@ _kdc_do_digest(krb5_context context,
goto out;
}
/* check if this is NTLMv2 */
if (ireq.u.ntlmRequest.ntlm.length != 24) {
krb5_set_error_string(context, "NTLM v2 not supported yet");
goto out;
} else {
struct ntlm_buf answer;
if (flags & NTLM_NEG_NTLM2_SESSION) {
char sessionhash[MD5_DIGEST_LENGTH];
MD5_CTX md5ctx;
@@ -855,6 +865,7 @@ _kdc_do_digest(krb5_context context,
unsigned char masterkey[MD4_DIGEST_LENGTH];
MD4_CTX ctx;
RC4_KEY rc4;
size_t len;
if ((flags & NTLM_NEG_KEYEX) == 0) {
krb5_set_error_string(context,
@@ -863,10 +874,11 @@ _kdc_do_digest(krb5_context context,
goto out;
}
if (ireq.u.ntlmRequest.sessionkey->length != sizeof(masterkey)){
len = ireq.u.ntlmRequest.sessionkey->length;
if (len != sizeof(masterkey)){
krb5_set_error_string(context,
"NTLM master key wrong length: %lu",
(unsigned long)ireq.u.ntlmRequest.sessionkey->length);
(unsigned long)len);
goto out;
}
@@ -896,11 +908,6 @@ _kdc_do_digest(krb5_context context,
goto out;
}
}
} else {
ret = EINVAL;
krb5_set_error_string(context, "NTLM not negotiated");
goto out;
}
r.u.ntlmResponse.success = 1;