netutils/dropbear: back chacha20-poly1305 with NuttX /dev/crypto#3636
Open
FelipeMdeO wants to merge 1 commit into
Open
netutils/dropbear: back chacha20-poly1305 with NuttX /dev/crypto#3636FelipeMdeO wants to merge 1 commit into
FelipeMdeO wants to merge 1 commit into
Conversation
401b7d1 to
5c955b4
Compare
Contributor
Author
|
Hello all, I need help to solve this issue, the pipeline issue is related esp32 build issue: multiple definition of I already opened PR in the esp32 3rd party to solve this issue. Now I am Waiting for them. Please, take a look in PR below: |
b31145a to
23a823c
Compare
Replace the bundled libtomcrypt chacha20-poly1305 implementation with an adapter that drives the NuttX crypto device: the SSH construction maps onto CRYPTO_CHACHA20_DJB (the original 64-bit counter/nonce ChaCha20 parameterization used by chacha20-poly1305@openssh.com) for the packet length and payload streams, and onto CRYPTO_POLY1305 for the authentication tag (plain MACs are driven in two steps through /dev/crypto: COP_FLAG_UPDATE feeds the data, a final call retrieves the tag). The NuttX crypto backend is a hard requirement of the port: NETUTILS_DROPBEAR selects CRYPTO_CRYPTODEV and its software backend, and the bundled chachapoly.c is unconditionally dropped from the build. Signed-off-by: Felipe Moura <moura.fmo@gmail.com>
23a823c to
aabd5db
Compare
Contributor
Author
|
Hello, I am changing the approach to solve aes functions collisions: apache/nuttx#19428 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR replaces Dropbear's bundled libtomcrypt chacha20-poly1305 implementation with an adapter that drives the NuttX crypto device (
/dev/crypto), so thechacha20-poly1305@openssh.comcipher runs on the kernel crypto framework (which may be hardware accelerated) and the bundled implementation is dropped from the build.The NuttX crypto backend is a hard requirement of the port:
NETUTILS_DROPBEARnow selectsCRYPTO_CRYPTODEV,CRYPTO_CRYPTODEV_SOFTWARE_CRYPTOandCRYPTO_SW_AES(and depends onALLOW_BSD_COMPONENTS, since the kernel crypto framework is BSD licensed).The bundled
src/chachapoly.cis unconditionally removed from the build anda small patch (
0005) switches the cipher state to plain key storage. Thekernel crypto backend also exports
ecc_make_key, which collides withlibtomcrypt's unused plain wrapper at link time; the wrapper is renamed via
a compile definition.
Uses
CRYPTO_CHACHA20_DJBintroduced by apache/nuttx#19403 (already merged).Impact
NETUTILS_DROPBEARnow requires the kernel cryptodevice (selected automatically); the cipher implementation moves to the
kernel, reducing application code size. On-wire behavior is unchanged.
adjustments and a new source patch; no changes to other Dropbear
functionality.
Testing
Host: Ubuntu 24.04 (aarch64), GCC 13.3.0
Target: NuttX simulator,
sim:dropbearconfiguration (apache/nuttx#19405),built against current nuttx and nuttx-apps masters (which already include
apache/nuttx#19403 and #3631).
(The
session wait failedline is pre-existing port behavior on this simconfiguration —
waitpid()returns ECHILD withoutSCHED_CHILD_STATUS—and is unrelated to this change; the remote command output is delivered
normally.)
Host side, with a real OpenSSH client forcing the cipher: