auth: fix CheckScrambledPassword() panic for invalid input#1197
auth: fix CheckScrambledPassword() panic for invalid input#1197kennytm merged 3 commits intopingcap:masterfrom
Conversation
|
The malformed data maybe related to pingcap/tidb#19603, maybe we are not resolving the protocol correctly, but I have no clue. PTAL @djshow832 @morgo |
|
/lgtm |
https://github.com/pingcap/parser/pull/1197/files#diff-b06746870e62f95017714121be6134cffdc4bd1d46dd21f8cae8c484e3e2829dR47-R49 That's all for it. |
| terror.Log(errors.Trace(err)) | ||
| hash := crypt.Sum(nil) | ||
| // token = scrambleHash XOR stage1Hash | ||
| if len(auth) != len(hash) { |
There was a problem hiding this comment.
Is it possible that len(auth) > len(hash)?
There was a problem hiding this comment.
It doesn't matter, as long as len(auth) != len(hash) the input is invalid.
|
/lgtm |
|
/merge |
|
/run-all-tests |
|
@tiancaiamao merge failed. |
I took a look. The There are other authentication plugins besides |
|
/run-all-tests |
|
I think we should just get rid of the integration test. The TiDB is always lagging behind making it almost always failing and impossible to use "/merge". |
|
cherry pick to release-5.0 failed |
Yup, I've said I have no clue. I'm not sure how that happen and what trigger the malformed input. |
) * auth: fix CheckScrambledPassword() panic for invalid input * fix CI Co-authored-by: ti-srebot <[email protected]>
) * auth: fix CheckScrambledPassword() panic for invalid input * fix CI Co-authored-by: ti-srebot <[email protected]>
…1199) * auth: fix CheckScrambledPassword() panic for invalid input * fix CI Co-authored-by: ti-srebot <[email protected]> Co-authored-by: ti-srebot <[email protected]>
…1200) * auth: fix CheckScrambledPassword() panic for invalid input * fix CI Co-authored-by: ti-srebot <[email protected]> Co-authored-by: ti-srebot <[email protected]>
) * auth: fix CheckScrambledPassword() panic for invalid input * fix CI Co-authored-by: ti-srebot <[email protected]>
What problem does this PR solve?
What is changed and how it works?
The input data may be invalid, but calling
CheckScrambledPassword()on malformed data should not make TiDB server panic.Check List
Tests
Related changes