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

Issue 118750043: code review 118750043: crypto/subtle: make ConstantTimeCompare return zero for... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 9 months ago by dsymonds
Modified:
9 years, 9 months ago
Reviewers:
agl1
CC:
agl, minux, hanwen-google, agl1, golang-codereviews
Visibility:
Public.

Description

crypto/subtle: make ConstantTimeCompare return zero for args of different length. This is more useful than panicking, since otherwise every caller needs to do the length check before calling; some will forget, and have a potential submarine crasher as a result. Other implementations of this functionality do a length check. This is backward compatible, except if someone has written code that relies on this panicking with different length args. However, that was not the case before Go 1.3 either. Updates issue 7304.

Patch Set 1 #

Patch Set 2 : diff -r 395bf97d72a1 https://code.google.com/p/go #

Patch Set 3 : diff -r 395bf97d72a1 https://code.google.com/p/go #

Patch Set 4 : diff -r cc4f23ba86c7 https://code.google.com/p/go #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -3 lines) Patch
M src/pkg/crypto/subtle/constant_time.go View 2 chunks +2 lines, -3 lines 0 comments Download
M src/pkg/crypto/subtle/constant_time_test.go View 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 8
dsymonds
Hello agl (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go
9 years, 9 months ago (2014-07-16 05:47:05 UTC) #1
minux
this will leak the length information which might or might not be acceptable. i think ...
9 years, 9 months ago (2014-07-16 06:24:26 UTC) #2
dsymonds
Well, if length information is sensitive then we don't provide a way to check that ...
9 years, 9 months ago (2014-07-16 06:27:40 UTC) #3
hanwen-google
On 2014/07/16 06:24:26, minux wrote: > this will leak the length information which might or ...
9 years, 9 months ago (2014-07-16 07:54:27 UTC) #4
minux
On Wed, Jul 16, 2014 at 3:54 AM, <hanwen@google.com> wrote: > On 2014/07/16 06:24:26, minux ...
9 years, 9 months ago (2014-07-16 18:39:53 UTC) #5
agl1
If you are doing a constant-time compare with different length inputs then I think you ...
9 years, 9 months ago (2014-07-16 22:59:47 UTC) #6
agl1
I was convinced. LGTM.
9 years, 9 months ago (2014-07-21 23:41:26 UTC) #7
dsymonds
9 years, 9 months ago (2014-07-22 00:08:30 UTC) #8
*** Submitted as https://code.google.com/p/go/source/detail?r=c36d3f9adce2 ***

crypto/subtle: make ConstantTimeCompare return zero for args of different
length.

This is more useful than panicking, since otherwise every caller needs
to do the length check before calling; some will forget, and have a
potential submarine crasher as a result. Other implementations of this
functionality do a length check.

This is backward compatible, except if someone has written code that
relies on this panicking with different length args. However, that was
not the case before Go 1.3 either.

Updates issue 7304.

LGTM=agl
R=agl, minux, hanwen
CC=golang-codereviews
https://codereview.appspot.com/118750043
Sign in to reply to this message.

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