-
-
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
don't check minimum key size when disabled #1754
Conversation
These comments were added when x/crypto/ed25519 could not yet handle ed25519. It does now, so it should be removed. Also the key type is now replaced with the proper constant.
This moves the actual config lookup before any check is done. This avoids problems with calling to ssh-keygen which doesn't support the expected output format and returning an error, when the check is disabled.
Is this related to a issue encounter ? because https://github.com/go-gitea/gitea/blob/master/models/ssh_key.go#L278 would block at start the check. |
Yes, this is because of an issue encountered in gogs ( #4507 ). |
yes but it disable the check for running with OS ssh server and not the internal. The solution could be to check the version of ssh-keygen for OS ssh server case and make the proper analyze based on that. We could also error on too old ssh-keygen version and suggest to use the internal ssh server in place. |
We could also just warn that we couldn't check the size of key in too old version of ssh-keygen. |
I wouldn't like to just warn the admin about the issue. If he wants to use the feature, he should be able to recognize the problem through errors. Then he can decide if he wants to upgrade or disable the feature, pretty easy. |
LGTM |
LGTM |
Codecov Report
@@ Coverage Diff @@
## master #1754 +/- ##
=========================================
Coverage ? 27.21%
=========================================
Files ? 88
Lines ? 17348
Branches ? 0
=========================================
Hits ? 4721
Misses ? 11942
Partials ? 685
Continue to review full report at Codecov.
|
* cleanup old comments for ed25519 These comments were added when x/crypto/ed25519 could not yet handle ed25519. It does now, so it should be removed. Also the key type is now replaced with the proper constant. * move the minimum key size config before the check This moves the actual config lookup before any check is done. This avoids problems with calling to ssh-keygen which doesn't support the expected output format and returning an error, when the check is disabled.
This fixes an issue that the key size was checked even when the config option was disabled. This led to errors on systems where ssh-keygen didn't report the key options in the expected format.
The other commit removes some older comments which are not correct anymore.