aboutsummaryrefslogtreecommitdiff
path: root/spec/unit
diff options
context:
space:
mode:
authorTim Meusel <tim@bastelfreak.de>2020-08-06 21:31:27 +0200
committerTim Meusel <tim@bastelfreak.de>2020-09-06 17:27:48 +0200
commiteef4923bebf6ea2c2dc9e37526b95782cb63089c (patch)
tree6f05ecae25bbd38a72388260272e068cd89c69a2 /spec/unit
parent1743b72e06d33e85b8eec11582f4b13fb59bfa3c (diff)
downloadpuppet-sshkeys_core-eef4923bebf6ea2c2dc9e37526b95782cb63089c.tar.gz
puppet-sshkeys_core-eef4923bebf6ea2c2dc9e37526b95782cb63089c.tar.bz2
(MODULES-10765) Implement ecdsa-sha2-nistp256-cert-v01@openssh.com support
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/type/ssh_authorized_key_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/unit/type/ssh_authorized_key_spec.rb b/spec/unit/type/ssh_authorized_key_spec.rb
index 90c1dc3..6d1d391 100644
--- a/spec/unit/type/ssh_authorized_key_spec.rb
+++ b/spec/unit/type/ssh_authorized_key_spec.rb
@@ -90,7 +90,8 @@ describe Puppet::Type.type(:ssh_authorized_key), unless: Puppet.features.microso
:'ed25519-sk', :'sk-ssh-ed25519@openssh.com',
:'ssh-rsa-cert-v01@openssh.com',
:'ssh-ed25519-cert-v01@openssh.com',
- :'ssh-dss-cert-v01@openssh.com'
+ :'ssh-dss-cert-v01@openssh.com',
+ :'ecdsa-sha2-nistp256-cert-v01@openssh.com'
].each do |keytype|
it "supports #{keytype}" do
described_class.new(name: 'whev', type: keytype, user: 'nobody')
@@ -159,6 +160,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-nistp256-cert-v01@openssh.com key' do
+ expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp256-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHAyNTYtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgQUGk9Pzd+RqECXZMmgj8bFEumUGfZPEhJhyUusF7hvwAAAAIbmlzdHAyNTYAAABBBBmo/Yw8pVDSObTkJxlpYL5s9tVnpj7ubeky+PKY2zJ8pRYIHS3XJ6x/NyB/iFoYlGxrn4CaMPwNvYxvSEdTj60AAAAAAAAAAAAAAAIAAAAQaG9zdC5leGFtcGxlLmNvbQAAABQAAAAQaG9zdC5leGFtcGxlLmNvbQAAAABfLFfgAAAAAGEMOkIAAAAAAAAAAAAAAAAAAABoAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBBmo/Yw8pVDSObTkJxlpYL5s9tVnpj7ubeky+PKY2zJ8pRYIHS3XJ6x/NyB/iFoYlGxrn4CaMPwNvYxvSEdTj60AAABjAAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAABIAAAAIGkErINcPm1MpBhKuUmdR0KAPJGZCSeGT9E6FafcVhlFAAAAIERD5WsflI5QdJETz3n64tIDcdPbUF0GQW8iP8EV+Nf5') }.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