From: Tom Clegg Date: Fri, 17 Jan 2014 21:02:35 +0000 (-0800) Subject: Accept DSA public keys ("ssh-dss"), not just RSA. X-Git-Tag: 1.1.0~2722^2~69^2^2^2 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/e1ed5c20e3edc31c7aefe3257679b0db6f3c3316 Accept DSA public keys ("ssh-dss"), not just RSA. refs #1880 --- diff --git a/services/api/app/models/authorized_key.rb b/services/api/app/models/authorized_key.rb index 14db0b1126..a6bc06593a 100644 --- a/services/api/app/models/authorized_key.rb +++ b/services/api/app/models/authorized_key.rb @@ -33,10 +33,10 @@ class AuthorizedKey < ArvadosModel def public_key_must_be_unique if self.public_key - key = /ssh-rsa [A-Za-z0-9+\/]+/.match(self.public_key) + key = /^ssh-(rsa|dss) [A-Za-z0-9+\/=\+]+\b/.match(self.public_key) if not key - errors.add(:public_key, "does not appear to be a valid ssh-rsa key") + errors.add(:public_key, "does not appear to be a valid ssh-rsa or dsa public key") else # Valid if no other rows have this public key if self.class.where('public_key like ?', "%#{key[0]}%").any?