wolfssh icon indicating copy to clipboard operation
wolfssh copied to clipboard

Runtime configurability of key signature algorithms for KEX

Open falemagn opened this issue 1 year ago • 6 comments

The available algorithms can currently be configured only at compile time. It would be useful to have the possibility to compile them in, but enable/disable them at runtime in the context of KEX.

So that:

  1. The server_host_key_algorithms namelist in SSH_MSG_KEXINIT includes the algorithm
  2. If the algorithm is agreed upon by the client and server, then it's used to sign the key

The specific use case that prompted this feature request is the usage of ssh-rsa host keys: we'd like to be able to configure at runtime whether or not they can be signed with ssh-rsa or ssh-sha2-256 (and in the future with ssh-sha2-512).

falemagn avatar Feb 22 '24 09:02 falemagn

See ZD 17568

dgarske avatar Feb 22 '24 16:02 dgarske

Cannot access that

falemagn avatar Feb 22 '24 16:02 falemagn

I was just adding that information for the assignment to @ejohnstown. @falemagn that's the ticket you filed in our Zendesk.

dgarske avatar Feb 22 '24 16:02 dgarske

There must be a misunderstanding. As said, I've got no access to that ticket, because I have personally not filed it. If this conversation must be moved there, I suppose you need to do something to involve me in it.

falemagn avatar Feb 22 '24 17:02 falemagn

You need to set the preprocessor define WOLFSSH_YES_SSH_RSA_SHA1. The code for ssh-rsa using SHA-1 is still available.

We disabled SHA-1 when OpenSSH announced that they were disabling it. SHA-1 is broken and provides no security. We decided to disable it as well.

ejohnstown avatar Feb 22 '24 17:02 ejohnstown

It's clear that it can be enabled at compile time - that's the premise of this very issue:

The available algorithms can currently be configured only at compile time.

What I am proposing is to be able to disable/enable at runtime the algorithms that have been compiled in, just like it happens with OpenSSH.

Btw, the release note of the version that disabled the SHA1 signature didn't mention it. Was it mentioned anywhere else?

falemagn avatar Feb 22 '24 17:02 falemagn

I'm going to close this issue since the PR adds the requested functions. I believe it achieves the desired goal.

ejohnstown avatar Mar 13 '24 22:03 ejohnstown