-
-
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
Adding a deploy key from copy/paste doesn't work #7500
Comments
SSH Keys have no linebreaks in the middle, it's probably your terminal erronously adding them. Does adding the same faulty key on GitHub work, btw? It may be possible that we can prevent such errors by stripping any |
Yes it works on github and gitlab.
Would be a good solution :) |
* Strip newlines from SSH keys before adding them Fixes: #7500 * add test for CheckPublicKeyString * add one more test * simplify test * further simplify * make fmt
Great, thank you :) |
Description
If I do a
cat ~/.ssh/id_rsa.pub
and copy paste it in Gitea to the textarea to add a new deploy key, I get the error "Can not verify your SSH key: extractTypeFromBase64Key: invalid key format: illegal base64 data at input byte 168"If I remove the line break in the middle, it works.
It seems that Gitea doesn't handle line returns inside keys.
The text was updated successfully, but these errors were encountered: