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

Issue 1347002: Add Mac implementations of new SymmetricKey and Encryptor classes. (Closed)

Created:
10 years, 9 months ago by Jens Alfke
Modified:
9 years, 7 months ago
Reviewers:
wtc, albertb, hawk
CC:
chromium-reviews, John Grabowski, Paweł Hajdan Jr., pam+watch_chromium.org, brettw-cc_chromium.org
Visibility:
Public.

Description

Add Mac implementations of new SymmetricKey and Encryptor classes. BUG=none TEST=EncryptorTest, SymmetricKeyTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=42964

Patch Set 1 #

Patch Set 2 : Fixed a memory leak on error. #

Total comments: 37

Patch Set 3 : Responding to feedback #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+379 lines, -96 lines) Patch
M base/crypto/cssm_init.h View 1 chunk +6 lines, -0 lines 0 comments Download
M base/crypto/cssm_init.cc View 1 2 6 chunks +35 lines, -1 line 1 comment Download
M base/crypto/encryptor.h View 1 chunk +6 lines, -0 lines 0 comments Download
M base/crypto/encryptor_mac.cc View 1 2 2 chunks +49 lines, -6 lines 0 comments Download
M base/crypto/encryptor_unittest.cc View 2 chunks +2 lines, -2 lines 0 comments Download
M base/crypto/rsa_private_key.h View 2 chunks +0 lines, -2 lines 0 comments Download
M base/crypto/rsa_private_key_mac.cc View 5 chunks +7 lines, -18 lines 0 comments Download
M base/crypto/signature_creator.h View 1 chunk +0 lines, -1 line 0 comments Download
M base/crypto/signature_creator_mac.cc View 3 chunks +2 lines, -14 lines 0 comments Download
M base/crypto/signature_verifier.h View 1 chunk +0 lines, -2 lines 0 comments Download
M base/crypto/signature_verifier_mac.cc View 3 chunks +4 lines, -14 lines 0 comments Download
M base/crypto/symmetric_key.h View 1 2 3 chunks +17 lines, -8 lines 0 comments Download
M base/crypto/symmetric_key_mac.cc View 1 2 2 chunks +123 lines, -7 lines 5 comments Download
M base/crypto/symmetric_key_nss.cc View 3 chunks +8 lines, -7 lines 0 comments Download
M base/crypto/symmetric_key_unittest.cc View 1 2 5 chunks +117 lines, -12 lines 0 comments Download
M base/crypto/symmetric_key_win.cc View 1 2 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Jens Alfke
Additionally this patch: * Changes the interpretation of the key size in SymmetricKey to bits ...
10 years, 9 months ago (2010-03-25 22:49:09 UTC) #1
albertb
http://codereview.chromium.org/1347002/diff/2001/3001 File base/crypto/cssm_init.cc (right): http://codereview.chromium.org/1347002/diff/2001/3001#newcode50 base/crypto/cssm_init.cc:50: DCHECK(crtn == CSSM_OK); Should this also be a NOTREACHED? ...
10 years, 9 months ago (2010-03-26 01:21:11 UTC) #2
wtc
LGTM. Please don't respond with "Done" to my comments. http://codereview.chromium.org/1347002/diff/2001/3001 File base/crypto/cssm_init.cc (right): http://codereview.chromium.org/1347002/diff/2001/3001#newcode52 base/crypto/cssm_init.cc:52: ...
10 years, 9 months ago (2010-03-26 01:59:53 UTC) #3
Jens Alfke
http://codereview.chromium.org/1347002/diff/2001/3001 File base/crypto/cssm_init.cc (right): http://codereview.chromium.org/1347002/diff/2001/3001#newcode50 base/crypto/cssm_init.cc:50: DCHECK(crtn == CSSM_OK); On 2010/03/26 01:21:11, albertb wrote: > ...
10 years, 9 months ago (2010-03-26 18:56:24 UTC) #4
wtc
LGTM. Thanks for making the changes. http://codereview.chromium.org/1347002/diff/2001/3013 File base/crypto/symmetric_key_mac.cc (right): http://codereview.chromium.org/1347002/diff/2001/3013#newcode50 base/crypto/symmetric_key_mac.cc:50: random_bits[i] = RandUint64(); ...
10 years, 9 months ago (2010-03-26 21:14:30 UTC) #5
Jens Alfke
10 years, 9 months ago (2010-03-29 18:34:17 UTC) #6
http://codereview.chromium.org/1347002/diff/15001/16013
File base/crypto/symmetric_key_mac.cc (right):

http://codereview.chromium.org/1347002/diff/15001/16013#newcode29
base/crypto/symmetric_key_mac.cc:29: return CSSM_ALGID_SHA1HMAC_LEGACY;
On 2010/03/26 21:14:30, wtc wrote:
> Just curious: why does this ALGID say "LEGACY"?

I don't know -- the header comment says "HMAC/SHA1, legacy compatible".

http://codereview.chromium.org/1347002/diff/15001/16013#newcode33
base/crypto/symmetric_key_mac.cc:33: void* CreateRandomBytes(size_t size) {
On 2010/03/26 21:14:30, wtc wrote:
> It seems better to take a result buffer as an input argument.
> Is that possible with the CSSM API?

It would be possible, but not any more efficient, as the CSSM_GenerateRandom
function returns a malloc'ed buffer that I'd have to copy.

Powered by Google App Engine
This is Rietveld 408576698