Set keyex flag and calculate session key.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20802 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-06-02 23:15:55 +00:00
parent 40573b0450
commit d791782559

View File

@@ -64,7 +64,7 @@ test_libntlm_v1(void)
memset(&type2, 0, sizeof(type2));
memset(&type3, 0, sizeof(type3));
type1.flags = NTLM_NEG_UNICODE|NTLM_NEG_NTLM;
type1.flags = NTLM_NEG_UNICODE|NTLM_NEG_NTLM|NTLM_NEG_KEYEX;
type1.domain = strdup(domain);
type1.hostname = NULL;
type1.os[0] = 0;
@@ -113,12 +113,19 @@ test_libntlm_v1(void)
{
struct ntlm_buf key;
struct ntlm_buf sessionkey;
heim_ntlm_nt_key(password, &key);
heim_ntlm_calculate_ntlm1(key.data, key.length,
type2.challange,
&type3.ntlm);
heim_ntlm_build_ntlm1_master(key.data, key.length,
&sessionkey,
&type3.sessionkey);
free(key.data);
free(sessionkey.data);
}
ret = heim_ntlm_encode_type3(&type3, &data);
@@ -168,7 +175,7 @@ test_libntlm_v2(void)
memset(&type2, 0, sizeof(type2));
memset(&type3, 0, sizeof(type3));
type1.flags = NTLM_NEG_UNICODE|NTLM_NEG_NTLM;
type1.flags = NTLM_NEG_UNICODE|NTLM_NEG_NTLM|NTLM_NEG_KEYEX;
type1.domain = strdup(domain);
type1.hostname = NULL;
type1.os[0] = 0;
@@ -218,6 +225,7 @@ test_libntlm_v2(void)
{
struct ntlm_buf key;
unsigned char ntlmv2[16];
struct ntlm_buf sessionkey;
heim_ntlm_nt_key(password, &key);
@@ -229,6 +237,11 @@ test_libntlm_v2(void)
ntlmv2,
&type3.ntlm);
free(key.data);
heim_ntlm_build_ntlm1_master(ntlmv2, sizeof(ntlmv2),
&sessionkey,
&type3.sessionkey);
free(sessionkey.data);
}
ret = heim_ntlm_encode_type3(&type3, &data);