libcli: allow exclusion of netbios name in NTLMV2 blob
authorChristian Ambach <christian.ambach@de.ibm.com>
Thu, 7 Apr 2011 12:01:50 +0000 (14:01 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 13 Apr 2011 23:32:22 +0000 (01:32 +0200)
when no hostname is given, leave away the MsvAvNbComputerName part
of the ntlmv2 blob

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
libcli/auth/smbencrypt.c

index d090345bb80cd49f4dd0d7e26c6f1414cf27a4ad..366f6df3adcfca9e547d1125ce118441eccf1ed6 100644 (file)
@@ -385,11 +385,18 @@ DATA_BLOB NTLMv2_generate_names_blob(TALLOC_CTX *mem_ctx,
        DATA_BLOB names_blob = data_blob_talloc(mem_ctx, NULL, 0);
 
        /* Deliberately ignore return here.. */
-       (void)msrpc_gen(mem_ctx, &names_blob,
-                 "aaa",
-                 MsvAvNbDomainName, domain,
-                 MsvAvNbComputerName, hostname,
-                 MsvAvEOL, "");
+       if (hostname != NULL) {
+               (void)msrpc_gen(mem_ctx, &names_blob,
+                         "aaa",
+                         MsvAvNbDomainName, domain,
+                         MsvAvNbComputerName, hostname,
+                         MsvAvEOL, "");
+       } else {
+               (void)msrpc_gen(mem_ctx, &names_blob,
+                         "aa",
+                         MsvAvNbDomainName, domain,
+                         MsvAvEOL, "");
+       }
        return names_blob;
 }