Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(593)

Issue 2873673002: Add unit tests for NTLMv1 portable implementation (Closed)

Created:
3 years, 7 months ago by zentaro
Modified:
3 years, 5 months ago
Reviewers:
asanka, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Add unit tests for existing NTLM portable code. - Adds tests for existing implementation. - Minor code change to reject certain invalid messages. NOTE: The existing code just ignored the target name field if it had length and/or offset outside the bounds of the message. This change explicitly rejects that case in order to test that the behavior is correct. BUG=chromium:22532 TEST=builds and tests pass Review-Url: https://codereview.chromium.org/2873673002 Cr-Commit-Position: refs/heads/master@{#486604} Committed: https://chromium.googlesource.com/chromium/src/+/b89acda495056e4af04adc1b34774bc3069f612a

Patch Set 1 #

Patch Set 2 : Add unit tests for existing NTLM portable code. #

Patch Set 3 : Add unit tests for existing NTLM portable code. #

Patch Set 4 : Fixed ifdef comment with wrong symbol #

Patch Set 5 : Remove redundant mock. #

Total comments: 14

Patch Set 6 : A few more invalid input tests #

Patch Set 7 : Add unit tests for existing NTLM portable code. #

Patch Set 8 : Review feedback #

Patch Set 9 : Most tests for ntlm v1 #

Patch Set 10 : Add unit tests for existing NTLM portable code. #

Patch Set 11 : Add unit tests for existing NTLM portable code. #

Patch Set 12 : Add unit tests for existing NTLM portable code. #

Patch Set 13 : After some refactoring base on other CL #

Patch Set 14 : Rebase #

Patch Set 15 : Rebase #

Patch Set 16 : Add unit tests for existing NTLM portable code. #

Total comments: 8

Patch Set 17 : Review feedback #

Patch Set 18 : Missed rename #

Patch Set 19 : Rebase #

Patch Set 20 : Rebase #

Patch Set 21 : Cleanup #

Patch Set 22 : Rebase #

Patch Set 23 : Rebase #

Patch Set 24 : Cleanup #

Total comments: 45

Patch Set 25 : Rebase after move. Also move des/md4 #

Patch Set 26 : Review feedback #

Patch Set 27 : Cleanup #

Patch Set 28 : Minor fix #

Patch Set 29 : Change more inputs to spec test data #

Patch Set 30 : EXPECT_* -> ASSERT_* #

Patch Set 31 : Rebase #

Patch Set 32 : Rebase #

Patch Set 33 : Refactor + test cleanup #

Patch Set 34 : Rebase #

Patch Set 35 : Rebase #

Patch Set 36 : Fix include guards #

Patch Set 37 : Rebase #

Patch Set 38 : Merge build config back to net #

Total comments: 33

Patch Set 39 : Fix naming conventions #

Patch Set 40 : Review feedback #

Total comments: 16

Patch Set 41 : Missed review item #

Patch Set 42 : Nits #

Patch Set 43 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1073 lines, -435 lines) Patch
M net/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 8 chunks +20 lines, -5 lines 0 comments Download
D net/http/des.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +0 lines, -31 lines 0 comments Download
D net/http/des.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +0 lines, -87 lines 0 comments Download
D net/http/des_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +0 lines, -46 lines 0 comments Download
M net/http/http_auth_handler_ntlm_portable.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 2 chunks +15 lines, -7 lines 0 comments Download
A net/http/http_auth_handler_ntlm_portable_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +577 lines, -0 lines 0 comments Download
D net/http/md4.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +0 lines, -74 lines 0 comments Download
D net/http/md4.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +0 lines, -184 lines 0 comments Download
A + net/ntlm/des.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 chunks +-1 lines, --1 lines 0 comments Download
A + net/ntlm/des.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 2 chunks +2 lines, -1 line 0 comments Download
A + net/ntlm/des_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 chunk +1 line, -1 line 0 comments Download
A + net/ntlm/md4.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0 chunks +-1 lines, --1 lines 0 comments Download
A + net/ntlm/md4.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 2 chunks +2 lines, -1 line 0 comments Download
A net/ntlm/ntlm.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 1 chunk +131 lines, -0 lines 0 comments Download
A net/ntlm/ntlm.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 1 chunk +125 lines, -0 lines 0 comments Download
M net/ntlm/ntlm_constants.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +1 line, -0 lines 0 comments Download
A net/ntlm/ntlm_test_data.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +81 lines, -0 lines 0 comments Download
A net/ntlm/ntlm_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 1 chunk +120 lines, -0 lines 0 comments Download

