From c33e9e02d8374441eb9feef20613a7a9da8c62ca Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 6 Aug 2020 21:35:33 +0200 Subject: (MODULES-10765) Implement ecdsa-sha2-nistp384-cert-v01@openssh.com support --- spec/unit/type/ssh_authorized_key_spec.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'spec') diff --git a/spec/unit/type/ssh_authorized_key_spec.rb b/spec/unit/type/ssh_authorized_key_spec.rb index 6d1d391..14c65f7 100644 --- a/spec/unit/type/ssh_authorized_key_spec.rb +++ b/spec/unit/type/ssh_authorized_key_spec.rb @@ -91,7 +91,8 @@ describe Puppet::Type.type(:ssh_authorized_key), unless: Puppet.features.microso :'ssh-rsa-cert-v01@openssh.com', :'ssh-ed25519-cert-v01@openssh.com', :'ssh-dss-cert-v01@openssh.com', - :'ecdsa-sha2-nistp256-cert-v01@openssh.com' + :'ecdsa-sha2-nistp256-cert-v01@openssh.com', + :'ecdsa-sha2-nistp384-cert-v01@openssh.com' ].each do |keytype| it "supports #{keytype}" do described_class.new(name: 'whev', type: keytype, user: 'nobody') @@ -166,6 +167,12 @@ describe Puppet::Type.type(:ssh_authorized_key), unless: Puppet.features.microso end # rubocop:enable Metrics/LineLength + # rubocop:disable Metrics/LineLength + it 'supports a valid ecdsa-sha2-nistp384-cert-v01@openssh.com key' do + expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp384-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHAzODQtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgh+/K6gv7WlwX9qVlKLH8Vurzo5xfc8/glVcT7auQOhIAAAAIbmlzdHAzODQAAABhBDouPHnR+OD4jfdqMbhFXTfB8vTjpZYLQSl0HxEXRAs8AgqDEZI1lJEVwdxtJUbczyu1Wj7wM45YpSpgUQVU38rmVkpxujqhhMMmqMWf87gnjm9oVLLFvJHdauKNnXjJQQAAAAAAAAAAAAAAAgAAABBob3N0LmV4YW1wbGUuY29tAAAAFAAAABBob3N0LmV4YW1wbGUuY29tAAAAAF8sWnQAAAAAYQw85wAAAAAAAAAAAAAAAAAAAIgAAAATZWNkc2Etc2hhMi1uaXN0cDM4NAAAAAhuaXN0cDM4NAAAAGEEOi48edH44PiN92oxuEVdN8Hy9OOllgtBKXQfERdECzwCCoMRkjWUkRXB3G0lRtzPK7VaPvAzjlilKmBRBVTfyuZWSnG6OqGEwyaoxZ/zuCeOb2hUssW8kd1q4o2deMlBAAAAgwAAABNlY2RzYS1zaGEyLW5pc3RwMzg0AAAAaAAAADBJccfmOaYjNVbqkx0X7cLpl53EzTAMdv9k159mBLYaepMnLYmhKx+LvfA5bAUTar4AAAAwSO7n770NIdhhMZjGio4GKDyKq2WW6QLRXleY6QcynBaQ90rkMVnt+jeIEs30h6F8') }.not_to raise_error # rubocop:disable Metrics/LineLength + end + # rubocop:enable Metrics/LineLength + it "doesn't support whitespaces" do expect { described_class.new(name: 'whev', type: :rsa, user: 'nobody', key: 'AAA FA==') }.to raise_error(Puppet::Error, %r{Key must not contain whitespace}) end -- cgit v1.2.3