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

Issue 21561003: Add a utility method to convert SPKI from DER to JWK, so far implemented only for EC P256v1 (which … (Closed)

Created:
7 years, 4 months ago by juanlang
Modified:
7 years, 4 months ago
Reviewers:
wtc, Ryan Sleevi
CC:
chromium-reviews, cbentzel+watch_chromium.org, wtc
Base URL:
https://chromium.googlesource.com/chromium/src.git@domain-bound-public-key
Visibility:
Public.

Description

Add a utility method to convert SPKI from DER to JWK, so far implemented only for EC P256v1 (which is used for TLS channel IDs.) BUG=259097 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=216163

Patch Set 1 #

Total comments: 8

Patch Set 2 : Style nits addressed #

Patch Set 3 : Move to jwk_serializer #

Total comments: 12

Patch Set 4 : More nits addressed #

Total comments: 6

Patch Set 5 : Bug fix and nits addressed #

Patch Set 6 : s/uint8_t/unsigned char/g, for windows compile #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+324 lines, -0 lines) Patch
A net/cert/jwk_serializer.h View 1 2 3 4 1 chunk +30 lines, -0 lines 0 comments Download
A net/cert/jwk_serializer_nss.cc View 1 2 3 4 5 1 chunk +118 lines, -0 lines 2 comments Download
A net/cert/jwk_serializer_openssl.cc View 1 2 3 4 1 chunk +22 lines, -0 lines 1 comment Download
A net/cert/jwk_serializer_unittest.cc View 1 2 3 4 1 chunk +148 lines, -0 lines 1 comment Download
M net/net.gyp View 1 2 3 4 chunks +6 lines, -0 lines 0 comments Download

Messages

Total messages: 15 (0 generated)
juanlang
Hi Ryan, is this something along what you had in mind? I only added support ...
7 years, 4 months ago (2013-08-01 18:22:51 UTC) #1
juanlang
On 2013/08/01 18:22:51, juanlang wrote: > Hi Ryan, is this something along what you had ...
7 years, 4 months ago (2013-08-02 20:18:36 UTC) #2
Ryan Sleevi
So yeah, this is actually pretty much what I had in mind, and I think ...
7 years, 4 months ago (2013-08-02 23:08:43 UTC) #3
juanlang
Thanks very much for your help, Ryan. Especially, for reading between the lines and catching ...
7 years, 4 months ago (2013-08-05 17:50:16 UTC) #4
Ryan Sleevi
Note you can reply using the WebUI, so at least it can track the discussion ...
7 years, 4 months ago (2013-08-05 18:12:10 UTC) #5
juanlang
On 2013/08/05 18:12:10, Ryan Sleevi wrote: > Note you can reply using the WebUI, so ...
7 years, 4 months ago (2013-08-05 23:02:17 UTC) #6
Ryan Sleevi
https://codereview.chromium.org/21561003/diff/12001/net/cert/jwk_serializer_nss.cc File net/cert/jwk_serializer_nss.cc (right): https://codereview.chromium.org/21561003/diff/12001/net/cert/jwk_serializer_nss.cc#newcode27 net/cert/jwk_serializer_nss.cc:27: // nit: extraneous // https://codereview.chromium.org/21561003/diff/12001/net/cert/jwk_serializer_nss.cc#newcode101 net/cert/jwk_serializer_nss.cc:101: SECKEY_DestroySubjectPublicKeyInfo(spki); If you ...
7 years, 4 months ago (2013-08-06 19:50:38 UTC) #7
juanlang
Thanks again, Ryan. Here you go. And, qq: what about function capitalization? The Chromium/Google style ...
7 years, 4 months ago (2013-08-06 21:32:59 UTC) #8
Ryan Sleevi
LGTM, mod nit/bug https://codereview.chromium.org/21561003/diff/19001/net/cert/jwk_serializer.h File net/cert/jwk_serializer.h (right): https://codereview.chromium.org/21561003/diff/19001/net/cert/jwk_serializer.h#newcode22 net/cert/jwk_serializer.h:22: NET_EXPORT_PRIVATE bool ConvertSPKIFromDERToJWK( Non-normatively, http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Type_Names#Type_Names suggests ...
7 years, 4 months ago (2013-08-06 21:59:42 UTC) #9
juanlang
Thanks, Ryan. Committing after trybots give the go ahead. https://codereview.chromium.org/21561003/diff/19001/net/cert/jwk_serializer.h File net/cert/jwk_serializer.h (right): https://codereview.chromium.org/21561003/diff/19001/net/cert/jwk_serializer.h#newcode22 net/cert/jwk_serializer.h:22: ...
7 years, 4 months ago (2013-08-06 23:32:17 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/juanlang@google.com/21561003/17007
7 years, 4 months ago (2013-08-07 02:50:59 UTC) #11
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) remoting_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=157220
7 years, 4 months ago (2013-08-07 04:07:21 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/juanlang@google.com/21561003/17007
7 years, 4 months ago (2013-08-07 11:54:46 UTC) #13
commit-bot: I haz the power
Change committed as 216163
7 years, 4 months ago (2013-08-07 12:34:56 UTC) #14
wtc
7 years, 4 months ago (2013-08-08 19:26:08 UTC) #15
Message was sent while issue was closed.
Patch set 6 LGTM. I only did a cursory review of the CL.

https://chromiumcodereview.appspot.com/21561003/diff/17007/net/cert/jwk_seria...
File net/cert/jwk_serializer_nss.cc (right):

https://chromiumcodereview.appspot.com/21561003/diff/17007/net/cert/jwk_seria...
net/cert/jwk_serializer_nss.cc:25: static const int kPrime256v1EncodingType = 4;

Nit: this 4 means the encoding format is uncompressed, so it may be better
to name this constant kUncompressedEncodingType.

https://chromiumcodereview.appspot.com/21561003/diff/17007/net/cert/jwk_seria...
net/cert/jwk_serializer_nss.cc:28: // NSS gives the length as the bit length.

Yes, I confirm this. spki->subjectPublicKey is a BIT STRING, so the length
is the number of bits.

https://chromiumcodereview.appspot.com/21561003/diff/17007/net/cert/jwk_seria...
File net/cert/jwk_serializer_openssl.cc (right):

https://chromiumcodereview.appspot.com/21561003/diff/17007/net/cert/jwk_seria...
net/cert/jwk_serializer_openssl.cc:6: #include "net/cert/jwk_serializer.h"

Nit: the Style Guide recommends net/cert/jwk_serializer.h should be included
first, like this:

#include "net/cert/jwk_serializer.h"
	
#include "base/logging.h"

https://chromiumcodereview.appspot.com/21561003/diff/17007/net/cert/jwk_seria...
File net/cert/jwk_serializer_unittest.cc (right):

https://chromiumcodereview.appspot.com/21561003/diff/17007/net/cert/jwk_seria...
net/cert/jwk_serializer_unittest.cc:29: static const unsigned int kEcPointSize =
32U;

The constant name kEcPointSize is confusing because an EC point consists
of the x and y coordinates, but 32U is the size of just one coordinate.

Powered by Google App Engine
This is Rietveld 408576698