mkrueger / icy_tools

A colletion of ansi/bbs related applications
Apache License 2.0
46 stars 2 forks source link

Source Compilation Failure Linux #35

Open hungry-bogart opened 1 week ago

hungry-bogart commented 1 week ago

Issue: Source Compilation Fails Due to Public Key is Private (ERROR E0603)

System Info

OS = Arch Linux CPU = Intel 64Bit

Error: Struct PublicKey is private

When trying to compile the code, I'm getting an error message indicating that the PublicKey struct is private. The error message is:

error[E0603]: struct `PublicKey` is private
 --> /home/hungry/.cargo/git/checkouts/icy_board-9187dd4bd6875bb9/e854856/crates/icy_net/src/connection/ssh.rs:120:67
    |
120 |     async fn check_server_key(&mut self, server_public_key: &key::PublicKey) -> Result<bool, Self::Error> {
    |                                                                   ^^^^^^^^^ private struct
    |
note: the struct `PublicKey` is defined here
   --> /home/hungry/.cargo/git/checkouts/russh-77b9ebedfd3af00b/7dee935/russh-keys/src/key.rs:17:47
    |
17  | use ssh_key::{Algorithm, EcdsaCurve, HashAlg, PublicKey};
    |                                               ^^^^^^^^^

Solution: Use correct namespace for PublicKey

The issue is caused by using the incorrect namespace for the PublicKey struct. To fix this, we need to use the correct namespace ssh_key::public instead of key.

Change the line:

async fn check_server_key(&mut self, server_public_key: &key::PublicKey) -> Result<bool, Self::Error> {

to:

async fn check_server_key(&mut self, server_public_key: &ssh_key::public::PublicKey) -> Result<bool, Self::Error> {

Making this change did solve the problem and compilation was a success. Hope this helps anyone compiling from source.