Recent versions of openssh (at least openssh 5.8) support the following
keytypes in in the authorized_keys file: ecdsa-sha2-nistp256,
ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-dss or ssh-rsa.

Add support for ecdsa-sha2-nistp256, ecdsa-sha2-nistp384 and
ecdsa-sha2-nistp521.

Signed-off-by: Stefan Schulte <[email protected]>
---
Local-branch: ticket/2.7.x/8193
 lib/puppet/type/ssh_authorized_key.rb     |    7 +++----
 spec/unit/type/ssh_authorized_key_spec.rb |   19 ++++---------------
 2 files changed, 7 insertions(+), 19 deletions(-)

diff --git a/lib/puppet/type/ssh_authorized_key.rb 
b/lib/puppet/type/ssh_authorized_key.rb
index 170dc83..80bc60e 100644
--- a/lib/puppet/type/ssh_authorized_key.rb
+++ b/lib/puppet/type/ssh_authorized_key.rb
@@ -23,11 +23,10 @@ module Puppet
     newproperty(:type) do
       desc "The encryption type used: ssh-dss or ssh-rsa."
 
-      newvalue("ssh-dss")
-      newvalue("ssh-rsa")
+      newvalues :'ssh-dss', :'ssh-rsa', :'ecdsa-sha2-nistp256', 
:'ecdsa-sha2-nistp384', :'ecdsa-sha2-nistp521'
 
-      aliasvalue(:dsa, "ssh-dss")
-      aliasvalue(:rsa, "ssh-rsa")
+      aliasvalue(:dsa, :'ssh-dss')
+      aliasvalue(:rsa, :'ssh-rsa')
     end
 
     newproperty(:key) do
diff --git a/spec/unit/type/ssh_authorized_key_spec.rb 
b/spec/unit/type/ssh_authorized_key_spec.rb
index 71b8a9a..fe66b97 100755
--- a/spec/unit/type/ssh_authorized_key_spec.rb
+++ b/spec/unit/type/ssh_authorized_key_spec.rb
@@ -70,21 +70,10 @@ describe ssh_authorized_key do
 
     describe "for type" do
 
-
-      it "should support ssh-dss" do
-        proc { @class.new(:name => "whev", :type => "ssh-dss", :user => 
"nobody") }.should_not raise_error
-      end
-
-      it "should support ssh-rsa" do
-        proc { @class.new(:name => "whev", :type => "ssh-rsa", :user => 
"nobody") }.should_not raise_error
-      end
-
-      it "should support :dsa" do
-        proc { @class.new(:name => "whev", :type => :dsa, :user => "nobody") 
}.should_not raise_error
-      end
-
-      it "should support :rsa" do
-        proc { @class.new(:name => "whev", :type => :rsa, :user => "nobody") 
}.should_not raise_error
+      [:'ssh-dss', :'ssh-rsa', :rsa, :dsa, :'ecdsa-sha2-nistp256', 
:'ecdsa-sha2-nistp384', :'ecdsa-sha2-nistp521'].each do |keytype|
+        it "should support #{keytype}" do
+          proc { @class.new(:name => "whev", :type => keytype, :user => 
"nobody") }.should_not raise_error
+        end
       end
 
       it "should alias :rsa to :ssh-rsa" do
-- 
1.7.6

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to