Skip to content

Incorrect treatment of 2a/2y header in equivalency operator #96

@dwendt

Description

@dwendt
head :006 > BCrypt::Password.create("test")
 => "$2a$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO"
head :007 > tpw = BCrypt::Password.new("$2a$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO")
 => "$2a$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO"
head :008 > tpw == "test"
 => true
head :009 > tpw = BCrypt::Password.new("$2y$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO")
 => "$2y$10$HOuBG8tzKLUyk1RK18Xz2uFE76ROdT7w92RSAclL1IoyiS56o70bO"
head :010 > tpw == "test"
 => false

Expected is true on both. 2a and 2y hashes should be perfectly compatible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions