Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7314)

Issue 14441057: Faster ASN.1 parsing

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 6 months ago by ekasper
Modified:
10 years, 5 months ago
CC:
ctlog-opensource-review_google.com, ngalbreath
Visibility:
Public.

Description

Faster ASN.1 parsing

Patch Set 1 #

Patch Set 2 : fix init #

Patch Set 3 : fix encoding #

Patch Set 4 : Fix metaclasses to not erase components #

Patch Set 5 : 25% faster decoding #

Total comments: 22

Patch Set 6 : comments #

Patch Set 7 : more doc #

Total comments: 22

Patch Set 8 : Ben's comments #

Patch Set 9 : strict mode #

Patch Set 10 : tighten allowed errors #

Total comments: 31

Patch Set 11 : Add tests, address comments #

Total comments: 2

Patch Set 12 : sync docstring #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2527 lines, -82 lines) Patch
M src/python/Makefile View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download
M src/python/ct/crypto/error.py View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -0 lines 0 comments Download
A + src/python/ct/crypto/my_asn1/__init__.py View 1 0 chunks +-1 lines, --1 lines 0 comments Download
A + src/python/ct/crypto/my_asn1/oid.py View 1 2 3 4 5 6 7 8 9 10 4 chunks +142 lines, -83 lines 0 comments Download
A src/python/ct/crypto/my_asn1/oid_test.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +77 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/tag.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +107 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/tag_test.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +54 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/type_test_base.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +96 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/types.py View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1199 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/types_test.py View 1 2 3 4 5 6 7 8 9 10 1 chunk +599 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/x509.py View 1 chunk +70 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/x509_extension.py View 1 chunk +45 lines, -0 lines 0 comments Download
A src/python/ct/crypto/my_asn1/x509_name.py View 1 chunk +131 lines, -0 lines 0 comments Download

Messages

Total messages: 18
ekasper
Congratulations Eran, you're the lucky winner and get to review this monster CL! Do not ...
10 years, 6 months ago (2013-10-10 18:11:36 UTC) #1
ekasper
(FYI: small update to the patch to fix metaclasses.) On 2013/10/10 18:11:36, ekasper wrote: > ...
10 years, 6 months ago (2013-10-15 09:20:23 UTC) #2
ekasper
And updated again. Any and Choice handling is slightly changed, the rest is just rephrasing. ...
10 years, 6 months ago (2013-10-15 16:11:05 UTC) #3
Eran
Some preliminary comments. Overall the Python code looks good and I've had minor comments so ...
10 years, 6 months ago (2013-10-17 13:07:34 UTC) #4
ekasper
Thanks! "Better ASN.1 understanding" is a mostly mythical beast. But adding benl@ in case he ...
10 years, 6 months ago (2013-10-17 17:01:58 UTC) #5
Ben Laurie (Google)
https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py File src/python/ct/crypto/my_asn1/oid.py (right): https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py#newcode11 src/python/ct/crypto/my_asn1/oid.py:11: class ObjectIdentifier(types.Abstract): Might be nice to explain the encoding, ...
10 years, 6 months ago (2013-10-18 12:25:13 UTC) #6
ekasper
Thanks, Ben! Caught quite a few inconsistencies there. https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py File src/python/ct/crypto/my_asn1/oid.py (right): https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py#newcode11 src/python/ct/crypto/my_asn1/oid.py:11: class ...
10 years, 6 months ago (2013-10-18 13:45:24 UTC) #7
ekasper
+cc nickg Nick, I wanted to give you a heads up of the planned changes ...
10 years, 6 months ago (2013-10-18 13:57:07 UTC) #8
Ben Laurie (Google)
https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py File src/python/ct/crypto/my_asn1/oid.py (right): https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py#newcode79 src/python/ct/crypto/my_asn1/oid.py:79: "an OID component", error.ASN1Warning) On 2013/10/18 13:45:24, ekasper wrote: ...
10 years, 6 months ago (2013-10-21 10:41:01 UTC) #9
ekasper
https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py File src/python/ct/crypto/my_asn1/oid.py (right): https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py#newcode79 src/python/ct/crypto/my_asn1/oid.py:79: "an OID component", error.ASN1Warning) On 2013/10/21 10:41:01, Ben Laurie ...
10 years, 6 months ago (2013-10-22 16:02:27 UTC) #10
ekasper
Also, PTAL now! On Tue, Oct 22, 2013 at 6:02 PM, <ekasper@google.com> wrote: > > ...
10 years, 6 months ago (2013-10-22 16:04:00 UTC) #11
Eran
Some more comments. Overall the code looks good, I'm waiting for some tests that will ...
10 years, 6 months ago (2013-10-25 11:08:45 UTC) #12
ekasper
Now with tests :) Other changes since last patch set: -- unify __eq__ across all ...
10 years, 6 months ago (2013-10-30 18:25:12 UTC) #13
ekasper
Gentle poke... On 2013/10/30 18:25:12, ekasper wrote: > Now with tests :) > > Other ...
10 years, 5 months ago (2013-11-06 12:08:16 UTC) #14
Ben Laurie (Google)
drive-by LGTM, modulo minor comments... https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py File src/python/ct/crypto/my_asn1/oid.py (right): https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_asn1/oid.py#newcode112 src/python/ct/crypto/my_asn1/oid.py:112: (value[0], value[1])) On 2013/10/18 ...
10 years, 5 months ago (2013-11-06 12:23:15 UTC) #15
ekasper
Is a drive-by LGTM good enough, or should I wait for Eran to chime in? ...
10 years, 5 months ago (2013-11-06 12:49:04 UTC) #16
Ben Laurie (Google)
On 6 November 2013 12:49, <ekasper@google.com> wrote: > Is a drive-by LGTM good enough, or ...
10 years, 5 months ago (2013-11-06 13:10:37 UTC) #17
ekasper
10 years, 5 months ago (2013-11-06 13:13:12 UTC) #18
Ok, I'll submit this to carry on with life and save Eran's time :) Eran - if
there's something you definitely wanted to add then I'm of course happy to take
comments and address in a follow-up CL.

