diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-08 18:06:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-08 18:06:04 +0300 |
commit | a712542edb9d52105409462de3e56d2a6d6f6c7a (patch) | |
tree | e53841fbb37b494279c544b54719e45a8990d8a4 /app/validators/named_ecdsa_key_validator.rb | |
parent | 9865665cb15a1f63e6c4d0623d33b8ef11810f8d (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/validators/named_ecdsa_key_validator.rb')
-rw-r--r-- | app/validators/named_ecdsa_key_validator.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/app/validators/named_ecdsa_key_validator.rb b/app/validators/named_ecdsa_key_validator.rb index 42ee02b6ad4..9053f375100 100644 --- a/app/validators/named_ecdsa_key_validator.rb +++ b/app/validators/named_ecdsa_key_validator.rb @@ -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 == UNNAMED_CURVE + pkey.group.asn1_flag != OpenSSL::PKey::EC::NAMED_CURVE rescue OpenSSL::PKey::PKeyError false end |