1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-06 13:18:07 +03:00
samba-mirror/source3/utils
Jones Syue 90c9d0d98d s3:ntlm_auth: make logs more consistent with length check
Run ntlm_auth with options --lm-response/--nt-response/--challenge, and pass
wrong length to these options, got error prompted logs about 'only got xxx
bytes', which are not consistent with length check. This patch revise logs
for length check to make it more consistent.

For example --lm-response requires exact 24 hex, let us input three kinds
of length 23 24 25, prompted logs said 'only got 25 bytes' seems confusing.

script:
for length in 23 24 25; \
do \
    ntlm_auth --username=${un} --password=${pw} \
    --lm-response="`openssl rand -hex ${length}`"; \
done;

output:
hex decode of 04db772593f5e6023d0ab4bc67a942c9179963477eb49d failed! (only got 23 bytes)
NT_STATUS_OK: The operation completed successfully. (0x0)
hex decode of 1e57749feb46bedcf969af6cbbe10e21d0232e35c27eb07294 failed! (only got 25 bytes)

After patch it shows 'got 25 bytes, expected 24' seems more consistent:

hex decode of e13e70c9cf2ac1e20015657c4bec53435b1b948febb63f failed! (got 23 bytes, expected 24)
NT_STATUS_OK: The operation completed successfully. (0x0)
hex decode of 64647005243092b036856f572faad262e0b69386d095d60f54 failed! (got 25 bytes, expected 24)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15677

