Unable to use ED25519 hostkey
Hello,
I am trying to set an ED25519 hostkey like this:
ret = ssh_bind_options_set(sbind, SSH_BIND_OPTIONS_HOSTKEY, privkey_path);, where privkey_path is a path to a file that contains an ED25519 private key I generated and is of this form:
-----BEGIN PRIVATE KEY-----
key data
-----END PRIVATE KEY-----
Now, when I call the function ssh_handle_key_exchange, I get the following error message: ssh_get_key_params: Out of memory.
I tried to look a little bit into this and the problem might be that:
-
ssh_pki_export_privkey_to_pubkeygets called inssh_get_key_paramsand thenpki_key_dupis called, - in this function
pki_ed25519_key_dupis called, - unlike RSA or EC there is no
demoteparameter, so if the original key has no public key nothing happens because ofif (key->ed25519_pubkey != NULL), - I assume that when
ssh_pki_export_pubkey_blobis later called inssh_get_key_paramsit fails, because there is no public key.
Is this intended or am I doing something wrong?