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

Issue 1128008: Mac: Make client-cert picker only show certs the server will accept. (Closed)

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

Description

Mac: Make client-cert picker only show certs the server will accept. BUG=38691 TEST=manual testing with various sites Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=42822 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=42859

Patch Set 1 #

Patch Set 2 : bit of cleanup #

Patch Set 3 : more cleanup #

Total comments: 2

Patch Set 4 : Support other ASN.1 string types #

Patch Set 5 : add IA5String #

Total comments: 11

Patch Set 6 : More string types. Better matching rules. #

Patch Set 7 : Added a test case of parsing T61STRING. #

Total comments: 38
Unified diffs Side-by-side diffs Delta from patch set Stats (+1014 lines, -234 lines) Patch
A net/base/x509_cert_types.h View 1 chunk +134 lines, -0 lines 6 comments Download
A net/base/x509_cert_types.cc View 1 chunk +111 lines, -0 lines 4 comments Download
A net/base/x509_cert_types_mac.cc View 1 chunk +287 lines, -0 lines 12 comments Download
A net/base/x509_cert_types_unittest.cc View 6 1 chunk +343 lines, -0 lines 2 comments Download
M net/base/x509_certificate.h View 1 2 3 4 5 5 chunks +19 lines, -77 lines 0 comments Download
M net/base/x509_certificate.cc View 3 chunks +5 lines, -44 lines 0 comments Download
M net/base/x509_certificate_mac.cc View 1 2 3 4 5 9 chunks +90 lines, -105 lines 10 comments Download
M net/net.gyp View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M net/socket/ssl_client_socket_mac.cc View 1 2 3 4 5 1 chunk +21 lines, -8 lines 4 comments Download

Messages

Total messages: 16 (0 generated)
Jens Alfke
This adds code to - Parse BER DistinguishedNames into Principal objects - Test whether a ...
10 years, 9 months ago (2010-03-19 20:42:06 UTC) #1
rsleevi-old
For what it's worth on platform compatibility/behaviour, this will result in a different chain building ...
10 years, 9 months ago (2010-03-20 01:26:37 UTC) #2
Jens Alfke
http://codereview.chromium.org/1128008/diff/4001/5006 File net/base/x509_types_mac.cc (right): http://codereview.chromium.org/1128008/diff/4001/5006#newcode91 net/base/x509_types_mac.cc:91: { SEC_ASN1_PRINTABLE_STRING, offsetof(KeyValuePair, value), }, On 2010/03/20 01:26:38, rsleevi ...
10 years, 9 months ago (2010-03-22 18:23:40 UTC) #3
Jens Alfke
OK, I've added support for IA5STRING, UTF8STRING and BMPSTRING in addition to PRINTABLESTRING. I made ...
10 years, 9 months ago (2010-03-22 22:06:49 UTC) #4
rsleevi-old
http://codereview.chromium.org/1128008/diff/13001/14006 File net/base/x509_types_mac.cc (right): http://codereview.chromium.org/1128008/diff/13001/14006#newcode127 net/base/x509_types_mac.cc:127: { 0, } You seem to be missing both ...
10 years, 9 months ago (2010-03-22 23:25:11 UTC) #5
rsleevi-old
http://codereview.chromium.org/1128008/diff/13001/14004 File net/base/x509_types.cc (right): http://codereview.chromium.org/1128008/diff/13001/14004#newcode15 net/base/x509_types.cc:15: return against.empty() || against == str; Shouldn't this be ...
10 years, 9 months ago (2010-03-23 01:23:30 UTC) #6
wtc
Jens, Thanks a lot for this changelist. I'm very nervous about us trying to implement ...
10 years, 9 months ago (2010-03-23 01:55:49 UTC) #7
rsleevi-old
On 2010/03/23 01:55:49, wtc wrote: > Jens, > > Thanks a lot for this changelist. ...
10 years, 9 months ago (2010-03-23 04:25:21 UTC) #8
Jens Alfke
http://codereview.chromium.org/1128008/diff/13001/14004 File net/base/x509_types.cc (right): http://codereview.chromium.org/1128008/diff/13001/14004#newcode15 net/base/x509_types.cc:15: return against.empty() || against == str; On 2010/03/23 01:23:30, ...
10 years, 9 months ago (2010-03-23 20:19:57 UTC) #9
wtc
LGTM. Sorry about the delay in reviewing this CL. Two of my comments below are ...
10 years, 9 months ago (2010-03-24 23:52:05 UTC) #10
wtc
I just glanced over rsleevi's earlier comments on this CL. rsleevi, your understanding of PKI ...
10 years, 9 months ago (2010-03-25 00:07:59 UTC) #11
wtc
http://codereview.chromium.org/1128008/diff/29001/30007 File net/base/x509_certificate_mac.cc (right): http://codereview.chromium.org/1128008/diff/29001/30007#newcode771 net/base/x509_certificate_mac.cc:771: NULL, On 2010/03/24 23:52:05, wtc wrote: > IMPORTANT: we ...
10 years, 9 months ago (2010-03-25 01:00:35 UTC) #12
rsleevi-old
http://codereview.chromium.org/1128008/diff/29001/30001 File net/base/x509_cert_types.cc (right): http://codereview.chromium.org/1128008/diff/29001/30001#newcode49 net/base/x509_cert_types.cc:49: std::ostream& operator<<(std::ostream& s, const CertPrincipal& p) { On 2010/03/24 ...
10 years, 9 months ago (2010-03-25 05:34:10 UTC) #13
wtc
rsleevi: thanks for the info. I copied this table from RFC 4514: String X.500 AttributeType ...
10 years, 9 months ago (2010-03-25 07:07:45 UTC) #14
Jens Alfke
Comments below. Except as noted, I've made all suggested changes. I'll be checking in shortly. ...
10 years, 9 months ago (2010-03-26 17:15:04 UTC) #15
wtc
10 years, 9 months ago (2010-03-26 21:03:22 UTC) #16
snej: Thanks for the reply!

