-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Retry SSH key verification with additional CRLF if it failed #28392
Conversation
Window-based shells will add a CRLF when piping the token into ssh-keygen command resulting in verification error. This resolves go-gitea#21527.
This will reduce the signature verification call by attempting to check the Windows CRLFed token only if the former check failed. Co-authored-by: wxiaoguang <[email protected]>
…gitea into fix/sshkey-validation
Are we sure we want this workaround in Gitea? The error is produced outside of Gitea just because a tool behaves not as intended. |
Yes that's right, it's a Windows Powershell issue that's pending since so many years. However a lot of Windows-based users will run into this issue if they try to verify their key and wonder what's wrong. You can see it at #21527 how many folks struggle with this. Until this issue gets fixed by Powershell the workaround even if GT is not the source of trouble should be implemented but YMMV and it's up for discussion here. |
Here is the related PowerShell issue: PowerShell/PowerShell#5974 |
Since the upstream issue existed for about 5 years. Maybe the workaround is valuable. Add a comment and ref to upstream issue link is prefered. |
Hi @lunny I added a comment referencing the Powershell issue. |
I can vote my approval if the code is not that compact. I really dislike the long |
@wxiaoguang I changed the coding to be more explicit making it easier to read and understand. |
…a#28392) Windows-based shells will add a CRLF when piping the token into ssh-keygen command resulting in verification error. This resolves go-gitea#21527. --------- Co-authored-by: Heiko Besemann <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
* upstream/main: Retry SSH key verification with additional CRLF if it failed (go-gitea#28392)
…#28464) Backport #28392 by @nekrondev Windows-based shells will add a CRLF when piping the token into ssh-keygen command resulting in verification error. This resolves #21527. Co-authored-by: nekrondev <[email protected]> Co-authored-by: Heiko Besemann <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
…a#28392) Windows-based shells will add a CRLF when piping the token into ssh-keygen command resulting in verification error. This resolves go-gitea#21527. --------- Co-authored-by: Heiko Besemann <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
…a#28392) Windows-based shells will add a CRLF when piping the token into ssh-keygen command resulting in verification error. This resolves go-gitea#21527. --------- Co-authored-by: Heiko Besemann <[email protected]> Co-authored-by: wxiaoguang <[email protected]>
Windows-based shells will add a CRLF when piping the token into ssh-keygen command resulting in
verification error. This resolves #21527.