Signed-off-by: Jones Syue <jonessyue@qnap.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Jul  6 00:52:02 UTC 2024 on atb-devel-224
2024-07-06 00:52:02 +00:00
..
async-tracker.c s3/async-tracker: don't ignore unknown options 2021-09-10 15:10:30 +00:00
clirap2.c s3:utils: Fix code spelling 2023-09-11 02:42:41 +00:00
clirap2.h
conn_tdb.c s3:utils: let connections_forall_read() report if the session was authenticated 2024-05-23 12:35:37 +00:00
conn_tdb.h s3:utils: let connections_forall_read() report if the session was authenticated 2024-05-23 12:35:37 +00:00
dbwrap_tool.c s3:utils: Use lpcfg_set_cmdline() in dbwrap_tool 2023-08-23 08:27:30 +00:00
dbwrap_torture.c s3:utils: Use lpcfg_set_cmdline() in dbwrap_torture 2023-08-23 08:27:30 +00:00
destroy_netlogon_creds_cli.c CVE-2022-38023 libcli/auth: pass lp_ctx to netlogon_creds_cli_set_global_db() 2022-12-13 13:07:29 +00:00
eventlogadm.c
interact.c
interact.h
log2pcaphex.c s3:utils: Remove unused variable 2023-02-06 22:51:32 +00:00
mdsearch.c s3:libsmb: Pass memory context to cli_full_connection_creds() 2024-04-29 08:43:32 +00:00
mvxattr.c mvxattr: don't ignore unknown options 2021-09-10 15:10:30 +00:00
net_ads_gpo.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_ads_join_dns.c s3:utils: Use lp_dns_hostname() for 'net' dns updates 2024-05-22 20:33:36 +00:00
net_ads.c s3:utils: Use lp_dnsdomain() in net_ads.c 2024-05-22 20:33:36 +00:00
net_afs.c s3:afs: Zero memory for afs_keyfile 2022-08-26 07:59:32 +00:00
net_afs.h
net_cache.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_conf_util.c
net_conf_util.h
net_conf.c
net_dns.c lib/addns: rewrite signed dns update code to use gensec instead of plain gssapi 2024-05-14 10:18:31 +00:00
net_dns.h lib/addns: rewrite signed dns update code to use gensec instead of plain gssapi 2024-05-14 10:18:31 +00:00
net_dom.c netapi: Pass net's cmdline credentials to libnetapi_net_init() 2023-09-11 02:42:41 +00:00
net_eventlog.c lib: Give lib/util/util_file.c its own header file 2024-04-16 23:51:45 +00:00
net_file.c
net_g_lock.c lib: Remove timeval_set() 2024-03-22 06:07:42 +00:00
net_group.c
net_groupmap.c s3-utils: Fix typo in error message in net groupmap 2022-10-21 03:57:33 +00:00
net_help_common.c lib/cmdline: restore s3 option name --max-protocol for MAXPROTOCOL from 4.14 2021-09-10 15:10:30 +00:00
net_help_common.h
net_help.c
net_idmap_check.c
net_idmap_check.h
net_idmap.c
net_join.c CVE-2022-38023 s3:net: add and use net_warn_member_options() helper 2022-12-13 13:07:29 +00:00
net_lookup.c
net_notify.c
net_offlinejoin.c s3:net_offlinejoin: we don't need to call libnetapi_set_use_kerberos() as we already passed cli_credentials 2024-05-14 10:18:31 +00:00
net_printing.c s3:utils: Use lpcfg_set_cmdline() in net 2023-08-23 08:27:30 +00:00
net_proto.h s3:net_ads: remove unused use_in_memory_ccache() 2024-05-14 10:18:31 +00:00
net_rap.c s3:utils: Check return value of cli_RNetServiceEnum() (CID 1273313) 2023-10-13 02:18:31 +00:00
net_registry_check.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_registry_check.h
net_registry_util.c
net_registry_util.h
net_registry.c s3:util:net_registry: registry_value_cmp() uses NUMERIC_CMP() 2024-04-10 22:56:33 +00:00
net_rpc_audit.c
net_rpc_conf.c s3:utils: Fix code spelling 2023-09-11 02:42:41 +00:00
net_rpc_printer.c s3:utils: Fix code spelling 2023-07-19 09:58:37 +00:00
net_rpc_registry.c
net_rpc_rights.c s3:utils: Use any_nt_status_not_ok() in rpc_rights_grant_internal() 2023-11-21 11:16:37 +00:00
net_rpc_samsync.c
net_rpc_service.c
net_rpc_sh_acct.c
net_rpc_shell.c netapi: Pass net's cmdline credentials to libnetapi_net_init() 2023-09-11 02:42:41 +00:00
net_rpc_trust.c net: create creds for other domain 2024-01-20 13:20:37 +00:00
net_rpc.c s3:utils: Use talloc instead of malloc functions 2024-06-06 21:32:53 +00:00
net_sam.c s3:passdb: Zero password in fetch_ldap_pw() callers 2022-08-26 07:59:32 +00:00
net_serverid.c smbd: Give smbXsrv_session.c its own header file 2024-03-12 13:31:31 +00:00
net_share.c
net_status.c conn_tdb: change type of connections_data.start to NTTIME 2022-08-08 12:56:28 +00:00
net_tdb.c
net_time.c s3:libsmb: Pass memory context to cli_connect_nb() 2024-04-29 08:43:32 +00:00
net_user.c
net_usershare.c lib: Give lib/util/util_file.c its own header file 2024-04-16 23:51:45 +00:00
net_util.c s3:net: finally remove net_context->opt_{user_specified,user_name,password} 2024-05-14 10:18:31 +00:00
net_vfs.c s3:utils: Use lpcfg_set_cmdline() in net 2023-08-23 08:27:30 +00:00
net_witness.c s3:utils: fix help string for 'net witness force-response' 2024-02-13 20:02:31 +00:00
net.c lib: Use cli_credentials_add_gensec_features in a few places 2024-06-04 07:11:35 +00:00
net.h s3:net: finally remove net_context->opt_{user_specified,user_name,password} 2024-05-14 10:18:31 +00:00
netlookup.c s3:libsmb: Pass memory context to cli_full_connection_creds() 2024-04-29 08:43:32 +00:00
nmblookup.c s3:utils: Initialize flags (CID 1499396) 2023-11-02 03:08:37 +00:00
ntlm_auth_diagnostics.c s3:utils: Fix code spelling 2023-09-11 02:42:41 +00:00
ntlm_auth_proto.h ntlm_auth: Adapt --diagnostics mode to expect that the DC does not support LANMAN by default 2022-03-17 01:57:38 +00:00
ntlm_auth.c s3:ntlm_auth: make logs more consistent with length check 2024-07-06 00:52:02 +00:00
ntlm_auth.h
passwd_proto.h
passwd_util.c
pdbedit.c s3:utils: Call gfree_all() before exit in pdbedit 2023-10-25 22:23:37 +00:00
profiles.c profiles: don't ignore unknown options 2021-09-10 15:10:30 +00:00
py_net.c s3:net: finally remove net_context->opt_{user_specified,user_name,password} 2024-05-14 10:18:31 +00:00
py_net.h
regedit_dialog.c s3:utils: Initialize DATA_BLOB blob 2024-07-05 07:45:31 +00:00
regedit_dialog.h
regedit_hexedit.c s3:utils: Fix format error 2021-10-04 10:43:37 +00:00
regedit_hexedit.h
regedit_list.c s3:utils: Fix get_window_height() return value 2024-06-24 06:14:36 +00:00
regedit_list.h
regedit_samba3.c
regedit_treeview.c
regedit_treeview.h
regedit_valuelist.c
regedit_valuelist.h
regedit_wrap.c
regedit.c s3:utils: Call gfree_all() before exit in regedit 2023-10-25 22:23:37 +00:00
regedit.h
sharesec.c s3:util:sharesec ace_compare() uses NUMERIC_CMP() 2024-04-10 22:56:33 +00:00
smbcacls.c s3:smbcacls: fix ace_compare 2024-05-22 04:23:29 +00:00
smbcontrol.c s3:utils: Call gfree_all() before exit in smbcontrol 2023-10-25 22:23:37 +00:00
smbcquotas.c s3:libsmb: Pass memory context to cli_full_connection_creds() 2024-04-29 08:43:32 +00:00
smbfilter.c s3:utils: Fix code spelling 2023-10-25 22:23:37 +00:00
smbget.c s3:utils: Fix the auth function to print correct values to the user 2024-01-04 11:26:52 +00:00
smbpasswd.c s3:utils: Initialize the memcache for smbpasswd 2023-10-27 06:51:48 +00:00
smbtree.c s3:utils: Call gfree_all() before exit in smbtree 2023-10-25 22:23:37 +00:00
status_json_dummy.c smbstatus: add a method to add profile items to json 2022-08-08 12:56:29 +00:00
status_json.c s3:utils: let smbstatus report anonymous signing/encryption explicitly 2024-05-23 13:37:09 +00:00
status_json.h smbstatus: add a method to add profile items to json 2022-08-08 12:56:29 +00:00
status_profile_dummy.c smbstatus: add JSON support for smbstatus --profile 2022-08-08 12:56:29 +00:00
status_profile.c smbstatus: add JSON support for smbstatus --profile 2022-08-08 12:56:29 +00:00
status_profile.h smbstatus: add JSON support for smbstatus --profile 2022-08-08 12:56:29 +00:00
status.c s3:utils: let smbstatus report anonymous signing/encryption explicitly 2024-05-23 13:37:09 +00:00
status.h s3:utils: let smbstatus report anonymous signing/encryption explicitly 2024-05-23 13:37:09 +00:00
testparm.c s4:ldap_server: add support for tls channel bindings 2024-04-23 23:50:34 +00:00
wscript_build s3:utils: DNS_UTIL depends on libads headers so we need to depend on 'ads' 2024-06-06 20:25:36 +00:00
wspsearch.c s3:libsmb: Pass memory context to cli_full_connection_creds() 2024-04-29 08:43:32 +00:00