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:
39
kdc/digest.c
39
kdc/digest.c
@@ -748,6 +748,7 @@ _kdc_do_digest(krb5_context context,
|
|||||||
krb5_principal clientprincipal;
|
krb5_principal clientprincipal;
|
||||||
unsigned char challange[8];
|
unsigned char challange[8];
|
||||||
uint32_t flags;
|
uint32_t flags;
|
||||||
|
Key *key = NULL;
|
||||||
|
|
||||||
r.element = choice_DigestRepInner_ntlmResponse;
|
r.element = choice_DigestRepInner_ntlmResponse;
|
||||||
r.u.ntlmResponse.success = 0;
|
r.u.ntlmResponse.success = 0;
|
||||||
@@ -803,16 +804,25 @@ _kdc_do_digest(krb5_context context,
|
|||||||
}
|
}
|
||||||
krb5_data_free(&buf);
|
krb5_data_free(&buf);
|
||||||
|
|
||||||
if (flags & NTLM_NEG_NTLM) {
|
if ((flags & NTLM_NEG_NTLM) == 0) {
|
||||||
struct ntlm_buf answer;
|
ret = EINVAL;
|
||||||
Key *key;
|
krb5_set_error_string(context, "NTLM not negotiated");
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
ret = hdb_enctype2key(context, &user->entry,
|
ret = hdb_enctype2key(context, &user->entry,
|
||||||
ETYPE_ARCFOUR_HMAC_MD5, &key);
|
ETYPE_ARCFOUR_HMAC_MD5, &key);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
krb5_set_error_string(context, "NTLM missing arcfour key");
|
krb5_set_error_string(context, "NTLM missing arcfour key");
|
||||||
goto out;
|
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) {
|
if (flags & NTLM_NEG_NTLM2_SESSION) {
|
||||||
char sessionhash[MD5_DIGEST_LENGTH];
|
char sessionhash[MD5_DIGEST_LENGTH];
|
||||||
@@ -855,6 +865,7 @@ _kdc_do_digest(krb5_context context,
|
|||||||
unsigned char masterkey[MD4_DIGEST_LENGTH];
|
unsigned char masterkey[MD4_DIGEST_LENGTH];
|
||||||
MD4_CTX ctx;
|
MD4_CTX ctx;
|
||||||
RC4_KEY rc4;
|
RC4_KEY rc4;
|
||||||
|
size_t len;
|
||||||
|
|
||||||
if ((flags & NTLM_NEG_KEYEX) == 0) {
|
if ((flags & NTLM_NEG_KEYEX) == 0) {
|
||||||
krb5_set_error_string(context,
|
krb5_set_error_string(context,
|
||||||
@@ -863,10 +874,11 @@ _kdc_do_digest(krb5_context context,
|
|||||||
goto out;
|
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,
|
krb5_set_error_string(context,
|
||||||
"NTLM master key wrong length: %lu",
|
"NTLM master key wrong length: %lu",
|
||||||
(unsigned long)ireq.u.ntlmRequest.sessionkey->length);
|
(unsigned long)len);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -896,11 +908,6 @@ _kdc_do_digest(krb5_context context,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
ret = EINVAL;
|
|
||||||
krb5_set_error_string(context, "NTLM not negotiated");
|
|
||||||
goto out;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
r.u.ntlmResponse.success = 1;
|
r.u.ntlmResponse.success = 1;
|
||||||
|
Reference in New Issue
Block a user