FelipeMdeO opened a new pull request, #19702:
URL: https://github.com/apache/nuttx/pull/19702

   ## Summary
   
   Restores the `esp32c3-devkit:dropbear` configuration, which was removed in
   `685ca8b175` because `netutils/dropbear` requires
   `CRYPTO_CRYPTODEV_SOFTWARE_CRYPTO` and that could not be linked together with
   the Espressif Wi-Fi stack.
   
   Two commits:
   
   1. `arch/risc-v/espressif`: bump `ESP_HAL_3RDPARTY_VERSION` from
      `b90b1837cb5ad24747deb4c895246037cc206ce5` to
      `1e9759ca6fbdd22fcadd7108aaab6f4daca1345f` (the direct child of the 
current
      pin on `release/master.c`, containing only the NuttX symbol prefix 
change).
      The new revision is the current head of `release/master.c` in
      `espressif/esp-hal-3rdparty`, the branch this pin already tracks:
   
   2. `boards/esp32c3-devkit`: restore the `dropbear` defconfig and its
      documentation section. Compared to the defconfig that was removed, it now
      enables `CRYPTO`, `CRYPTO_CRYPTODEV`, `CRYPTO_CRYPTODEV_SOFTWARE_CRYPTO`,
      `CRYPTO_SW_AES`, `CRYPTO_RANDOM_POOL`, `NETUTILS_CODECS` and 
`CODECS_BASE64`,
      which are the dependencies `netutils/dropbear` and `fsutils/passwd` grew
      after the ChaCha20-Poly1305 `/dev/crypto` and PBKDF2 password work was
      merged.
   
   The documentation section was also updated where it had gone stale: the SSH
   example now uses `-p 2222` (`CONFIG_NETUTILS_DROPBEAR_PORT`), the `useradd`
   example satisfies the PBKDF2 password complexity policy, and `scp` is
   mentioned.
   
   ## Impact
   
   * Impact on user: yes. `esp32c3-devkit:dropbear` is available again, giving 
an
     NSH session over SSH on the ESP32-C3.
   
   ## Testing
   
   Built and run on real hardware, an ESP32-C3-DevKit, against `nuttx` master
   and `nuttx-apps` master.
   
   **Build host:** Linux x86_64, `riscv-none-elf-gcc`.
   
   The link is what used to fail. Both AES implementations now coexist:
   
   **Target, after flashing:**
   
   ```
   nsh> ifconfig
   wlan0        Link encap:Ethernet HWaddr 80:65:99:2d:4e:3c at RUNNING mtu 1500
        inet addr:192.168.15.144 DRaddr:192.168.15.1 Mask:255.255.255.0
   
   nsh> ls /dev/crypto
    /dev/crypto
   
   nsh> useradd felipe Testpass123!
   nsh> cat /data/passwd
   
felipe:$pbkdf2-sha256$10000$26Dj-wFrmAj41Q03inmH_Q$f8hc6cDvKx-Y14mrliaHBHhyjC2ngd0XZkRHTl6o97Q:0:0:/
   
   nsh> ps
     TID   PID  PPID PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK        
    STACK COMMAND
       0     0     5   0 FIFO     Kthread   - Ready              
0000000000000000 0002016 Idle_Task
       1     0     5 100 RR       Kthread   - Waiting  Semaphore 
0000000000000000 0001968 lpwork 0x3fc8fb28 0x3fc8fb78
       3     0     5 253 RR       Kthread   - Waiting  MQ empty  
0000000000000000 0006608 wifi
       4     0     5 252 RR       Kthread   - Waiting  Semaphore 
0000000000000000 0004008 esp_timer 0x3fcac358
       5     5     0 100 RR       Task      - Running            
0000000000000000 0008128 nsh_main
       6     0     5 100 RR       Kthread   - Waiting  Semaphore 
0000000000000000 0001960 netdev-wlan0 0x3fcac2d0 0
       7     7     5 100 RR       Task      - Waiting  Semaphore 
0000000000000000 0065472 dropbear
   ```
   
   **Host, connecting over SSH:**
   
   ```
   $ ssh -p 2222 -c [email protected] [email protected]
   The authenticity of host '[192.168.15.144]:2222 ([192.168.15.144]:2222)' 
can't be established.
   ECDSA key fingerprint is SHA256:sDI8FANa16JUQXWXgj4KA9vx7XFmK5jkJDl0q5V6uA0.
   This key is not known by any other names.
   Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
   Warning: Permanently added '[192.168.15.144]:2222' (ECDSA) to the list of 
known hosts.
   [email protected]'s password:
   nsh> ls
   /:
    data/
    dev/
    proc/
    var/
   nsh> help
   help usage:  help [-v] [<cmd>]
   
       .            cd           expr         mkdir        rm           truncate
       [            cp           false        mkfifo       rmdir        uname
       ?            cmp          fdinfo       mkrd         set          umount
       alias        dirname      free         mount        kill         unset
       unalias      date         help         mv           pkill        uptime
       arp          df           hexdump      nslookup     sleep        useradd
       base64dec    dmesg        ifconfig     passwd       usleep       userdel
       base64enc    echo         ifdown       pidof        source       watch
       basename     env          ifup         printf       test         xd
       break        exec         ls           ps           time         wait
       cat          exit         du           pwd          true
   
   Builtin Apps:
       dd           getprime     ostest       renew        wapi
       dropbear     iperf        ping         scp
       dumpstack    nsh          rand         sh
   nsh> exit
   Connection to 192.168.15.144 closed.
   ```
   
   **Board-side log of the same session:**
   
   ```
   [7] Jan 01 00:00:48 connection from 192.168.15.8:48670
   [7] Jan 01 00:01:04 Password auth succeeded for 'felipe' from 
192.168.15.8:48670
   [7] Jan 01 00:01:04 NSH PTY session started
   [7] Jan 01 00:01:56 Exit (felipe) from <192.168.15.8:48670>: Disconnect 
received
   ```
   
   The negotiated session cipher exercises the `/dev/crypto` ChaCha20-Poly1305
   adapter, and the key exchange exercises the SHA-256/HMAC adapters:
   
   ```
   $ ssh -p 2222 -v -c [email protected] [email protected]
   debug1: Remote protocol version 2.0, remote software version dropbear_2026.91
   debug1: kex: algorithm: curve25519-sha256
   debug1: kex: host key algorithm: ecdsa-sha2-nistp256
   debug1: kex: server->client cipher: [email protected] MAC: 
<implicit> compression: none
   debug1: kex: client->server cipher: [email protected] MAC: 
<implicit> compression: none
   debug1: Server host key: ecdsa-sha2-nistp256 
SHA256:sDI8FANa16JUQXWXgj4KA9vx7XFmK5jkJDl0q5V6uA0
   debug1: SSH2_MSG_NEWKEYS sent
   debug1: SSH2_MSG_NEWKEYS received
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to