static void pwd_init(struct pwd_info *pwd)
{
memset((char *)pwd->password , '\0', sizeof(pwd->password ));
- memset((char *)pwd->smb_lm_pwd, '\0', sizeof(pwd->smb_lm_pwd));
- memset((char *)pwd->smb_nt_pwd, '\0', sizeof(pwd->smb_nt_pwd));
- memset((char *)pwd->smb_lm_owf, '\0', sizeof(pwd->smb_lm_owf));
- memset((char *)pwd->smb_nt_owf, '\0', sizeof(pwd->smb_nt_owf));
pwd->null_pwd = True; /* safest option... */
- pwd->cleartext = False;
- pwd->crypted = False;
}
/****************************************************************************
- Makes lm and nt hashed passwords.
+ Stores a cleartext password.
****************************************************************************/
-static void pwd_make_lm_nt_16(struct pwd_info *pwd, const char *clr)
+void pwd_set_cleartext(struct pwd_info *pwd, const char *clr)
{
pwd_init(pwd);
-
- if (!clr) {
- ZERO_STRUCT(pwd->smb_nt_pwd);
- ZERO_STRUCT(pwd->smb_lm_pwd);
- pwd->null_pwd = True;
+ if (clr) {
+ fstrcpy(pwd->password, clr);
+ pwd->null_pwd = False;
} else {
- nt_lm_owf_gen(clr, pwd->smb_nt_pwd, pwd->smb_lm_pwd);
- pwd->null_pwd = False;
+ pwd->null_pwd = True;
}
- pwd->crypted = False;
-}
-
-/****************************************************************************
- Stores a cleartext password.
-****************************************************************************/
-void pwd_set_cleartext(struct pwd_info *pwd, const char *clr)
-{
- pwd_make_lm_nt_16(pwd, clr);
- fstrcpy(pwd->password, clr);
pwd->cleartext = True;
}
}
-/****************************************************************************
- Gets lm and nt crypts.
-****************************************************************************/
-
-void pwd_get_lm_nt_owf(struct pwd_info *pwd, uchar lm_owf[24], uchar nt_owf[24])
-{
- if (lm_owf != NULL)
- memcpy(lm_owf, pwd->smb_lm_owf, 24);
- if (nt_owf != NULL)
- memcpy(nt_owf, pwd->smb_nt_owf, 24);
-}