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/sshkey.rb     |    8 ++++----
 spec/unit/type/sshkey_spec.rb |   20 +++++++++-----------
 2 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/lib/puppet/type/sshkey.rb b/lib/puppet/type/sshkey.rb
index 59a1a12..41b3dde 100755
--- a/lib/puppet/type/sshkey.rb
+++ b/lib/puppet/type/sshkey.rb
@@ -9,10 +9,10 @@ module Puppet
     newproperty(:type) do
       desc "The encryption type used.  Probably ssh-dss or ssh-rsa."
 
-      newvalue("ssh-dss")
-      newvalue("ssh-rsa")
-      aliasvalue(:dsa, "ssh-dss")
-      aliasvalue(:rsa, "ssh-rsa")
+      newvalues :'ssh-dss', :'ssh-rsa', :'ecdsa-sha2-nistp256', 
:'ecdsa-sha2-nistp384', :'ecdsa-sha2-nistp521'
+
+      aliasvalue(:dsa, :'ssh-dss')
+      aliasvalue(:rsa, :'ssh-rsa')
     end
 
     newproperty(:key) do
diff --git a/spec/unit/type/sshkey_spec.rb b/spec/unit/type/sshkey_spec.rb
index ba34069..ae49678 100755
--- a/spec/unit/type/sshkey_spec.rb
+++ b/spec/unit/type/sshkey_spec.rb
@@ -28,24 +28,22 @@ describe sshkey do
 
   describe "when validating values" do
 
-    it "should support ssh-dss as a type value" do
-      proc { @class.new(:name => "foo", :type => "ssh-dss") }.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} as a type value" do
+        proc { @class.new(:name => "foo", :type => keytype) }.should_not 
raise_error
+      end
     end
 
-    it "should support ssh-rsa as a type value" do
-      proc { @class.new(:name => "whev", :type => "ssh-rsa") }.should_not 
raise_error
+    it "should alias :rsa to :ssh-rsa" do
+      key = @class.new(:name => "foo", :type => :rsa)
+      key.should(:type).should == :'ssh-rsa'
     end
 
-    it "should alias :dsa to ssh-dss as a value for type" do
-      key = @class.new(:name => "whev", :type => :dsa)
+    it "should alias :dsa to :ssh-dss" do
+      key = @class.new(:name => "foo", :type => :dsa)
       key.should(:type).should == :'ssh-dss'
     end
 
-    it "should alias :rsa to ssh-rsa as a value for type" do
-      key = @class.new(:name => "whev", :type => :rsa)
-      key.should(:type).should == :'ssh-rsa'
-    end
-
     it "should not support values other than ssh-dss, ssh-rsa, dsa, rsa for 
type" do
       proc { @class.new(:name => "whev", :type => :'ssh-dsa') }.should 
raise_error(Puppet::Error)
     end
-- 
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