Commit 17a4f11e9fa8f6dd68e5dd19cf4b31ff9d7a2dce
Exists in
master
and in
4 other branches
Merge pull request #4528 from akiva/master
Allow SSH keys to be of type ecdsa rather than only rsa and dsa (which are slower, older, and weaker)
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/key.rb
@@ -22,7 +22,7 @@ class Key < ActiveRecord::Base | @@ -22,7 +22,7 @@ class Key < ActiveRecord::Base | ||
22 | before_validation :strip_white_space | 22 | before_validation :strip_white_space |
23 | 23 | ||
24 | validates :title, presence: true, length: { within: 0..255 } | 24 | validates :title, presence: true, length: { within: 0..255 } |
25 | - validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\Assh-.*\Z/ }, uniqueness: true | 25 | + validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\A(ssh|ecdsa)-.*\Z/ }, uniqueness: true |
26 | validate :fingerprintable_key | 26 | validate :fingerprintable_key |
27 | 27 | ||
28 | delegate :name, :email, to: :user, prefix: true | 28 | delegate :name, :email, to: :user, prefix: true |