Chromium Code Reviews
Help | Chromium Project | Sign in
(264)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
3 years, 11 months ago by rsleevi-old
Modified:
2 years, 11 months ago
Reviewers:
wtc
CC:
chromium-reviews_chromium.org, 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) Lint Patch
M net/base/keygen_handler_win.cc View 1 4 chunks +44 lines, -104 lines 0 comments 0 errors Download
Trybot results:
Commit:

Messages

Total messages: 4
rsleevi-old
I missed this structure in the original implementation, and quite honestly I'm surprised that Microsoft ...
3 years, 11 months ago #1
wtc
Ryan: great find! Thank you very much! I suggested some changes below, mostly to remove ...
3 years, 11 months ago #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, ...
3 years, 11 months ago #3
wtc
3 years, 11 months ago #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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 1280:2d3e6564b7b6