-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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 ErrKeyUnableToVerify if fail to calc fingerprint in ssh-keygen #10863
Conversation
Fix go-gitea#3985 Signed-off-by: Andrew Thornton <[email protected]>
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.
Looks good to me but would be better with a new test case here:
Line 159 in f9f2c16
{"ecdsa-384", "SHA256:4qfJOgJDtUd8BrEjyVNdI8IgjiZKouztVde43aDhe1E", "ecdsa-sha2-nistp384 AAAAE2VjZHNhLXNoYTItbmlzdHAzODQAAAAIbmlzdHAzODQAAABhBINmioV+XRX1Fm9Qk2ehHXJ2tfVxW30ypUWZw670Zyq5GQfBAH6xjygRsJ5wWsHXBsGYgFUXIHvMKVAG1tpw7s6ax9oA+dJOJ7tj+vhn8joFqT+sg3LYHgZkHrfqryRasQ== nocomment"}, |
and even better with an integration test using :
https://github.com/go-gitea/gitea/blob/f9f2c163b12f60a6bf9c3652cdc4bdf59e3d53c4/integrations/api_helper_for_declarative_test.go#L140:6
unfortunately I don't have an example otherwise I'd have done the tests |
@zeripath I have created a rsa 1023 bit public key
|
I have just seen your message and you can use either.
|
Codecov Report
@@ Coverage Diff @@
## master #10863 +/- ##
==========================================
+ Coverage 43.42% 43.43% +0.01%
==========================================
Files 593 593
Lines 83262 83268 +6
==========================================
+ Hits 36155 36168 +13
+ Misses 42615 42614 -1
+ Partials 4492 4486 -6
Continue to review full report at Codecov.
|
OK so the issue is that calcFingerprintNative will happily parse both of those keys but calcFingerprintSSHKeygen will not. |
Happily however, testing with both those keys has shown to me that I missed passing up the error upstream. |
So I've discovered that |
Ah, if we have Native SSH key gen we should probably have the minimum key sizes set by default to at least what they are in ssh keygen |
@zeripath yes the standard go lib for rsa is not restricting size (we should check it). |
Fix #3985
Signed-off-by: Andrew Thornton [email protected]