From d93a16ba6c6b3d85781b2022b6248572b7a72735 Mon Sep 17 00:00:00 2001 From: brainstorm Date: Thu, 2 Apr 2026 15:18:19 +0200 Subject: [PATCH 1/3] Report hostkey fingerprint on boot --- src/espressif/net.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/espressif/net.rs b/src/espressif/net.rs index 5ee0f82..2b35f69 100644 --- a/src/espressif/net.rs +++ b/src/espressif/net.rs @@ -92,6 +92,8 @@ pub async fn if_up( mac[0], mac[1], mac[2], mac[3], mac[4], mac[5] ); Efuse::set_mac_address(mac).map_err(|_| sunset::error::BadUsage.build())?; + + print_hostkey_fingerprint(&guard.hostkey); } let ssid_name = wifi_ssid(config).await; @@ -197,6 +199,21 @@ pub async fn wifi_password(config: &'static SunsetMutex) -> Stri } } +fn print_hostkey_fingerprint(hostkey: &sunset::SignKey) { + match hostkey { + sunset::SignKey::Ed25519(_) => { + let pubkey = hostkey.pubkey(); + match pubkey.fingerprint(ssh_key::HashAlg::Sha256) { + Ok(fp) => info!("SSH hostkey fingerprint: {}", fp), + Err(e) => warn!("Failed to compute fingerprint: {:?}", e), + } + } + _ => { + warn!("Unsupported key type for fingerprint"); + } + } +} + /// Manages the WiFi access point lifecycle. /// Starts the AP with the configured SSID and password from the config. /// Handles reconnection if the AP stops. From 9f8b469c88efc7eb22158d45498ba8a3efc548aa Mon Sep 17 00:00:00 2001 From: Julio Beltran Ortega <48457722+jubeormk1@users.noreply.github.com> Date: Sat, 4 Apr 2026 15:00:01 +1100 Subject: [PATCH 2/3] Update print out description on serial console This includes the current printout as seen on a ESP32C6 target --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bdd7c9a..d7e27ca 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,9 @@ cargo run-esp32c6 ``` (...) INFO - WIFI PSK: -INFO - Connect to the AP `ssh-stamp` as a DHCP client with IP: 192.168.4.1 +INFO - WIFI MAC: +INFO - SSH hostkey fingerprint: +INFO - Connect to the AP `` as a DHCP client with IP: 192.168.4.1 ``` 2. Connect a laptop/phone to the `ssh-stamp` AP using the printed PSK, then SSH into the device at `root@192.168.4.1`. From 769669e1fa7b257349c710e6826f15a0de2e9d60 Mon Sep 17 00:00:00 2001 From: Julio Beltran Ortega <48457722+jubeormk1@users.noreply.github.com> Date: Sat, 4 Apr 2026 15:00:25 +1100 Subject: [PATCH 3/3] Fix SSH hostkey fingerprint formatting in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d7e27ca..dfde1d6 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ cargo run-esp32c6 (...) INFO - WIFI PSK: INFO - WIFI MAC: -INFO - SSH hostkey fingerprint: +INFO - SSH hostkey fingerprint: INFO - Connect to the AP `` as a DHCP client with IP: 192.168.4.1 ```