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

Issue 11417138: Add verify method to HMAC instances to have a comparison utility that does not leak information thr… (Closed)

Created:
8 years, 1 month ago by Mads Ager (google)
Modified:
8 years, 1 month ago
Reviewers:
Anders Johnsen
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Add verify method to HMAC instances to have a comparison utility that does not leak information through timing. R=ajohnsen@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=15245

Patch Set 1 #

Total comments: 6

Patch Set 2 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+56 lines, -6 lines) Patch
M sdk/lib/crypto/crypto.dart View 1 2 chunks +16 lines, -1 line 0 comments Download
M sdk/lib/crypto/hmac.dart View 1 1 chunk +14 lines, -0 lines 0 comments Download
M tests/lib/crypto/hmac_md5_test.dart View 1 2 chunks +26 lines, -5 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (google)
8 years, 1 month ago (2012-11-22 11:00:34 UTC) #1
Anders Johnsen
LGTM https://codereview.chromium.org/11417138/diff/1/sdk/lib/crypto/crypto.dart File sdk/lib/crypto/crypto.dart (right): https://codereview.chromium.org/11417138/diff/1/sdk/lib/crypto/crypto.dart#newcode50 sdk/lib/crypto/crypto.dart:50: * block size for the [Hash] it is ...
8 years, 1 month ago (2012-11-22 11:34:33 UTC) #2
Mads Ager (google)
8 years, 1 month ago (2012-11-22 11:48:38 UTC) #3
Thanks Anders.

https://codereview.chromium.org/11417138/diff/1/sdk/lib/crypto/crypto.dart
File sdk/lib/crypto/crypto.dart (right):

https://codereview.chromium.org/11417138/diff/1/sdk/lib/crypto/crypto.dart#ne...
sdk/lib/crypto/crypto.dart:50: * block size for the [Hash] it is using.
On 2012/11/22 11:34:33, ajohnsen wrote:
> Maybe more explicit write that it's the internal block size of the hash
> function.

Done.

https://codereview.chromium.org/11417138/diff/1/sdk/lib/crypto/hmac.dart
File sdk/lib/crypto/hmac.dart (right):

https://codereview.chromium.org/11417138/diff/1/sdk/lib/crypto/hmac.dart#newc...
sdk/lib/crypto/hmac.dart:56: 'Invalid digest size: ${digest.length} in
HMAC.verify.'
On 2012/11/22 11:34:33, ajohnsen wrote:
> Insert '\n' or ' ' at end

Done.

https://codereview.chromium.org/11417138/diff/1/tests/lib/crypto/hmac_md5_tes...
File tests/lib/crypto/hmac_md5_test.dart (right):

https://codereview.chromium.org/11417138/diff/1/tests/lib/crypto/hmac_md5_tes...
tests/lib/crypto/hmac_md5_test.dart:107: 
On 2012/11/22 11:34:33, ajohnsen wrote:
> We could add a negative test that tests the exception we throw (as we now
> explicit say we do).

Added that as well as tests that verify returns false when it does not match.

Powered by Google App Engine
This is Rietveld 408576698