Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

Add GPG payload to commit information if present #36

Merged
merged 2 commits into from
Mar 13, 2017

Conversation

sapk
Copy link
Member

@sapk sapk commented Mar 8, 2017

based on : https://github.com/git/git/blob/3bc53220cb2dcf709f7a027a3f526befd021d858/commit.c#L1128
I have to do further testing to determine if the struct CommitGPGSignature could not be replace by a simple string representing directly CommitGPGSignature.Signature. Since payload can maybe re-created from the rest of data in Commit struct.

If we don't care about duplicate of data at this stage it will simplify treatment after since payload and signature (+ public key from keystore in gitea) is only needed to verify the signed commit. https://github.com/git/git/blob/2cc2e70264e0fcba04f9ef791d144bbc8b501206/gpg-interface.c#L204

@sapk sapk mentioned this pull request Mar 9, 2017
6 tasks
@sapk sapk changed the title [WIP] Add GPG payload to commit information if present Add GPG payload to commit information if present Mar 11, 2017
@sapk
Copy link
Member Author

sapk commented Mar 11, 2017

This one is finish and is enough to validate a commit. For the payload (commit messages except signature), i think that it's more simple and secure to keep the full data and not try to reconstruct it after but i am open to suggestion ^^.

@lunny
Copy link
Member

lunny commented Mar 11, 2017

LGTM

@tboerger
Copy link
Member

LGTM

@lunny lunny merged commit 3374688 into go-gitea:master Mar 13, 2017
// CommitGPGSignature represents a git commit signature part.
type CommitGPGSignature struct {
Signature string
Payload string //TODO check if can be reconstruct from the rest of commit information to not have duplicate data
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sapk Easiest way would be to have a cache-layer for GPG-sigs somewhere, just not just where 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants