-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Add support for hashed caching sha2 passwords #17948
base: main
Are you sure you want to change the base?
Add support for hashed caching sha2 passwords #17948
Conversation
This allows for storing already hashed caching sha2 passwords for authentication. This way you can use the new authentication method without needing the password to be in plain text. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
// for 4.1 style password hashes. It drops the optionally leading * before | ||
// decoding the rest as a hex encoded string. | ||
func DecodeMysqlNativePasswordHex(hexEncodedPassword string) ([]byte, error) { | ||
func DecodePasswordHex(hexEncodedPassword string) ([]byte, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed this since it's really a hex decoding helper, not specifically related to mysql_native_password
.
@@ -22,11 +22,11 @@ import ( | |||
"github.com/stretchr/testify/assert" | |||
) | |||
|
|||
func TestVerifyHashedMysqlNativePassword(t *testing.T) { | |||
func TestVerifyHashedCachingSha2Password(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The names here of the test were swapped compare to the implementation!
Opened #17948 as well. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17948 +/- ##
==========================================
- Coverage 67.56% 67.56% -0.01%
==========================================
Files 1597 1597
Lines 259763 259807 +44
==========================================
+ Hits 175506 175527 +21
- Misses 84257 84280 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This allows for storing already hashed caching sha2 passwords for authentication. This way you can use the new authentication method without needing the password to be in plain text.
Related Issue(s)
Fixes #17947
Checklist