diff options
author | Volker Lendecke <vl@samba.org> | 2020-01-03 14:24:13 +0100 |
---|---|---|
committer | Gary Lockyer <gary@samba.org> | 2020-01-06 03:12:19 +0000 |
commit | e4ad0013787a726bfc3d1ba3644b60a6c77ace37 (patch) | |
tree | 206734cd56eb71a2ec7528721f649d10d4b2c1c2 /libcli | |
parent | e02d24c0875eb04a53c19119148f5203374382e0 (diff) | |
download | samba-e4ad0013787a726bfc3d1ba3644b60a6c77ace37.tar.gz |
auth: Avoid casts in ntlm_check.c
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Mon Jan 6 03:12:20 UTC 2020 on sn-devel-184
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/auth/ntlm_check.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/libcli/auth/ntlm_check.c b/libcli/auth/ntlm_check.c index 9ae524452aa..846e0c07cd5 100644 --- a/libcli/auth/ntlm_check.c +++ b/libcli/auth/ntlm_check.c @@ -46,14 +46,13 @@ static bool smb_pwd_check_ntlmv1(TALLOC_CTX *mem_ctx, } if (sec_blob->length != 8) { - DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect challenge size (%lu)\n", - (unsigned long)sec_blob->length)); + DBG_ERR("incorrect challenge size (%zu)\n", sec_blob->length); return false; } if (nt_response->length != 24) { - DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect password length (%lu)\n", - (unsigned long)nt_response->length)); + DBG_ERR("incorrect password length (%zu)\n", + nt_response->length); return false; } @@ -113,8 +112,7 @@ static bool smb_pwd_check_ntlmv2(TALLOC_CTX *mem_ctx, } if (sec_blob->length != 8) { - DEBUG(0, ("smb_pwd_check_ntlmv2: incorrect challenge size (%lu)\n", - (unsigned long)sec_blob->length)); + DBG_ERR("incorrect challenge size (%zu)\n", sec_blob->length); return false; } @@ -122,8 +120,8 @@ static bool smb_pwd_check_ntlmv2(TALLOC_CTX *mem_ctx, /* We MUST have more than 16 bytes, or the stuff below will go crazy. No known implementation sends less than the 24 bytes for LMv2, let alone NTLMv2. */ - DEBUG(0, ("smb_pwd_check_ntlmv2: incorrect password length (%lu)\n", - (unsigned long)ntv2_response->length)); + DBG_ERR("incorrect password length (%zu)\n", + ntv2_response->length); return false; } @@ -204,8 +202,7 @@ static bool smb_sess_key_ntlmv2(TALLOC_CTX *mem_ctx, } if (sec_blob->length != 8) { - DEBUG(0, ("smb_sess_key_ntlmv2: incorrect challenge size (%lu)\n", - (unsigned long)sec_blob->length)); + DBG_ERR("incorrect challenge size (%zu)\n", sec_blob->length); return false; } @@ -213,8 +210,8 @@ static bool smb_sess_key_ntlmv2(TALLOC_CTX *mem_ctx, /* We MUST have more than 16 bytes, or the stuff below will go crazy. No known implementation sends less than the 24 bytes for LMv2, let alone NTLMv2. */ - DEBUG(0, ("smb_sess_key_ntlmv2: incorrect password length (%lu)\n", - (unsigned long)ntv2_response->length)); + DBG_ERR("incorrect password length (%zu)\n", + ntv2_response->length); return false; } @@ -397,8 +394,9 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx, } if (nt_response->length != 0 && nt_response->length < 24) { - DEBUG(2,("ntlm_password_check: invalid NT password length (%lu) for user %s\n", - (unsigned long)nt_response->length, username)); + DBG_NOTICE("invalid NT password length (%zu) for user %s\n", + nt_response->length, + username); } if (nt_response->length > 24 && stored_nt) { @@ -484,8 +482,9 @@ NTSTATUS ntlm_password_check(TALLOC_CTX *mem_ctx, } if (lm_response->length < 24) { - DEBUG(2,("ntlm_password_check: invalid LanMan password length (%lu) for user %s\n", - (unsigned long)nt_response->length, username)); + DBG_NOTICE("invalid LanMan password length (%zu) for " + "user %s\n", + nt_response->length, username); return NT_STATUS_WRONG_PASSWORD; } |