Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a5238840
Commit
a5238840
authored
Mar 29, 2016
by
Pablo Carranza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract insecure key fingerprint to separate file
parent
4dce5fa2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
24 deletions
+23
-24
lib/api/internal.rb
lib/api/internal.rb
+0
-2
lib/gitlab/insecure_key_fingerprint.rb
lib/gitlab/insecure_key_fingerprint.rb
+23
-0
lib/gitlab/key_fingerprint.rb
lib/gitlab/key_fingerprint.rb
+0
-22
No files found.
lib/api/internal.rb
View file @
a5238840
require
"gitlab/key_fingerprint"
module
API
module
API
# Internal access API
# Internal access API
class
Internal
<
Grape
::
API
class
Internal
<
Grape
::
API
...
...
lib/gitlab/insecure_key_fingerprint.rb
0 → 100644
View file @
a5238840
module
Gitlab
#
# Calculates the fingerprint of a given key without using
# openssh key validations. For this reason, only use
# for calculating the fingerprint to find the key with it.
#
# DO NOT use it for checking the validity of a ssh key.
#
class
InsecureKeyFingerprint
attr_accessor
:key
#
# Gets the base64 encoded string representing a rsa or dsa key
#
def
initialize
(
key_base64
)
@key
=
key_base64
end
def
fingerprint
OpenSSL
::
Digest
::
MD5
.
hexdigest
(
Base64
.
decode64
(
@key
)).
scan
(
/../
).
join
(
':'
)
end
end
end
lib/gitlab/key_fingerprint.rb
View file @
a5238840
...
@@ -52,26 +52,4 @@ module Gitlab
...
@@ -52,26 +52,4 @@ module Gitlab
version_info
>=
required_version_info
version_info
>=
required_version_info
end
end
end
end
#
# Calculates the fingerprint of a given key without using
# openssh key validations. For this reason, only use
# for calculating the fingerprint to find the key with it.
#
# DO NOT use it for checking the validity of a ssh key.
#
class
InsecureKeyFingerprint
attr_accessor
:key
#
# Gets the base64 encoded string representing a rsa or dsa key
#
def
initialize
(
key_base64
)
@key
=
key_base64
end
def
fingerprint
OpenSSL
::
Digest
::
MD5
.
hexdigest
(
Base64
.
decode64
(
@key
)).
scan
(
/../
).
join
(
':'
)
end
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment