r12920: Fix for #3401 from Andrew Bartlett. Original fix from
authorJeremy Allison <jra@samba.org>
Fri, 13 Jan 2006 23:23:09 +0000 (23:23 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:06:07 +0000 (11:06 -0500)
Yau Lam Yiu <yiuext@cs.ust.hk>.
Jeremy.

source/libsmb/ntlmssp.c

index 0becc7fdee3c51da122ac68000c85523c026d451..6dd623047a093334ce431f13de569057839fedc6 100644 (file)
@@ -384,6 +384,11 @@ static void ntlmssp_handle_neg_flags(struct ntlmssp_state *ntlmssp_state,
 
 void ntlmssp_weaken_keys(NTLMSSP_STATE *ntlmssp_state)
 {
+       /* Nothing to weaken.  We certainly don't want to 'extend' the length... */
+       if (!ntlmssp_state->session_key.length < 8) {
+               return;
+       }
+
        /* Key weakening not performed on the master key for NTLM2
           and does not occour for NTLM1.  Therefore we only need
           to do this for the LM_KEY.