Depends on Patchset:

Dependent Patchsets:

Messages

Total messages: 36 (17 generated)
zentaro
PTAL
3 years, 7 months ago (2017-05-09 16:01:30 UTC) #5
Ryan Sleevi
Have you considered writing a fuzzer as well for these message generation functions? https://codereview.chromium.org/2873673002/diff/80001/net/http/http_auth_handler_ntlm_portable_unittest.cc File ...
3 years, 7 months ago (2017-05-09 20:49:27 UTC) #6
zentaro
On 2017/05/09 20:49:27, Ryan Sleevi wrote: > Have you considered writing a fuzzer as well ...
3 years, 7 months ago (2017-05-15 20:29:30 UTC) #7
zentaro
https://codereview.chromium.org/2873673002/diff/80001/net/http/http_auth_handler_ntlm_portable_unittest.cc File net/http/http_auth_handler_ntlm_portable_unittest.cc (right): https://codereview.chromium.org/2873673002/diff/80001/net/http/http_auth_handler_ntlm_portable_unittest.cc#newcode42 net/http/http_auth_handler_ntlm_portable_unittest.cc:42: base::ASCIIToUTF16("badpassword")); On 2017/05/09 20:49:27, Ryan Sleevi wrote: > Any ...
3 years, 7 months ago (2017-05-15 20:48:38 UTC) #8
zentaro
Hold off on reviewing this one for a little bit. Making it more complete and ...
3 years, 7 months ago (2017-05-19 20:28:35 UTC) #9
Ryan Sleevi
Mostly LG, but will defer to Asanka to make sure I haven't missed anything. https://codereview.chromium.org/2873673002/diff/300001/net/http/ntlm_client.cc ...
3 years, 6 months ago (2017-06-08 18:47:44 UTC) #10
zentaro
PTAL https://codereview.chromium.org/2873673002/diff/300001/net/http/ntlm_client.cc File net/http/ntlm_client.cc (right): https://codereview.chromium.org/2873673002/diff/300001/net/http/ntlm_client.cc#newcode31 net/http/ntlm_client.cc:31: ZapBuf(buffer.get(), length); On 2017/06/08 18:47:43, Ryan Sleevi wrote: ...
3 years, 6 months ago (2017-06-12 23:16:55 UTC) #11
asanka
https://codereview.chromium.org/2873673002/diff/460001/net/BUILD.gn File net/BUILD.gn (right): https://codereview.chromium.org/2873673002/diff/460001/net/BUILD.gn#newcode294 net/BUILD.gn:294: "http/ntlm_client.h", I'm guessing this and the tests would be ...
3 years, 6 months ago (2017-06-23 21:29:11 UTC) #12
zentaro
https://codereview.chromium.org/2873673002/diff/460001/net/BUILD.gn File net/BUILD.gn (right): https://codereview.chromium.org/2873673002/diff/460001/net/BUILD.gn#newcode294 net/BUILD.gn:294: "http/ntlm_client.h", On 2017/06/23 21:29:10, asanka wrote: > I'm guessing ...
3 years, 5 months ago (2017-07-05 17:57:42 UTC) #13
Ryan Sleevi
Quick pass, I'm not sure if Asanka wants to continue as primary reviewer https://codereview.chromium.org/2873673002/diff/740001/net/BUILD.gn File ...
3 years, 5 months ago (2017-07-12 17:56:39 UTC) #14
asanka
Looking good. I only have nits. https://codereview.chromium.org/2873673002/diff/740001/net/http/http_auth_handler_ntlm_portable_unittest.cc File net/http/http_auth_handler_ntlm_portable_unittest.cc (right): https://codereview.chromium.org/2873673002/diff/740001/net/http/http_auth_handler_ntlm_portable_unittest.cc#newcode145 net/http/http_auth_handler_ntlm_portable_unittest.cc:145: const uint8_t challenge_header_[ntlm::CHALLENGE_HEADER_LEN] ...
3 years, 5 months ago (2017-07-12 19:53:16 UTC) #15
zentaro
https://codereview.chromium.org/2873673002/diff/740001/net/BUILD.gn File net/BUILD.gn (right): https://codereview.chromium.org/2873673002/diff/740001/net/BUILD.gn#newcode1774 net/BUILD.gn:1774: "ntlm/ntlm_constants.h", On 2017/07/12 17:56:38, Ryan Sleevi wrote: > Apologies ...
3 years, 5 months ago (2017-07-13 17:10:20 UTC) #16
asanka
LGTM https://codereview.chromium.org/2873673002/diff/740001/net/http/http_auth_handler_ntlm_portable.cc File net/http/http_auth_handler_ntlm_portable.cc (right): https://codereview.chromium.org/2873673002/diff/740001/net/http/http_auth_handler_ntlm_portable.cc#newcode371 net/http/http_auth_handler_ntlm_portable.cc:371: if (offset + target_len > offset && offset ...
3 years, 5 months ago (2017-07-13 17:26:13 UTC) #17
asanka
.. but wait for rsleevi and also address the unaddressed comment.
3 years, 5 months ago (2017-07-13 17:26:55 UTC) #18
zentaro
https://codereview.chromium.org/2873673002/diff/740001/net/http/http_auth_handler_ntlm_portable.cc File net/http/http_auth_handler_ntlm_portable.cc (right): https://codereview.chromium.org/2873673002/diff/740001/net/http/http_auth_handler_ntlm_portable.cc#newcode371 net/http/http_auth_handler_ntlm_portable.cc:371: if (offset + target_len > offset && offset + ...
3 years, 5 months ago (2017-07-13 17:36:21 UTC) #19
Ryan Sleevi
LGTM % nits https://codereview.chromium.org/2873673002/diff/780001/net/http/http_auth_handler_ntlm_portable_unittest.cc File net/http/http_auth_handler_ntlm_portable_unittest.cc (right): https://codereview.chromium.org/2873673002/diff/780001/net/http/http_auth_handler_ntlm_portable_unittest.cc#newcode82 net/http/http_auth_handler_ntlm_portable_unittest.cc:82: EXPECT_EQ(sec_buf.length, len); ASSERT_EQ ? If .length ...
3 years, 5 months ago (2017-07-13 17:39:54 UTC) #20
zentaro
https://codereview.chromium.org/2873673002/diff/780001/net/http/http_auth_handler_ntlm_portable_unittest.cc File net/http/http_auth_handler_ntlm_portable_unittest.cc (right): https://codereview.chromium.org/2873673002/diff/780001/net/http/http_auth_handler_ntlm_portable_unittest.cc#newcode82 net/http/http_auth_handler_ntlm_portable_unittest.cc:82: EXPECT_EQ(sec_buf.length, len); On 2017/07/13 17:39:54, Ryan Sleevi wrote: > ...
3 years, 5 months ago (2017-07-13 18:20:31 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2873673002/840001
3 years, 5 months ago (2017-07-14 01:19:40 UTC) #33
commit-bot: I haz the power
3 years, 5 months ago (2017-07-14 01:29:23 UTC) #36
Message was sent while issue was closed.
Committed patchset #43 (id:840001) as
https://chromium.googlesource.com/chromium/src/+/b89acda495056e4af04adc1b3477...

Powered by Google App Engine
This is Rietveld 408576698