On 2013/11/06 13:10:37, Ben Laurie (Google) wrote:
> On 6 November 2013 12:49,  <mailto:ekasper@google.com> wrote:
> > Is a drive-by LGTM good enough, or should I wait for Eran to chime in?
> 
> Good enough for me - I did review all changes since my last comments :-)
> 
> > :)
> >
> >
> >
> >
>
https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_as...
> > File src/python/ct/crypto/my_asn1/oid.py (right):
> >
> >
>
https://codereview.appspot.com/14441057/diff/30001/src/python/ct/crypto/my_as...
> > src/python/ct/crypto/my_asn1/oid.py:112: (value[0], value[1]))
> > On 2013/11/06 12:23:15, Ben Laurie (Google) wrote:
> >>
> >> On 2013/10/18 13:45:24, ekasper wrote:
> >> > On 2013/10/18 12:25:13, Ben Laurie (Google) wrote:
> >> > > Seems to me second component must be <= 175 (== 255 - 80) if first
> >
> > is 2, no?
> >>
> >> >
> >> > Uh, seems so. Fixed.
> >
> >
> >> I don't see a fix?
> >
> >
> >
> > This comment applies to an earlier patch-set that had the fix. The fix
> > was wrong: it's not, in fact, true that the second component must be <=
> > 175. The correct fix is to encode 40*first + second as a proper
> > component, which I've done now.
> 
> Aha.
> 
> > Sorry for the confusion, I think your comments have crossed with Eran's
> > here.
> >
> >
> >
>
https://codereview.appspot.com/14441057/diff/283001/src/python/ct/crypto/my_a...
> > File src/python/ct/crypto/my_asn1/types.py (right):
> >
> >
>
https://codereview.appspot.com/14441057/diff/283001/src/python/ct/crypto/my_a...
> > src/python/ct/crypto/my_asn1/types.py:76: strict: if False, tolerate
> > encoding with a non-minimal number of octets.
> > On 2013/11/06 12:23:15, Ben Laurie (Google) wrote:
> >>
> >> Maybe "tolerate encodings seen in the wild"?
> >
> >
> > Stale docstring, fixed. I think this change got lost in the long thread
> > of comments: I was wrong to assume non-minimal encodings were valid BER,
> > and I haven't seen it in the wild so far, so I've nuked it.
> >
> > https://codereview.appspot.com/14441057/
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b