diff options
author | Alexis Reigel <mail@koffeinfrei.org> | 2017-02-22 17:20:42 +0100 |
---|---|---|
committer | Alexis Reigel <mail@koffeinfrei.org> | 2017-07-27 15:40:41 +0200 |
commit | e34cef0cd2fcf9a01d3f3b6dd215bbcc25d65d27 (patch) | |
tree | c9d1bbda57acec6f41b740488366654ca3892676 /app/models/gpg_key.rb | |
parent | 7b4d29f4b5b02b5aee3e3cbfc8282965a38c4622 (diff) | |
download | gitlab-ce-e34cef0cd2fcf9a01d3f3b6dd215bbcc25d65d27.tar.gz |
extract gpg functionality to lib class
Diffstat (limited to 'app/models/gpg_key.rb')
-rw-r--r-- | app/models/gpg_key.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/models/gpg_key.rb b/app/models/gpg_key.rb index b012db1428f..aa0e8883a47 100644 --- a/app/models/gpg_key.rb +++ b/app/models/gpg_key.rb @@ -33,12 +33,8 @@ class GpgKey < ActiveRecord::Base private def extract_fingerprint - import = GPGME::Key.import(key) - - return if import.considered == 0 - # we can assume that the result only contains one item as the validation # only allows one key - self.fingerprint = import.imports.first.fingerprint + self.fingerprint = Gitlab::Gpg.fingerprints_from_key(key).first end end |