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

Issue 2865603002: X509NameAttribute::ValueAsString: Decode TeletexString as Latin1. (Closed)

Created:
3 years, 7 months ago by mattm
Modified:
3 years, 7 months ago
Reviewers:
eroman, davidben
CC:
chromium-reviews, cbentzel+watch_chromium.org, net-reviews_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

X509NameAttribute::ValueAsString: Decode TeletexString as Latin1. BUG=717905, 715969 Review-Url: https://codereview.chromium.org/2865603002 Cr-Commit-Position: refs/heads/master@{#469812} Committed: https://chromium.googlesource.com/chromium/src/+/788812f7788c07aa58487523ec70f9e921d78543

Patch Set 1 #

Patch Set 2 : nacl hack #

Patch Set 3 : update ParseNameTest #

Total comments: 14

Patch Set 4 : review changes for comment #14 #

Patch Set 5 : add comment/todo about nacl difference #

Unified diffs Side-by-side diffs Delta from patch set Stats (+274 lines, -15 lines) Patch
M net/BUILD.gn View 1 chunk +4 lines, -0 lines 0 comments Download
M net/cert/internal/parse_name.cc View 1 2 3 4 2 chunks +12 lines, -6 lines 0 comments Download
M net/cert/internal/parse_name_unittest.cc View 1 2 1 chunk +5 lines, -4 lines 0 comments Download
M net/cert/x509_certificate_unittest.cc View 1 2 3 2 chunks +81 lines, -0 lines 0 comments Download
A net/data/parse_certificate_unittest/subject_t61string.pem View 1 chunk +35 lines, -0 lines 0 comments Download
A net/data/parse_certificate_unittest/subject_t61string_1-32.pem View 1 chunk +35 lines, -0 lines 0 comments Download
A net/data/parse_certificate_unittest/subject_t61string_126-160.pem View 1 chunk +36 lines, -0 lines 0 comments Download
A net/data/parse_certificate_unittest/subject_t61string_actual.pem View 1 chunk +44 lines, -0 lines 0 comments Download
M net/data/parse_certificate_unittest/v3_certificate_template.txt View 2 chunks +2 lines, -0 lines 0 comments Download
M net/test/test_data_directory.h View 1 chunk +4 lines, -0 lines 0 comments Download
M net/test/test_data_directory.cc View 1 2 3 1 chunk +16 lines, -5 lines 0 comments Download

Messages

Total messages: 28 (19 generated)
mattm
I verified that all the platform native impls just treat them as latin1 or cp1252(which ...
3 years, 7 months ago (2017-05-05 02:38:09 UTC) #4
mattm
On 2017/05/05 02:38:09, mattm wrote: > I verified that all the platform native impls just ...
3 years, 7 months ago (2017-05-05 02:45:07 UTC) #5
eroman
https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc File net/cert/internal/parse_name.cc (right): https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc#newcode202 net/cert/internal/parse_name.cc:202: // For nacl, just fall through to treating like ...
3 years, 7 months ago (2017-05-05 17:55:29 UTC) #14
mattm
https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc File net/cert/internal/parse_name.cc (right): https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc#newcode202 net/cert/internal/parse_name.cc:202: // For nacl, just fall through to treating like ...
3 years, 7 months ago (2017-05-05 19:58:39 UTC) #18
eroman
lgtm https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc File net/cert/internal/parse_name.cc (right): https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc#newcode202 net/cert/internal/parse_name.cc:202: // For nacl, just fall through to treating ...
3 years, 7 months ago (2017-05-05 20:07:08 UTC) #19
mattm
https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc File net/cert/internal/parse_name.cc (right): https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse_name.cc#newcode202 net/cert/internal/parse_name.cc:202: // For nacl, just fall through to treating like ...
3 years, 7 months ago (2017-05-05 20:16:25 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2865603002/100001
3 years, 7 months ago (2017-05-05 20:18:36 UTC) #23
commit-bot: I haz the power
Committed patchset #5 (id:100001) as https://chromium.googlesource.com/chromium/src/+/788812f7788c07aa58487523ec70f9e921d78543
3 years, 7 months ago (2017-05-05 23:49:23 UTC) #26
davidben
3 years, 7 months ago (2017-05-12 16:47:26 UTC) #28
Message was sent while issue was closed.
https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse...
File net/cert/internal/parse_name.cc (right):

https://codereview.chromium.org/2865603002/diff/40001/net/cert/internal/parse...
net/cert/internal/parse_name.cc:202: // For nacl, just fall through to treating
like IA5String (ascii).
On 2017/05/05 20:16:25, mattm wrote:
> On 2017/05/05 20:07:07, eroman wrote:
> > On 2017/05/05 19:58:39, mattm wrote:
> > > On 2017/05/05 17:55:29, eroman wrote:
> > > > Why the difference for  nacl?
> > > 
> > > the net/ build for nacl doesn't include base/net_string_util_icu.cc or the
> > > //base:i18n and //third_party/icu deps. It looks like nacl actually does
> > depend
> > > on ICU through other chains, but simply adding the deps in net and using
the
> > > ConvertToUtf8 increased newlib_pnacl/remoting_client_plugin_newlib.pexe by
> > 100KB
> > > (release build).
> > > 
> > > Given David's comment on https://codereview.chromium.org/2861813002/ I
don't
> > > think nacl will care about this. So I don't really like making this
> > difference,
> > > but I was thinking it's probably not worth increasing nacl build size by
> > 100KB.
> > 
> > It is unfortunate to have a different behavior here, should it ever grow
more
> > dependencies on this.
> > 
> > Can you add a comment explaining this, and perhaps a TODO as well?
> 
> Done.

FWIW, Latin1 doesn't need much code to convert to UTF-8:

out->clear();
size_t len = value.Length();
for (char c : value.AsStringPiece()) {
  if (static_cast<uint8_t>(c) > 0x7f)
    len++;
}
out->reserve(len);
for (char c : value.AsStringPiece()) {
  uint8_t u = static_cast<uint8_t>(c);
  if (u > 0x7f) {
    out->push_back(0xc0 | (u >> 6));
    out->push_back(0x80 | (u & 0x3f));
  } else {
    out->push_back(u);
  }
}
DCHECK_EQ(len, out->size());

Powered by Google App Engine
This is Rietveld 408576698