<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7653.38">
<TITLE>Adding NTLMv2 support for Cyrus SASL 2.1.23</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<BR>
<P><FONT SIZE=2>Ken,<BR>
<BR>
Sorry for replying late.<BR>
<BR>
I have hard coded the 'blob' structure as follows in ntlm_client_mech_step2()<BR>
inside plugins/ntlm.c:<BR>
<BR>
<BR>
/* should we send a NTLMv2 response? */<BR>
params->utils->getopt(params->utils->getopt_context,<BR>
"NTLM", "ntlm_v2", &sendv2, NULL);<BR>
<BR>
/****************commented by dhruva - NTLMv2 support*/<BR>
/*if (sendv2 && (*sendv2 == '1' || *sendv2 == 'y' ||<BR>
(*sendv2 == 'o' && *sendv2 == 'n') || *sendv2 == 't'))*/<BR>
{<BR>
<BR>
int bloblen;<BR>
char *blobbuf=NULL;<BR>
unsigned char signature[4];<BR>
unsigned char reserved[4];<BR>
unsigned char unknown[4];<BR>
unsigned char timestamp[8];<BR>
<BR>
/* put the cnonce in place after the LMv2 HMAC */<BR>
char *cnonce = resp + MD5_DIGEST_LENGTH;<BR>
<BR>
<BR>
signature[0]=0x01;<BR>
signature[1]=0x01;<BR>
signature[2]=0x00;<BR>
signature[3]=0x00;<BR>
reserved[0]=0x00;<BR>
reserved[1]=0x00;<BR>
reserved[2]=0x00;<BR>
reserved[3]=0x00;<BR>
unknown[0]=0x00;<BR>
unknown[1]=0x00;<BR>
unknown[2]=0x00;<BR>
unknown[3]=0x00;<BR>
<BR>
<BR>
params->utils->log(NULL, SASL_LOG_DEBUG,<BR>
"calculating LMv2 response");<BR>
<BR>
params->utils->rand(params->utils->rpool, cnonce, NTLM_NONCE_LENGTH);<BR>
<BR>
<BR>
unix_timestamp(timestamp); <BR>
bloblen=32+190;<BR>
blobbuf=malloc(bloblen);<BR>
memcpy(blobbuf,signature,4);<BR>
memcpy(blobbuf+4,reserved,4);<BR>
memcpy(blobbuf+8,timestamp,8);<BR>
memcpy(blobbuf+16,cnonce,8);<BR>
memcpy(blobbuf+24,unknown,4);<BR>
memcpy(blobbuf+28,serverin+64,190);<BR>
memcpy(blobbuf+28+190,unknown,4);<BR>
memcpy(blobbuf+28+190+4,unknown,4);<BR>
<BR>
/* this is for LMv2 response*/<BR>
/*V2(resp, password, oparams->authid, domain,<BR>
serverin + NTLM_TYPE2_CHALLENGE_OFFSET, cnonce, NTLM_NONCE_LENGTH,<BR>
params->utils, &text->out_buf, &text->out_buf_len, &result);*/<BR>
<BR>
/*for NTLMv2 response*/<BR>
V2(resp,password,oparams->authid,domain,serverin+NTLM_TYPE2_CHALLENGE_OFFSET,<BR>
blobbuf,bloblen,params->utils,&text->out_buf,&text->out_buf_len,&result);<BR>
<BR>
//lm_resp = resp;<BR>
memcpy(resp+16,blobbuf,bloblen); /*first 16 bytes has hmac-md5(blobbuf) in 'resp'*/<BR>
nt_resp=resp;<BR>
}<BR>
<BR>
The 'resp' buffer size in my case is 32+190+16 where 32 is the size of the<BR>
blob without TIB size, 190 is the TIB size and 16 is the size<BR>
of hmac-md5(blobbuf).<BR>
<BR>
<BR>
One of the parameter being passed in the line<BR>
"<BR>
/* should we send a NTLMv2 response? */<BR>
params->utils->getopt(params->utils->getopt_context,<BR>
"NTLM", "ntlm_v2", &sendv2, NULL);<BR>
"<BR>
is "ntlm_v2". When I checked, the "sendv2" value is not '1' or 'y'.<BR>
So the condition check "if (&sendv2 == ...)" fails. That is the reason I have<BR>
commented this check as above.<BR>
Can you please guide me about how to pass this check?<BR>
<BR>
<BR>
Sorry, I don't know how to create a patch file.<BR>
<BR>
<BR>
Thanks,<BR>
Dhruva</FONT>
</P>
<pre>
</pre></BODY>
</HTML>