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

Add SHA256 git support to Gitea #16

Open
dirkmueller opened this issue Apr 5, 2023 · 3 comments
Open

Add SHA256 git support to Gitea #16

dirkmueller opened this issue Apr 5, 2023 · 3 comments
Assignees

Comments

@dirkmueller
Copy link
Member

The current default of SHA1 in distributed per-package gits could be potentially too weak as it allows for collision attacks (collisions are only avoided on a per repo basis). To mitigate that we could start with sha256 gits right away. The alternative would be monorepo, which however many dislike.

Gitea currently is not able to support SHA256. We need to add support.

@dirkmueller
Copy link
Member Author

@AdamMajer has started an implementation upstream: go-gitea/gitea#23894

@AdamMajer AdamMajer self-assigned this Apr 5, 2023
@AdamMajer
Copy link
Member

The caveats here to remember.

On positive side:

  • signed sha256 repository commits are probably secure and we don't have to worry about weakening integrity checks via sha1 weaknesses
  • native integrity check without external tools like Git-EVTag-v0-SHA512

On negative side

  • sha256 repositories can't interact with sha1 repositories, which means using upstream's spec files (ie. native packaging) probably will not work until https://git-scm.com/docs/hash-function-transition/ is implemented
  • sha256 support is still listed in git as "experimental"

@AdamMajer AdamMajer assigned AdamMajer and lnussel and unassigned AdamMajer and lnussel Apr 5, 2023
@JanZerebecki
Copy link
Member

While not the best decision security wise, I lean towards stick with the git default of sha1 for now:

  • no risk of tripping over something that hinders our move
  • no risk of needing to rewrite history if some incompatibility with the existing sha256 implementation happens
  • we do not prevent us from adopting workflows that directly combine with upstream repos, which will mostly be sha1 (this seems to be the only heavy reason in favor sticking with sha1)
  • we might be able to adapt git-evtag for commits if we need to be compliant before migration is ready
  • we need someone to implement the migration in upstream git anyway, without that the risk of sha1 still exists in upstream repos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🏗 In progress
Development

When branches are created from issues, their pull requests are automatically linked.

4 participants