Skip to content

SSH type ed25519-sk not valid #505

Description

@xfors

Describe the Bug

According to sshkeys_core, ed25519-sk is a valid alias for sk-ssh-ed25519@openssh.com, but using it will result in

Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Function Call, Wrong Keyline format! Got nil after applying regex to'ed25519-sk AAAA ....

Expected Behavior

I expect to be able to use the short form ed25519-sk as a valid key type

Steps to Reproduce

Having this in Hiera
accounts::user_list:
joe:
sshkeys:
- 'ed25519-sk ... joe@corp.com'

Environment

  • Version: 8.4.0
  • Platform: Ubuntu 24.04
  • sshkeys_core Version: 2.4.0

Additional Context

Suggested patch
--- a/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb
+++ b/lib/puppet/functions/accounts_ssh_authorized_keys_line_parser.rb
@@ -16,7 +16,7 @@ Puppet::Functions.create_function(:accounts_ssh_authorized_keys_line_parser) do
end

def accounts_ssh_authorized_keys_line_parser_string(str)

  • matched = str.match(%r{((sk-ssh-ed25519|sk-ecdsa-|ssh-|ecdsa-)[^\s]+)\s+([^\s]+)\s+(.*)$})
  • matched = str.match(%r{((sk-ssh-ed25519|sk-ecdsa-|ssh-|ecdsa-|ed25519-)[^\s]+)\s+([^\s]+)\s+(.*)$})

    raise ArgumentError, "Wrong Keyline format! Got nil after applying regex to'#{str}'" unless matched
    unless matched.length == 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions