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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
63eb4156
Commit
63eb4156
authored
Feb 16, 2016
by
Kamil Trzcinski
Committed by
James Edwards-Jones
Jan 31, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix certificate validators
parent
8f09ec28
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
app/validators/certificate_key_validator.rb
app/validators/certificate_key_validator.rb
+1
-1
app/validators/certificate_validator.rb
app/validators/certificate_validator.rb
+3
-3
No files found.
app/validators/certificate_key_validator.rb
View file @
63eb4156
...
...
@@ -16,7 +16,7 @@ class CertificateKeyValidator < ActiveModel::EachValidator
private
def
valid_private_key_pem?
(
value
)
return
unless
value
return
false
unless
value
pkey
=
OpenSSL
::
PKey
::
RSA
.
new
(
value
)
pkey
.
private?
rescue
OpenSSL
::
PKey
::
PKeyError
...
...
app/validators/certificate_validator.rb
View file @
63eb4156
...
...
@@ -16,9 +16,9 @@ class CertificateValidator < ActiveModel::EachValidator
private
def
valid_certificate_pem?
(
value
)
return
unless
value
OpenSSL
::
X509
::
Certificate
.
new
(
value
)
return
false
unless
value
OpenSSL
::
X509
::
Certificate
.
new
(
value
)
.
present?
rescue
OpenSSL
::
X509
::
CertificateError
nil
false
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