Skip to content

crypto/subtle: ConstantTimeCompare does not barf if slice lengths are unequal #7304

Closed
@hanwen

Description

@hanwen
http://play.golang.org/p/12ZtQewpMz

What is the expected output?

I expect symmetrical behavior, and since the use is incorrect, it would be good to
panic. If somebody puts attacker controlled data in the first arg misuse would be
disastrous.


What do you see instead?

if the 2nd argument is smaller than the 1st => crash
if the 1st argument is smaller than the 2nd => success

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions