Skip to content

Commit 53b29db

Browse files
committed
(MODULES-10765) Implement ecdsa-sha2-nistp521-cert-v01@openssh.com support
1 parent c33e9e0 commit 53b29db

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

lib/puppet/type/ssh_authorized_key.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ module Puppet
6565
newvalues :'ssh-dss', :'ssh-rsa', :'ecdsa-sha2-nistp256', :'ecdsa-sha2-nistp384', :'ecdsa-sha2-nistp521', :'ssh-ed25519',
6666
:'sk-ecdsa-sha2-nistp256@openssh.com', :'sk-ssh-ed25519@openssh.com', :'ssh-rsa-cert-v01@openssh.com',
6767
:'ssh-ed25519-cert-v01@openssh.com', :'ssh-dss-cert-v01@openssh.com', :'ecdsa-sha2-nistp256-cert-v01@openssh.com',
68-
:'ecdsa-sha2-nistp384-cert-v01@openssh.com'
68+
:'ecdsa-sha2-nistp384-cert-v01@openssh.com', :'ecdsa-sha2-nistp521-cert-v01@openssh.com'
6969

7070
aliasvalue(:dsa, :'ssh-dss')
7171
aliasvalue(:ed25519, :'ssh-ed25519')
@@ -169,7 +169,7 @@ def insync?(is)
169169
sk-ecdsa-sha2-nistp256@openssh.com|sk-ssh-ed25519@openssh.com|
170170
ssh-rsa-cert-v01@openssh.com|ssh-ed25519-cert-v01@openssh.com|
171171
ssh-dss-cert-v01@openssh.com|ecdsa-sha2-nistp256-cert-v01@openssh.com|
172-
ecdsa-sha2-nistp384-cert-v01@openssh.com)\s+([^ ]+)\s*(.*)$}x
172+
ecdsa-sha2-nistp384-cert-v01@openssh.com|ecdsa-sha2-nistp521-cert-v01@openssh.com)\s+([^ ]+)\s*(.*)$}x
173173
def self.keyline_regex
174174
REGEX
175175
end

spec/unit/type/ssh_authorized_key_spec.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
:'ssh-ed25519-cert-v01@openssh.com',
9393
:'ssh-dss-cert-v01@openssh.com',
9494
:'ecdsa-sha2-nistp256-cert-v01@openssh.com',
95-
:'ecdsa-sha2-nistp384-cert-v01@openssh.com'
95+
:'ecdsa-sha2-nistp384-cert-v01@openssh.com',
96+
:'ecdsa-sha2-nistp521-cert-v01@openssh.com'
9697
].each do |keytype|
9798
it "supports #{keytype}" do
9899
described_class.new(name: 'whev', type: keytype, user: 'nobody')
@@ -173,6 +174,12 @@
173174
end
174175
# rubocop:enable Metrics/LineLength
175176

177+
# rubocop:disable Metrics/LineLength
178+
it 'supports a valid ecdsa-sha2-nistp521-cert-v01@openssh.com key' do
179+
expect { described_class.new(name: 'bastelfreakwashere', type: :'ecdsa-sha2-nistp521-cert-v01@openssh.com', user: 'opensshrulez', key: 'AAAAKGVjZHNhLXNoYTItbmlzdHA1MjEtY2VydC12MDFAb3BlbnNzaC5jb20AAAAg2xMe+Z9AuETNwM88pTDRpEtKbGRarajtZ5UaxSmmaQoAAAAIbmlzdHA1MjEAAACFBAFGg1vGsCq5kEzivd0s/kf0x5/TDzb0DwPzGz5YRsUtDlhT7+F7r2lVRvEEXCagc/UjTisIQ0kcG4IgMoI3VsaFEAHrBgF4whI/bhh6i+WzIHnT3NWkjqhdX+kLBXtlm+uFXyslmFlda4gGmjGeHvsDHgC2rN7cSuGh//3DBXtelkB+uQAAAAAAAAAAAAAAAgAAABBob3N0LmV4YW1wbGUuY29tAAAAFAAAABBob3N0LmV4YW1wbGUuY29tAAAAAF8sW9wAAAAAYQw+QgAAAAAAAAAAAAAAAAAAAKwAAAATZWNkc2Etc2hhMi1uaXN0cDUyMQAAAAhuaXN0cDUyMQAAAIUEAUaDW8awKrmQTOK93Sz+R/THn9MPNvQPA/MbPlhGxS0OWFPv4XuvaVVG8QRcJqBz9SNOKwhDSRwbgiAygjdWxoUQAesGAXjCEj9uGHqL5bMgedPc1aSOqF1f6QsFe2Wb64VfKyWYWV1riAaaMZ4e+wMeALas3txK4aH//cMFe16WQH65AAAApwAAABNlY2RzYS1zaGEyLW5pc3RwNTIxAAAAjAAAAEIA92a8QL5J/EMxRaKh9fSysTaEyyN/3KesBC8tI1rwytKILtfrcAIGxXtDQF6eZ72BWUvu6aqHIM6pmIHlnpzsROgAAABCAJHPzoeANenL8ZdlEf0jz8aEiGlGt02Z+vzsajQakKclFL4P8Nm5fojR2Mo2C45CQfO+kfkRQM1UUfDrVZcPzN0S') }.not_to raise_error # rubocop:disable Metrics/LineLength
180+
end
181+
# rubocop:enable Metrics/LineLength
182+
176183
it "doesn't support whitespaces" do
177184
expect { described_class.new(name: 'whev', type: :rsa, user: 'nobody', key: 'AAA FA==') }.to raise_error(Puppet::Error, %r{Key must not contain whitespace})
178185
end

0 commit comments

Comments
 (0)