Browse Source

smb_ntlm: do not send lm & ntlm to server for guest login

Signed-off-by: Hugo Beauzée-Luyssen <hugo@beauzee.fr>
Zhai Zhaoxuan 8 years ago
parent
commit
d9b1652f44
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/smb_ntlm.c

+ 4 - 3
src/smb_ntlm.c

@@ -382,9 +382,10 @@ void        smb_ntlmssp_response(uint64_t srv_challenge, uint64_t srv_ts,
     auth->flags = 0x60088215;
 
 
-    __AUTH_APPEND(lm, lm2, 24, cursor)
-    __AUTH_APPEND(ntlm, ntlm2, blob_size + 16, cursor)
-
+    if (*domain || *user || *password) {
+        __AUTH_APPEND(lm, lm2, 24, cursor)
+        __AUTH_APPEND(ntlm, ntlm2, blob_size + 16, cursor)
+    }
     utf_sz = smb_to_utf16(domain, strlen(domain), &utf);
     __AUTH_APPEND(domain, utf, utf_sz, cursor)
     free(utf);