Skip to content
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

[Error-Handling] 500 when try to Add infalid SSH-Key #8800

Closed
6543 opened this issue Nov 3, 2019 · 6 comments · Fixed by #8806
Closed

[Error-Handling] 500 when try to Add infalid SSH-Key #8800

6543 opened this issue Nov 3, 2019 · 6 comments · Fixed by #8806
Labels
Milestone

Comments

@6543
Copy link
Member

6543 commented Nov 3, 2019

Afected:

  • Repo Deploy-Key
  • User-Settings add Keys

what i would expect:
-> gitea tell the user that it needs a valide ssh key

version: current

@6543 6543 changed the title [BUG] repo-settings: Add Deploy Key: 500 [Bug] repo-settings: Add Deploy Key: 500 Nov 3, 2019
@guillep2k
Copy link
Member

Could you describe steps to reproduce?
Note for our future "current", current is currently 1.11.0+dev-153-gfe7a6d9bf

@6543
Copy link
Member Author

6543 commented Nov 3, 2019

  1. got test repo (I used https://gitea.com/test-organisation/TestRepo)
  2. open repo settings
  3. go to "Deploy Keys"
  4. klick button "Add Deploy Key"
  5. Type in "Title: test; Contet: test" (if you enable write Access is not relevant)
  6. klick "Add Deploy Key" at the buton of the formular
    here you are

@6543

This comment has been minimized.

@guillep2k
Copy link
Member

It works if the key is valid. It fails to validate the input.

https://qsandbox.com/tools/private-public-keygen

Valid content (doesn't fail):

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC67nQGOZlUXELmugesFEMfygXnqTNRIv6rWXdmT5WudNcaX3ARDt7SqLRSPE7w2B3g1L96zhE4p9XcVZGYNsCldDgoGG0e7Ocvffdbi+mAKdeXC7WXmvl/zJEd+qx7WnhW/n19We+rdABNb7ZEdYtL8MD4/LB4WukNsEpDUrn693G6QrqunY5fpZXna7qJ3LvTaxTgbLlydJfdgeDAlpEqgD4FBbmpBoq9fE1RyV13kIXK32Tp+M2cTLHBtusckhReTq89cZDDTdDFgH84qpLK1GcPbNANSRLsmJFf5VgKXr/UNZLzdJBq/vD16Ta4w6CDeVC1MoeTN33vLNd1ICgH qsandbox

@6543
Copy link
Member Author

6543 commented Nov 3, 2019

@guillep2k
yes - I know ... (now)
first touhgt was deployment key is like a tocken :()

@6543
Copy link
Member Author

6543 commented Nov 3, 2019

same same is at http:///user/settings/keys

-> gitea should not show 500 instead tell the user that it needs a valide ssh key

@6543 6543 changed the title [Bug] repo-settings: Add Deploy Key: 500 [Bug] 500 when try to Add infalid SSH-Key Nov 3, 2019
@6543 6543 changed the title [Bug] 500 when try to Add infalid SSH-Key [Error-Handling] 500 when try to Add infalid SSH-Key Nov 3, 2019
@lunny lunny added type/enhancement An improvement of existing functionality type/bug and removed type/enhancement An improvement of existing functionality labels Nov 3, 2019
@lunny lunny added this to the 1.9.6 milestone Nov 3, 2019
mrsdizzie added a commit to mrsdizzie/gitea that referenced this issue Nov 3, 2019
Avoid out of bounds error by using strings.HasPrefix to check for
starting SSH2 text rather than assuming user input has at least 31
characters.

Add tests for bad input as well.

Fixes go-gitea#8800
lunny pushed a commit that referenced this issue Nov 3, 2019
Avoid out of bounds error by using strings.HasPrefix to check for
starting SSH2 text rather than assuming user input has at least 31
characters.

Add tests for bad input as well.

Fixes #8800
6543 pushed a commit to 6543-forks/gitea that referenced this issue Nov 3, 2019
Avoid out of bounds error by using strings.HasPrefix to check for
starting SSH2 text rather than assuming user input has at least 31
characters.

Add tests for bad input as well.

Fixes go-gitea#8800
lunny pushed a commit that referenced this issue Nov 3, 2019
Avoid out of bounds error by using strings.HasPrefix to check for
starting SSH2 text rather than assuming user input has at least 31
characters.

Add tests for bad input as well.

Fixes #8800
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants