briansmith / ring

Safe, fast, small crypto using Rust
Other
3.77k stars 708 forks source link

Unable to build ring with rustls for esp-idf #2157

Open ealinye opened 3 weeks ago

ealinye commented 3 weeks ago

Here is the repo. The compilation target of the code is xtensa-esp32s3-espidf, The compiler is installed via espup.

When I tried to use QUIC on the esp32s3 chip, since quic mandates encryption, I had to choose an encryption provider that supports quic.

Ring is my first choice because other providers either use cmake or do not support QUIC.

If I don't enable rustls' ring features, the code compiles - I just can't write the functionality I want because of the missing CryptoProvider.

If I enable the ring feature, the code doesn't compilem because of the rng. I found that ring's support for esf-idf has not been uploaded to crates.io, and the code for ring as a CryptoProvider is hard-coded in the rustls library, so I used a patch to make rustls can use the latest version of ring.

After applying the patch and enabling the feature, the cargo check error disappeared, and everything seemed to be fine. But at this point, when I compiled the code, a compilation error that I had never seen before appeared.

error: Undefined temporary symbol .LBB113_16

error: could not compile `rustls` (lib) due to 1 previous error

It happened after I used a higher version of ring. I'm not sure if this is a problem with ring, or its upstream library, or a compiler problem.

If you need any additional information from me, I will provide it to you.