stalwartlabs / mail-auth

DKIM, ARC, SPF and DMARC library for Rust
https://docs.rs/mail-auth/
Apache License 2.0
82 stars 13 forks source link

Add opt-in support for *ring*-based cryptography #7

Closed djc closed 1 year ago

djc commented 1 year ago

I ran out of time for today to fix up the tests, but would be great if you have any early feedback.

Fixes #1.

mdecimus commented 1 year ago

I took a quick look and overall it looks fine, once the tests are passing let me know and I'll merge it.

The reason I went with RustCrypto is because ring fails to compile on some targets. When I reported the issue to ring's maintainer it seemed that it was not a priority for him at that time. In any case, having support for both ring and RustCrypto would be great.

djc commented 1 year ago

Out of curiosity, which of the targets not supported by ring are of interest to you?

mdecimus commented 1 year ago

Version 0.16 was failing to compile on aarch64-pc-windows-msvc. At some point a fix was proposed but I just checked and there are still a bunch of issues open related to ARM targets on the ring repo.

mdecimus commented 1 year ago

Hi @djc Just a quick update, I improved the API a bit and now there is a DkimSigner and ArcSealer that implement states. This replaces the weirdSignature::sign(self) -> Result<Self> method which returned an error when no domain/selector was specified.

djc commented 1 year ago

Nice, tomorrow is my first day back at work after the holiday so I'll be picking this up again in the next few days.

djc commented 1 year ago

I've removed some of the later commits from this PR. For now it would be nice to merge all the refactoring to prevent it from bitrotting again.

mdecimus commented 1 year ago

Thank you!