added code that _uses_ arcfour. arcfour itself, or anything remotely
authorLuke Leighton <lkcl@samba.org>
Mon, 3 Nov 1997 15:47:03 +0000 (15:47 +0000)
committerLuke Leighton <lkcl@samba.org>
Mon, 3 Nov 1997 15:47:03 +0000 (15:47 +0000)
like it, has *not* been added.

this is the client and server side of the SAM Logon NT and LM OWF password
obfuscation (rc4 with the long-term session key).

source/client/clientutil.c
source/client/ntclient.c
source/include/proto.h

index 1794615cd0ffdea44e904aabb53b96b9c5a8c270..4064dbecd789af94eebd5712259a8c99500a57aa 100644 (file)
@@ -33,6 +33,7 @@ pstring service="";
 pstring desthost="";
 extern pstring myname;
 pstring password = "";
+pstring smb_login_passwd = "";
 pstring username="";
 pstring workgroup=WORKGROUP;
 BOOL got_pass = False;
@@ -425,7 +426,7 @@ static struct {
 
 
 /****************************************************************************
-send a login command
+send a login command.  
 ****************************************************************************/
 BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup)
 {
@@ -578,6 +579,8 @@ BOOL cli_send_login(char *inbuf,char *outbuf,BOOL start_session,BOOL use_setup)
   else
     pass = (char *)getpass("Password: ");
 
+  pstrcpy(smb_login_passwd, pass);
+
   /* use a blank username for the 2nd try with a blank password */
   if (tries++ && !*pass)
     *username = 0;
index bf6531440e21b9abbf326899766d442e81d8bbd5..7e360981c025f98bc8e047d2be95473d9365a9ca 100644 (file)
@@ -28,6 +28,7 @@
 
 extern int DEBUGLEVEL;
 extern pstring username;
+extern pstring smb_login_passwd;
 extern pstring workgroup;
 
 #define CLIENT_TIMEOUT (30*1000)
@@ -278,11 +279,27 @@ BOOL do_nt_login(char *desthost, char *myhostname,
 
        /*********************** SAM Info ***********************/
 
-       /* this is used in both the SAM Logon and the SAM Logoff */
-       make_id_info1(&id1, workgroup, 0,
+       {
+               char lm_owf_user_pwd[16];
+               char nt_owf_user_pwd[16];
+               nt_lm_owf_gen(smb_login_passwd, nt_owf_user_pwd, lm_owf_user_pwd);
+
+#ifdef DEBUG_PASSWORD
+
+               DEBUG(100,("nt owf of user password: "));
+               dump_data(100, lm_owf_user_pwd, 16);
+
+               DEBUG(100,("nt owf of user password: "));
+               dump_data(100, nt_owf_user_pwd, 16);
+
+#endif
+
+               /* this is used in both the SAM Logon and the SAM Logoff */
+               make_id_info1(&id1, workgroup, 0,
                      getuid(), 0,
                      username, myhostname,
-                     NULL, NULL);
+                     sess_key, lm_owf_user_pwd, nt_owf_user_pwd);
+       }
 
        /*********************** SAM Logon **********************/
 
index d592c946340a3bbbd645b07a8bf9b4e86880038a..4a370e0dacd523cf7118807a1e5702353aba8f52 100644 (file)
@@ -919,7 +919,8 @@ char* smb_io_arc4_owf(BOOL io, ARC4_OWF *hash, char *q, char *base, int align, i
 void make_id_info1(DOM_ID_INFO_1 *id, char *domain_name,
                                uint32 param_ctrl, uint32 log_id_low, uint32 log_id_high,
                                char *user_name, char *wksta_name,
-                               char arc4_lm_owf[16], char arc4_nt_owf[16]);
+                               char *sess_key,
+                               unsigned char lm_cypher[16], unsigned char nt_cypher[16]);
 char* smb_io_id_info1(BOOL io, DOM_ID_INFO_1 *id, char *q, char *base, int align, int depth);
 void make_sam_info(DOM_SAM_INFO *sam,
                                char *logon_srv, char *comp_name, DOM_CRED *clnt_cred,