Bug 15677 - ntlm_auth make logs more consistent with length check
Summary: ntlm_auth make logs more consistent with length check
Status: NEW
Alias: None
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools (show other bugs)
Version: 4.15.13
Hardware: All All
: P5 normal (vote)
Target Milestone: ---
Assignee: Samba QA Contact
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-05 09:34 UTC by Jones Syue
Modified: 2024-07-08 17:07 UTC (History)
2 users (show)

See Also:


Attachments
Patch for v4-20-test (2.95 KB, patch)
2024-07-06 02:47 UTC, Jones Syue
jonessyue: review? (dmulder)
jra: review+
Details
Patch for v4-19-test (2.95 KB, patch)
2024-07-06 02:50 UTC, Jones Syue
jonessyue: review? (dmulder)
jra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jones Syue 2024-07-05 09:34:01 UTC
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 lengh 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)

patch will follow.
Comment 2 Samba QA Contact 2024-07-06 00:53:04 UTC
This bug was referenced in samba master:

90c9d0d98d3c80c77764dbcaf9c24d7c4ea31b4a
Comment 3 Jones Syue 2024-07-06 02:47:54 UTC
Created attachment 18365 [details]
Patch for v4-20-test
Comment 4 Jones Syue 2024-07-06 02:50:37 UTC
Created attachment 18366 [details]
Patch for v4-19-test