From d791782559e12fd53d71c2765f1bd92f1dee5dbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Sat, 2 Jun 2007 23:15:55 +0000 Subject: [PATCH] Set keyex flag and calculate session key. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20802 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/gssapi/test_ntlm.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/gssapi/test_ntlm.c b/lib/gssapi/test_ntlm.c index fc904c58a..ad037993a 100644 --- a/lib/gssapi/test_ntlm.c +++ b/lib/gssapi/test_ntlm.c @@ -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);