http://codereview.chromium.org/1128008/diff/29001/30003
File net/base/x509_cert_types_mac.cc (right):

http://codereview.chromium.org/1128008/diff/29001/30003#newcode214
net/base/x509_cert_types_mac.cc:214: // Displaying the string may not work, but
at least it can be compared
On 2010/03/26 17:15:04, Jens Alfke wrote:
>
> This comment is about the _data_ type, not the attribute type. Two different
> things. I'll change the comment to explicitly say "data type".

You're right.  Sorry about the confusion!

http://codereview.chromium.org/1128008/diff/29001/30003#newcode272
net/base/x509_cert_types_mac.cc:272: if (CSSMOIDEqual(&type, kOIDs[oid])) {
On 2010/03/26 17:15:04, Jens Alfke wrote:
>
> Yup. That's because Principal only stores a specific set of attributes that it
> has instance variables for. Changing that would require rewriting Principal as
a
> general-purpose dictionary/map structure, or at least adding an
> "other_attributes" map to it.

Yes.  My point is that our Matches() method is using
CertPrincipal for proper DistinguishedName comparison,
so attribute types not in the kOIDs array are ignored.
Given this limitation of our Matches() method, we might as
well just do a binary comparison of DistinguishedNames,
which works in practice.

But I do want to note that our Matches() method is fine for
what we use it for (to look for a client cert issued by an
issuer on the server's valie issuers list), so you can check
this in.

http://codereview.chromium.org/1128008/diff/29001/30007
File net/base/x509_certificate_mac.cc (right):

http://codereview.chromium.org/1128008/diff/29001/30007#newcode729
net/base/x509_certificate_mac.cc:729: SecCertificateRef intermediate_handle =
reinterpret_cast<SecCertificateRef>(
On 2010/03/26 17:15:04, Jens Alfke wrote:
>
> It is, but we have to check the issuer of that cert.

In each iteration, you are checking intermediate->subject()
(at line 737 below).  Did you mean to check
intermediate->issuer()?

Nit: since the cert at index i=0 is not an intermediate
cert, the variable names |intermediate_handle| and
|intermediate| are inaccurate.  Perhaps rename them
|cert_handle| and |cert|?

Powered by Google App Engine
This is Rietveld 408576698