-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
caching_sha2_password iterations handling error #43576
Comments
related code : tidb/parser/auth/caching_sha2.go Line 172 in ff78940
tidb/parser/auth/caching_sha2.go Line 204 in ff78940
|
This affects accounts that have an
5000 iterations is hardcoded in TiDB in In MySQL this can be configured with
So for 10*1000 = 10_000 iterations the correct value is So this impacts only accounts that were migrated from MySQL to TiDB and were created on MySQL with non-default settings for Example: package main
import "fmt"
func main() {
for _, v := range []int{5, 10} {
fmt.Printf("%2d - dec: %#v\n", v, []byte(fmt.Sprintf("%03d", v)))
fmt.Printf("%2d - hex: %#v\n", v, []byte(fmt.Sprintf("%03X", v)))
}
} output:
|
Bug Report
1. Minimal reproduce step (Required)
In MySQL the default number of rounds is 5000. The MySQL server being tested has been configured with 10000 rounds using the caching_sha2_password_digest_rounds server system variable.
A hash with 10000 iterations gets retrieved that starts like this:
$A$00A$...
instead of$A$010$...
2. What did you expect to see?
The number of iterations should be decoded in hexadecimal not decimal
related info
https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_caching_sha2_password_digest_rounds
hashcat/hashcat#3049
The text was updated successfully, but these errors were encountered: