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
fc34335a
Commit
fc34335a
authored
Oct 02, 2019
by
Heinrich Lee Yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change validator to check the asn1 flag instead
Fixes the validation with OpenSSL 1.1
parent
4055c2fe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
app/validators/named_ecdsa_key_validator.rb
app/validators/named_ecdsa_key_validator.rb
+1
-3
spec/models/pages_domain_spec.rb
spec/models/pages_domain_spec.rb
+1
-1
spec/validators/named_ecdsa_key_validator_spec.rb
spec/validators/named_ecdsa_key_validator_spec.rb
+1
-1
No files found.
app/validators/named_ecdsa_key_validator.rb
View file @
fc34335a
...
...
@@ -19,15 +19,13 @@ class NamedEcdsaKeyValidator < ActiveModel::EachValidator
private
UNNAMED_CURVE
=
"UNDEF"
def
explicit_ec?
(
value
)
return
false
unless
value
pkey
=
OpenSSL
::
PKey
.
read
(
value
)
return
false
unless
pkey
.
is_a?
(
OpenSSL
::
PKey
::
EC
)
pkey
.
group
.
curve_name
==
UN
NAMED_CURVE
pkey
.
group
.
asn1_flag
!=
OpenSSL
::
PKey
::
EC
::
NAMED_CURVE
rescue
OpenSSL
::
PKey
::
PKeyError
false
end
...
...
spec/models/pages_domain_spec.rb
View file @
fc34335a
...
...
@@ -160,7 +160,7 @@ describe PagesDomain do
end
context
'when curve is set explicitly by parameters'
do
it
'adds errors to private key'
,
:quarantine
do
it
'adds errors to private key'
do
domain
=
build
(
:pages_domain
,
:explicit_ecdsa
)
expect
(
domain
).
to
be_invalid
...
...
spec/validators/named_ecdsa_key_validator_spec.rb
View file @
fc34335a
...
...
@@ -43,7 +43,7 @@ describe NamedEcdsaKeyValidator do
context
'with ECDSA certificate with explicit curve params'
do
let
(
:value
)
{
attributes_for
(
:pages_domain
,
:explicit_ecdsa
)[
:key
]
}
it
'adds errors'
,
:quarantine
do
it
'adds errors'
do
expect
(
value
).
to
be_present
subject
...
...
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