Skip to content

Support SCRAM-SHA-256 password hashing on 10+ #30

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

Merged
merged 1 commit into from
May 16, 2019
Merged

Support SCRAM-SHA-256 password hashing on 10+ #30

merged 1 commit into from
May 16, 2019

Conversation

kravietz
Copy link

@kravietz kravietz commented Feb 4, 2019

Attempt to fix #24

Please review this for syntax correctness as I don't have plenty of experience with this.

Copy link
Member

@chris-rock chris-rock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kravietz Thank you for this PR. Great work. I added some ideas for improvement .

end
describe postgres_conf(POSTGRES_CONF_PATH) do
its('password_encryption') { should eq 'on' }
describe command('psql -V') do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make this a ruby function? e.g. def pg_version() that returns 9 or 10 as the version? Then the test could look much simpler:

expected_passwd = /^md5\S*$/
expected_password_encryption = 'on'

if pg_version() == 10
  expected_passwd = /^scram-sha-256\S*$/
  expected_password_encryption = 'scram-sha-256'
end

describe postgres_session(USER, PASSWORD).query('SELECT passwd FROM pg_shadow;') do
    its('output') { should match(expected_passwd) }
end
describe postgres_conf(POSTGRES_CONF_PATH) do
    its('password_encryption') { should eq expected_password_encryption }
end

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chris-rock I'm afraid my knowledge of Ruby is asymptotic to zero :)

@chris-rock
Copy link
Member

@kravietz Can you fix the DCO, I'll work on top of your PR to add the changes then

Signed-off-by: Pawel Krawczyk <pawel.krawczyk@hush.com>
@kravietz
Copy link
Author

Thanks @chris-rock sign-off done!

@chris-rock chris-rock mentioned this pull request Feb 25, 2019
@chris-rock
Copy link
Member

@kravietz Thank you. My PR is up now #31

@atomic111 atomic111 merged commit 15cb658 into dev-sec:master May 16, 2019
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

Successfully merging this pull request may close these issues.

Support sha256 on Postgresql 10+
3 participants