[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Invalid pubkey Error
  [Thread Prev] | [Thread Next]
 
 
- Subject: Re: Invalid pubkey Error
- From: Anderson Sasaki <ansasaki@xxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 27 Jul 2020 11:14:15 -0400 (EDT)
- To: libssh@xxxxxxxxxx
----- Original Message -----
> From: "Bruno Buzzi Brassesco" <bruno.brasesco@xxxxxxxxx>
> To: libssh@xxxxxxxxxx
> 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
| Invalid pubkey Error | Bruno Buzzi Brassesco <bruno.brasesco@xxxxxxxxx> | 

