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

proxy: simplify password validation #7188

Merged
merged 1 commit into from Mar 21, 2024

Conversation

conradludgate
Copy link
Contributor

Problem

for HTTP/WS/password hack flows we imitate SCRAM to validate passwords. This code was unnecessarily complicated.

Summary of changes

Copy in the pbkdf2 and 'derive keys' steps from the postgres_protocol crate in our rust-postgres fork. Derive the client_key, server_key and stored_key from the password directly. Use constant time equality to compare the stored_key and server_key with the ones we are sent from cplane.

Checklist before requesting a review

  • I have performed a self-review of my code.
  • If it is a core feature, I have added thorough tests.
  • Do we need to implement analytics? if so did you add the relevant metrics to the dashboard?
  • If this PR requires public announcement, mark it with /release-notes label and add several sentences in this section.

Checklist before merging

  • Do not forget to reformat commit message to not include the above checklist

@conradludgate conradludgate requested a review from a team as a code owner March 20, 2024 16:53
@conradludgate conradludgate changed the title proxy: simplify password valifation proxy: simplify password validation Mar 20, 2024
Copy link

github-actions bot commented Mar 20, 2024

2706 tests run: 2574 passed, 0 failed, 132 skipped (full report)


Flaky tests (1)

Postgres 14

  • test_statvfs_pressure_usage: debug

Code coverage* (full report)

  • functions: 28.5% (7212 of 25313 functions)
  • lines: 47.2% (44266 of 93860 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
ed540d2 at 2024-03-21T12:29:13.581Z :recycle:

@conradludgate conradludgate force-pushed the proxy-simplify-password-validation branch from db4e560 to ed540d2 Compare March 21, 2024 11:40
@conradludgate conradludgate enabled auto-merge (squash) March 21, 2024 11:41
@conradludgate conradludgate merged commit d530433 into main Mar 21, 2024
53 checks passed
@conradludgate conradludgate deleted the proxy-simplify-password-validation branch March 21, 2024 13:54
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.

None yet

2 participants