Skip to content

bcrypt: key expansion gets skipped if cost has a value of 31 #4803

@gopherbot

Description

@gopherbot

by shreds-of-sanity@gmx.net:

Reference:
http://code.google.com/p/go/source/browse/bcrypt/bcrypt.go?spec=svn.crypto.75e869cbf335427fa8d03e0943662b56b1318ee8&;repo=crypto&r=fa541a5bd620ceb0b7c3c237c3a4f4840cc87fda#206

Description:
Calling GenerateFromPassword() with a "cost" of 31 results in an integer
overflow in expensiveBlowfishSetup(): the value of "rounds" becomes negative
(line 223) and the key expansion loop (line 224) won't be entered.

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