Bug 15677 - ntlm_auth make logs more consistent with length check
Summary: ntlm_auth make logs more consistent with length check
Status: RESOLVED FIXED
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: Jule Anger
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-05 09:34 UTC by Jones Syue
Modified: 2024-09-17 11:46 UTC (History)
3 users (show)

See Also:


Attachments
Patch for v4-20-test (2.95 KB, patch)
2024-07-06 02:47 UTC, Jones Syue
jra: review+
dbagnall: review+
Details
Patch for v4-19-test (2.95 KB, patch)
2024-07-06 02:50 UTC, Jones Syue
jra: review+
dbagnall: 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
Comment 5 Douglas Bagnall 2024-08-08 03:37:58 UTC
For 4.19 and 4.20.
Comment 6 Jule Anger 2024-08-14 14:46:43 UTC
Pushed to autobuild-v4-{20,19}-test.
Comment 7 Samba QA Contact 2024-08-14 16:11:03 UTC
This bug was referenced in samba v4-20-test:

ebca31b6971f80f6a96016252bb82d15afbcd240
Comment 8 Samba QA Contact 2024-08-15 07:57:04 UTC
This bug was referenced in samba v4-19-test:

af2360d6973a34b0077678571ea9b65bc918d88f
Comment 9 Samba QA Contact 2024-08-15 12:14:37 UTC
This bug was referenced in samba v4-19-stable (Release samba-4.19.8):

af2360d6973a34b0077678571ea9b65bc918d88f
Comment 10 Jule Anger 2024-08-15 14:34:17 UTC
Closing out bug report.

Thanks!
Comment 11 Samba QA Contact 2024-09-17 11:46:32 UTC
This bug was referenced in samba v4-20-stable (Release samba-4.20.5):

ebca31b6971f80f6a96016252bb82d15afbcd240