Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when parentheses or square brackets in password #1

Closed
gsmetal opened this issue Apr 10, 2013 · 2 comments
Closed

Error when parentheses or square brackets in password #1

gsmetal opened this issue Apr 10, 2013 · 2 comments

Comments

@gsmetal
Copy link

gsmetal commented Apr 10, 2013

Hello! There is an error when parentheses or square brackets in password and using dictionary adjuster:

2.0.0-p0 :001 > checker = StrongPassword::StrengthChecker.new('asdf)asdf')
 => #<StrongPassword::StrengthChecker:0xcdf0f28 @base_password="asdf)asdf"> 
2.0.0-p0 :002 > checker.calculate_entropy(:use_dictionary => true)
RegexpError: unmatched close parenthesis: /\bxcv)(z(x(c(v)?)?)?)?\b/
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:87:in `block in adjusted_entropy'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:75:in `each'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:75:in `each_with_index'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:75:in `adjusted_entropy'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/strength_checker.rb:33:in `calculate_entropy'
    from (irb):2
2.0.0-p0 :003 > checker = StrongPassword::StrengthChecker.new('asdf[]asdf')
 => #<StrongPassword::StrengthChecker:0xccba064 @base_password="asdf[]asdf"> 
2.0.0-p0 :004 > checker.calculate_entropy(:use_dictionary => true)
RegexpError: premature end of char-class: /\bxcv[(\](z(x(c(v)?)?)?)?)?\b/
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:87:in `block in adjusted_entropy'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:75:in `each'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:75:in `each_with_index'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/dictionary_adjuster.rb:75:in `adjusted_entropy'
    from /home/gsmetal/.rvm/gems/ruby-2.0.0-p0/gems/strong_password-0.0.1/lib/strong_password/strength_checker.rb:33:in `calculate_entropy'
    from (irb):4
@bdmac bdmac closed this as completed in e97a51f Apr 11, 2013
@bdmac
Copy link
Owner

bdmac commented Apr 11, 2013

Thanks for reporting this!

@gsmetal
Copy link
Author

gsmetal commented Apr 11, 2013

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants