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

Make blowfish/bcrypt work correctly in password_hash filter with passlib #18091

Merged
merged 1 commit into from Oct 22, 2016

Conversation

Projects
None yet
3 participants
@ribbons
Copy link
Contributor

commented Oct 18, 2016

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • password_hash filter
ANSIBLE VERSION
ansible 2.3.0 (passlib-bcrypt 99ad0b07ac) last updated 2016/10/18 20:03:27 (GMT +100)
  lib/ansible/modules/core: (detached HEAD 3266efb02f) last updated 2016/10/18 20:14:07 (GMT +100)
  lib/ansible/modules/extras: (detached HEAD 3f77bb6857) last updated 2016/10/18 20:14:08 (GMT +100)
  config file = 
  configured module search path = Default w/o overrides
SUMMARY

If hashtype for the password_hash filter is blowfish and passlib is available, hashing fails as the hash function for this is named bcrypt (and not blowfish_crypt). This PR special cases blowfish so that the correct function is called.

Command output before change:

failed: [server1] => {"failed": true, "msg": "AttributeError: unknown password hash: 'blowfish_crypt'"}

Command output after change:

ok: [server1]
Make bcrypt + passlib work in password_hash filter
If hashtype for the password_hash filter is 'blowfish' and passlib is
available, hashing fails as the hash function for this is named 'bcrypt'
(and not 'blowfish_crypt').  Special case this so that the correct
function is called.
@mscherer

This comment has been minimized.

Copy link
Contributor

commented Oct 22, 2016

Look good, merging, thanks for the PR

@mscherer mscherer merged commit 692bfa8 into ansible:devel Oct 22, 2016

1 check passed

Shippable Run 4545 status is SUCCESS.
Details
@mscherer

This comment has been minimized.

Copy link
Contributor

commented Oct 22, 2016

Also backported to 2.2

@ribbons ribbons deleted the ribbons:passlib-bcrypt branch Oct 27, 2016

@ansibot ansibot added bug and removed bugfix_pull_request labels Mar 5, 2018

@ansible ansible locked and limited conversation to collaborators Apr 26, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.