-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Use base32 for 2FA scratch token #18384
Conversation
cb68bc8
to
8270a18
Compare
8270a18
to
1dc2860
Compare
I think we should only output non-ambigous readable strings, e.g. exclude
|
Yes, it is, see the code |
Ah, I missed that. Looks fine. |
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.
Code looks good btw. Just a few things that we should address.
This comment has been minimized.
This comment has been minimized.
|
@lunny Sorry I didn't get the point. Do you mean this PR is fine or not fine? This PR only improves the scratch token generation ( |
It seems you have changed |
Where? That's just a refactoring of |
* giteaofficial/main: Use base32 for 2FA scratch token (go-gitea#18384) [skip ci] Updated translations via Crowdin Fix broken oauth2 authentication source edit page (go-gitea#18412) Prevent deadlocks in persistable channel pause test (go-gitea#18410) Bump golangci-lint version (go-gitea#18411) Unexport git.GlobalCommandArgs (go-gitea#18376)
* Use base32 for 2FA scratch token * rename Secure* to Crypto*, add comments
Close #6267
Changes:
util.Random*
toutil.CryptoRandom*
to indicate that they are generating crypto/secure random data.MathRandomInt
because it is much slower and more secure.CryptoRandomBytes
bytes
is an imported package, so the local variables are renamed tobuf
frombytes
Before
After