From 44d8a6bf59a5b66c3df6f5a85136b612e946903d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Wed, 20 Jun 2007 05:59:28 +0000 Subject: [PATCH] heim_ntlm_calculate_ntlm2_sess_resp git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@21203 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/ntlm/test_ntlm.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/ntlm/test_ntlm.c b/lib/ntlm/test_ntlm.c index c3b2fb7bb..ebd80d11c 100644 --- a/lib/ntlm/test_ntlm.c +++ b/lib/ntlm/test_ntlm.c @@ -241,14 +241,13 @@ static int test_ntlm2_session_resp(void) { int ret; + struct ntlm_buf lm, ntlm; - unsigned char lm_resp[24]; - const unsigned char lm_resp2[24] = + const unsigned char lm_resp[24] = "\xff\xff\xff\x00\x11\x22\x33\x44" "\x00\x00\x00\x00\x00\x00\x00\x00" "\x00\x00\x00\x00\x00\x00\x00\x00"; - unsigned char ntlm2_sess_resp[24]; - const unsigned char ntlm2_sess_resp2[24] = + const unsigned char ntlm2_sess_resp[24] = "\x10\xd5\x50\x83\x2d\x12\xb2\xcc" "\xb7\x9d\x5a\xd1\xf4\xee\xd3\xdf" "\x82\xac\xa4\xc3\x68\x1d\xd4\x55"; @@ -265,13 +264,19 @@ test_ntlm2_session_resp(void) ret = heim_ntlm_calculate_ntlm2_sess_resp(client_nonce, server_challange, ntlm_hash, - lm_resp, - ntlm2_sess_resp); + &lm, + &ntlm); + if (ret) + errx(1, "heim_ntlm_calculate_ntlm2_sess_resp"); - if (memcmp(lm_resp, lm_resp2, 24) != 0) + if (lm.length != 24 || memcmp(lm.data, lm_resp, 24) != 0) errx(1, "lm_resp wrong"); - if (memcmp(ntlm2_sess_resp, ntlm2_sess_resp2, 24) != 0) + if (ntlm.length != 24 || memcmp(ntlm.data, ntlm2_sess_resp, 24) != 0) errx(1, "ntlm2_sess_resp wrong"); + + free(lm.data); + free(ntlm.data); + return 0; }