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

Issue 1934001: Simplify the Windows <keygen> implementation by making better use of CryptoAP... (Closed)

Created:
10 years, 7 months ago by rsleevi-old
Modified:
9 years, 7 months ago
Reviewers:
wtc
CC:
chromium-reviews, cbentzel+watch_chromium.org, darin-cc_chromium.org
Visibility:
Public.

Description

[Replaced by http://codereview.chromium.org/2021003 ] Simplify the Windows <keygen> implementation by making better use of CryptoAPI. BUG=148 TEST=Keygenhandler.SmokeTest

Patch Set 1 #

Total comments: 11

Patch Set 2 : Fixing nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+44 lines, -104 lines) Patch
M net/base/keygen_handler_win.cc View 1 4 chunks +44 lines, -104 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
rsleevi-old
I missed this structure in the original implementation, and quite honestly I'm surprised that Microsoft ...
10 years, 7 months ago (2010-05-04 03:29:30 UTC) #1
wtc
Ryan: great find! Thank you very much! I suggested some changes below, mostly to remove ...
10 years, 7 months ago (2010-05-05 01:02:06 UTC) #2
rsleevi-old
http://codereview.chromium.org/1934001/diff/1/2 File net/base/keygen_handler_win.cc (right): http://codereview.chromium.org/1934001/diff/1/2#newcode26 net/base/keygen_handler_win.cc:26: bool EncodeAndAppendType(LPCSTR type, const void* to_encode, On 2010/05/05 01:02:06, ...
10 years, 7 months ago (2010-05-05 03:58:42 UTC) #3
wtc
10 years, 7 months ago (2010-05-06 19:04:28 UTC) #4
Ryan, I will check this in.  Thanks.

http://codereview.chromium.org/1934001/diff/1/2
File net/base/keygen_handler_win.cc (right):

http://codereview.chromium.org/1934001/diff/1/2#newcode26
net/base/keygen_handler_win.cc:26: bool EncodeAndAppendType(LPCSTR type, const
void* to_encode,
On 2010/05/05 03:58:42, rsleevi wrote:
>
> It's being used by StoreLocationInCache (Line 207). The encoded
> subjectPublicKeyInfo is used as the key, so that it can be efficiently
retrieved
> once a cert comes in.

My mistake!  I forgot to change the context of your patch
to "Whole file", so I didn't find a caller of EncodeSubjectPublicKeyInfo. 
Sorry.

http://codereview.chromium.org/1934001/diff/1/2#newcode102
net/base/keygen_handler_win.cc:102: std::vector<BYTE> spki;
I asked Mark Mentovai about the alignment of std::vector<unsigned char>.

He told me, after looking up in the C++ Standard, that it
should have the same alignment as the return value of malloc().

http://codereview.chromium.org/1934001/diff/1/2#newcode111
net/base/keygen_handler_win.cc:111:
*reinterpret_cast<PCERT_PUBLIC_KEY_INFO>(&spki[0]);
On 2010/05/05 03:58:42, rsleevi wrote:
>
> Would it be better if I just memcpy'd it on top?

Don't worry about this.

Powered by Google App Engine
This is Rietveld 408576698