diff options
author | Kevin O'Connor <kevin.oconnor7@gmail.com> | 2017-02-14 19:01:30 -0500 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 15:40:40 +0200 |
commit | 817d9558febde484f23f623bd66d8c861ebc8236 (patch) | |
tree | 7ebb73c3a019d9999abcd92bdb560ac4caf4f223 /app/models/commit.rb | |
parent | 4eebd8e1957a3fc3a3479331fde9f34aa8afa9d5 (diff) | |
download | gitlab-ce-817d9558febde484f23f623bd66d8c861ebc8236.tar.gz |
Prototype key verification
Diffstat (limited to 'app/models/commit.rb')
-rw-r--r-- | app/models/commit.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/commit.rb b/app/models/commit.rb index 1e19f00106a..b22aaa3c461 100644 --- a/app/models/commit.rb +++ b/app/models/commit.rb @@ -234,6 +234,18 @@ class Commit @statuses[ref] = pipelines.latest_status(ref) end + def signature + return @signature if defined?(@signature) + + sig, signed = @raw.extract_signature(project.repository.raw_repository) + if sig && signed + GPGME::Crypto.new.verify(sig, signed_text: signed) do |sign| + @signature = sign + end + end + @signature ||= nil + end + def revert_branch_name "revert-#{short_id}" end |