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

Issue 12326029: Porting of HKDF changes from server. (Closed)

Created:
7 years, 10 months ago by ramant (doing other things)
Modified:
7 years, 10 months ago
Reviewers:
wtc, agl, Ryan Sleevi
CC:
chromium-reviews, wtc, Ryan Hamilton, jar (doing other things)
Visibility:
Public.

Description

Porting of HKDF changes from server. Merge internal CL: 40300624 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=184133

Patch Set 1 #

Patch Set 2 : Small fix to unit test. #

Patch Set 3 : Fix for Mac build #

Patch Set 4 : Mac build fix# 2 #

Total comments: 23

Patch Set 5 : Fixes to comments and deletion of scoped_array. #

Total comments: 4

Patch Set 6 : minor comments update #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+251 lines, -0 lines) Patch
M crypto/crypto.gyp View 2 chunks +3 lines, -0 lines 0 comments Download
A crypto/hkdf.h View 1 2 3 4 5 1 chunk +64 lines, -0 lines 2 comments Download
A crypto/hkdf.cc View 1 2 3 4 5 1 chunk +92 lines, -0 lines 4 comments Download
A crypto/hkdf_unittest.cc View 1 2 3 4 1 chunk +92 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
ramant (doing other things)
7 years, 10 months ago (2013-02-21 03:38:00 UTC) #1
agl
LGTM. Substantially a rubber stamp since this is just moving code around. https://chromiumcodereview.appspot.com/12326029/diff/6001/crypto/hkdf.h File crypto/hkdf.h ...
7 years, 10 months ago (2013-02-21 15:00:43 UTC) #2
Ryan Sleevi
https://chromiumcodereview.appspot.com/12326029/diff/6001/crypto/hkdf.cc File crypto/hkdf.cc (right): https://chromiumcodereview.appspot.com/12326029/diff/6001/crypto/hkdf.cc#newcode20 crypto/hkdf.cc:20: base::StringPiece actual_salt = salt; BUG? You're not actually making ...
7 years, 10 months ago (2013-02-21 17:48:30 UTC) #3
agl
https://chromiumcodereview.appspot.com/12326029/diff/6001/crypto/hkdf.cc File crypto/hkdf.cc (right): https://chromiumcodereview.appspot.com/12326029/diff/6001/crypto/hkdf.cc#newcode20 crypto/hkdf.cc:20: base::StringPiece actual_salt = salt; On 2013/02/21 17:48:31, Ryan Sleevi ...
7 years, 10 months ago (2013-02-21 18:16:11 UTC) #4
Ryan Sleevi
Longer term, we may wish/need to consider using NSS directly for this ( see http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/nss/mozilla/security/nss/lib/util/pkcs11n.h?view=annotate#l150 ...
7 years, 10 months ago (2013-02-21 19:30:43 UTC) #5
ramant (doing other things)
Hi agl@ and Ryan Sleevi, Added all the comments Sleevi suggested. Added some more comments ...
7 years, 10 months ago (2013-02-21 22:46:58 UTC) #6
Ryan Sleevi
https://chromiumcodereview.appspot.com/12326029/diff/14001/crypto/hkdf.cc File crypto/hkdf.cc (right): https://chromiumcodereview.appspot.com/12326029/diff/14001/crypto/hkdf.cc#newcode64 crypto/hkdf.cc:64: buf[j++] = i + 1; Should you add a ...
7 years, 10 months ago (2013-02-21 23:30:08 UTC) #7
ramant (doing other things)
https://chromiumcodereview.appspot.com/12326029/diff/14001/crypto/hkdf.cc File crypto/hkdf.cc (right): https://chromiumcodereview.appspot.com/12326029/diff/14001/crypto/hkdf.cc#newcode64 crypto/hkdf.cc:64: buf[j++] = i + 1; On 2013/02/21 23:30:08, Ryan ...
7 years, 10 months ago (2013-02-21 23:39:27 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/rtenneti@chromium.org/12326029/9004
7 years, 10 months ago (2013-02-22 15:15:09 UTC) #9
commit-bot: I haz the power
Change committed as 184133
7 years, 10 months ago (2013-02-22 18:28:15 UTC) #10
wtc
Patch set 6 LGTM. I suggest three small changes. https://chromiumcodereview.appspot.com/12326029/diff/6001/crypto/hkdf.h File crypto/hkdf.h (right): https://chromiumcodereview.appspot.com/12326029/diff/6001/crypto/hkdf.h#newcode26 crypto/hkdf.h:26: ...
7 years, 10 months ago (2013-02-25 22:18:00 UTC) #11
ramant (doing other things)
7 years, 10 months ago (2013-02-26 22:39:46 UTC) #12
Message was sent while issue was closed.
Thanks very much wtc. Made the changes you have suggested in the following CL:

https://chromiumcodereview.appspot.com/12330157/

https://chromiumcodereview.appspot.com/12326029/diff/9004/crypto/hkdf.cc
File crypto/hkdf.cc (right):

https://chromiumcodereview.appspot.com/12326029/diff/9004/crypto/hkdf.cc#newc...
crypto/hkdf.cc:52: char* buf = new char[kSHA256HashLength + info.size() + 1];
On 2013/02/25 22:18:00, wtc wrote:
> 
> I think it is better to use scoped_ptr<char[]> here. This is
> common practice in the Chromium source tree.

Done.

https://chromiumcodereview.appspot.com/12326029/diff/9004/crypto/hkdf.cc#newc...
crypto/hkdf.cc:64: buf[j++] = static_cast<char>((i + 1) & 0xFF);
On 2013/02/25 22:18:00, wtc wrote:
> 
> Please remove & 0xFF.
> 
> It implies i + 1 can be greater than 255 (0xFF),
> but the RFC requires that i + 1  <= 255. This requirement
> comes from the requirement on L (<= 255*HashLen) and is
> checked by the DCHECK on line 47.
> 
> So i + 1 won't overflow an unsigned char. We can add a
> static_cast if compilers warn about it.

Done.

https://chromiumcodereview.appspot.com/12326029/diff/9004/crypto/hkdf.h
File crypto/hkdf.h (right):

https://chromiumcodereview.appspot.com/12326029/diff/9004/crypto/hkdf.h#newco...
crypto/hkdf.h:38: virtual ~HKDF();
On 2013/02/25 22:18:00, wtc wrote:
> 
> I think it is wrong to mark the destructor virtual because
> this class has no virtual methods.

Done.

Powered by Google App Engine
This is Rietveld 408576698