----- Original Message -----
> From: "Bruno Buzzi Brassesco" <bruno.brase...@gmail.com>
> To: libssh@libssh.org
> Sent: Monday, July 27, 2020 3:10:00 PM
> Subject: Invalid pubkey Error
>
> Hi,
Hello,
>
> Can anyone point out some causes for a "Invalid pubkey" error message ?
>
> In the code is the following line:
> if (pubkey == NULL || !ssh_key_is_public(pubkey)) {
> ssh_set_error(session, SSH_FATAL, "Invalid pubkey");
> return SSH_AUTH_ERROR;
> }
>
> What does valid mean ?
> 1) The key is not a valid key
> ) The key is ok but is not in the list of accepted keys of remote server
In that code snippet, either you pubkey is a NULL pointer or the key is not a
public key. It has nothing to do with the list of accepted keys.
I recommend checking the code you used to get the "pubkey": either it failed or
you are dealing with a private key.
Regards,
Anderson