libgit2 / libgit2/rugged

Malformed signed_data from Commit#extract_signature

Open
#608 5 comments 0 reactions 1 assignee View on GitHub

@carlosmn is already working on this.

Since Jun 21, 2016.

Dominant language
C
Stars
2.3k
Forks
293
PR merge metrics
No merged PRs in 30d

Description

I've been seeing weird behavior with Commit.extract_signature where I'm getting some garbage data at the end of the signed data string.

For example:

repo = Rugged::Repository.new('/tmp/test')
commit = '7cd86ea426f277276367bd955f312fcbadd7bc5d'

# Note: I can only reproduce the error if rev_parse is called first
repo.rev_parse(commit)
p Rugged::Commit.extract_signature(repo, commit)

As a result the signed_data portion of the returned array sometimes has a \n as the last character. However, I get seemingly random data in that last byte.

I was not able to reproduce this in the tests, however, I can reliably reproduce it if I create new repo locally, add a few signed commits, and then try to extract the signatures via rugged.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.