summaryrefslogtreecommitdiff
path: root/source3/utils/smbpasswd.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1998-10-02 18:45:07 +0000
committerLuke Leighton <lkcl@samba.org>1998-10-02 18:45:07 +0000
commitbdbc959a9afd7fab159f235551c25139763af100 (patch)
tree5abedc90ada5e20b1eff22eeb777aae2a54c8989 /source3/utils/smbpasswd.c
parentc43c53b886ec62b249ffebcd4e6656042e4753bc (diff)
downloadsamba-bdbc959a9afd7fab159f235551c25139763af100.tar.gz
samba-bdbc959a9afd7fab159f235551c25139763af100.tar.bz2
samba-bdbc959a9afd7fab159f235551c25139763af100.zip
- static function "create_new_hashes" was identical to "nt_lm_owf_gen".
create_new_hashes didn't zero the buffer for the md4hash: nt_lm_owf_gen did, because jeremy sorted this out a couple of days ago. call nt_lm_owf_gen instead. - call SMBOWFencrypt from SMBencrypt and SMBNTencrypt. - added #ifdef DEBUG_PASSWORD debug password calls. (This used to be commit a4e7cc3e46b713aa0ae55de74a1c70921bef578d)
Diffstat (limited to 'source3/utils/smbpasswd.c')
-rw-r--r--source3/utils/smbpasswd.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/source3/utils/smbpasswd.c b/source3/utils/smbpasswd.c
index e5e5424a2b..5ea0854230 100644
--- a/source3/utils/smbpasswd.c
+++ b/source3/utils/smbpasswd.c
@@ -114,27 +114,6 @@ unable to join domain.\n", prog_name);
}
/*************************************************************
- Utility function to create password hashes.
-*************************************************************/
-
-static void create_new_hashes( char *new_passwd, uchar *new_p16, uchar *new_nt_p16)
-{
- memset(new_nt_p16, '\0', 16);
- E_md4hash((uchar *) new_passwd, new_nt_p16);
-
- /* Mangle the password into Lanman format */
- new_passwd[14] = '\0';
- strupper(new_passwd);
-
- /*
- * Calculate the SMB (lanman) hash functions of the new password.
- */
-
- memset(new_p16, '\0', 16);
- E_P16((uchar *) new_passwd, new_p16);
-}
-
-/*************************************************************
Utility function to prompt for new password.
*************************************************************/
@@ -555,7 +534,7 @@ int main(int argc, char **argv)
/* Calculate the MD4 hash (NT compatible) of the new password. */
- create_new_hashes( new_passwd, new_p16, new_nt_p16);
+ nt_lm_owf_gen( new_passwd, new_nt_p16, new_p16);
/*
* Open the smbpaswd file.
@@ -634,7 +613,7 @@ int main(int argc, char **argv)
else if (enable_user) {
if(smb_pwent->smb_passwd == NULL) {
prompt_for_new_password(new_passwd);
- create_new_hashes( new_passwd, new_p16, new_nt_p16);
+ nt_lm_owf_gen( new_passwd, new_nt_p16, new_p16);
smb_pwent->smb_passwd = new_p16;
smb_pwent->smb_nt_passwd = new_nt_p16;
}