git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Soundness of signature verification excluding unsigned empty merges

From
LPLundkvist Per <per.lundkvist@saabgroup.com>
Date
Mar 21, 2023, 10:32 UTC
Message-ID
<27a7d2956ed94d7ea8eb6d17f1414525@saabgroup.com>
Hi,

We are investigating adding commit and tag signatures into our existing repositories. We currently use the common workflow of developers merging commits to master using an internal git hosting service after having passed code review. Non-local merges like this would then be unsigned.

But it seems like if we allow unsigned empty merge commits, i.e. those that themselves do not introduce any any other change than what its parents introduce, and require all other commits to be properly validated, then we can safely validate the whole repository?

A simple naive example of this would look something like this:
    rc=0
    tags=$(git for-each-ref --format '%(objectname)' refs/tags)
    tags_verified=$(for i in $tags; do git verify-tag --format='%(objectname)' "$i"; done)
    for i in $(git rev-list HEAD --no-merges --not $tags_verified); do
        git verify-commit "$i" || rc=1
    done
    for i in $(git rev-list HEAD --merges --not $tags_verified); do
        diff=$(git show --text --pretty=format: --diff-merges=cc "$i")
        git verify-commit "$i" || [ ! "$diff" ] || rc=1
    done
    exit $rc
Or is this a faulty strategy?
Thanks,
/Per Lundkvist
Next: Junio C Hamano
Message 1 of 7 in “Soundness of signature verification excluding unsigned empty merges”
  1. Lundkvist PerMar 21, 2023
  2. Junio C HamanoMar 21, 2023
  3. Lundkvist PerMar 22, 2023
  4. Elijah NewrenMar 22, 2023
  5. Lundkvist PerMar 22, 2023
  6. Elijah NewrenMar 23, 2023
  7. Lundkvist PerMar 23, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.