diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-04-17 08:46:51 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-04-17 14:42:31 +0200 |
commit | cb3cde951859852daf830efdeaf8392cf7c89300 (patch) | |
tree | 491e24eab96c290d26cb6373db99f86d48b3ec67 /source3/libsmb | |
parent | 5f0f5b361531926bc394a4e468392ee617dbbc1f (diff) | |
download | samba-cb3cde951859852daf830efdeaf8392cf7c89300.tar.gz samba-cb3cde951859852daf830efdeaf8392cf7c89300.tar.bz2 samba-cb3cde951859852daf830efdeaf8392cf7c89300.zip |
s3:libsmb/ntlmssp: remove some indentation in ntlmssp_set_password()
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/ntlmssp.c | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index b877af583a..96dc1fb6aa 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -76,31 +76,33 @@ NTSTATUS ntlmssp_set_username(struct ntlmssp_state *ntlmssp_state, const char *u */ NTSTATUS ntlmssp_set_password(struct ntlmssp_state *ntlmssp_state, const char *password) { + uint8_t lm_hash[16]; + uint8_t nt_hash[16]; + TALLOC_FREE(ntlmssp_state->lm_hash); TALLOC_FREE(ntlmssp_state->nt_hash); - if (!password) { - return NT_STATUS_OK; - } else { - uint8_t lm_hash[16]; - uint8_t nt_hash[16]; - - if (E_deshash(password, lm_hash)) { - ntlmssp_state->lm_hash = (uint8_t *) - talloc_memdup(ntlmssp_state, lm_hash, 16); - if (!ntlmssp_state->lm_hash) { - return NT_STATUS_NO_MEMORY; - } - } - E_md4hash(password, nt_hash); + if (password == NULL) { + return NT_STATUS_OK; + } - ntlmssp_state->nt_hash = (uint8_t *) - talloc_memdup(ntlmssp_state, nt_hash, 16); - if (!ntlmssp_state->nt_hash) { - TALLOC_FREE(ntlmssp_state->lm_hash); + if (E_deshash(password, lm_hash)) { + ntlmssp_state->lm_hash = (uint8_t *) + talloc_memdup(ntlmssp_state, lm_hash, 16); + if (!ntlmssp_state->lm_hash) { return NT_STATUS_NO_MEMORY; } } + + E_md4hash(password, nt_hash); + + ntlmssp_state->nt_hash = (uint8_t *) + talloc_memdup(ntlmssp_state, nt_hash, 16); + if (!ntlmssp_state->nt_hash) { + TALLOC_FREE(ntlmssp_state->lm_hash); + return NT_STATUS_NO_MEMORY; + } + return NT_STATUS_OK; } |