Skip to content

Commit

Permalink
Deprecate sodiumoxide resolver
Browse files Browse the repository at this point in the history
It's no longer maintained, and we shouldn't support any backends that
won't offer security patches.
  • Loading branch information
mcginty committed Jan 26, 2024
1 parent 308a24d commit faf0560
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 28 deletions.
38 changes: 11 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,35 +63,19 @@ as well as a `RingAcceleratedResolver` available to be used with
If you enable the `ring-accelerated` feature, Snow will default to choosing `ring`'s
crypto implementations when available.

#### libsodium

[libsodium](https://libsodium.org/) is a fork of NaCl focused on improved usability
and regular maintenance.

##### Compatibility caveat

libsodium [blacklists a set of low-order points](https://github.com/jedisct1/libsodium/blob/master/src/libsodium/crypto_scalarmult/curve25519/ref10/x25519_ref10.c#L20)
that it deems unsafe because they would output an all-zeroes result.

Noise [does not validate Curve25519 points](https://moderncrypto.org/mail-archive/noise/2017/000971.html),
so if another Noise implementation provides an all-zero (or another low-order) public
key for some reason (be it testing, or a real life foot-shot), if you use the libsodium
backend of snow, it will error in a way that's not fully compatible with the
specification.

### Resolver primitives supported

| | default | ring | libsodium |
| ---------: | :-----: | :--: | :-------: |
| CSPRNG ||||
| 25519 ||||
| 448 | | | |
| AESGCM ||| |
| ChaChaPoly ||||
| SHA256 ||||
| SHA512 ||| |
| BLAKE2s || | |
| BLAKE2b || | |
| | default | ring |
| ---------: | :-----: | :--: |
| CSPRNG |||
| 25519 |||
| 448 | | |
| AESGCM |||
| ChaChaPoly |||
| SHA256 |||
| SHA512 |||
| BLAKE2s || |
| BLAKE2b || |

## License

Expand Down
7 changes: 7 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
use rustc_version::{version_meta, Channel};
use std::env;

fn main() {
if env::var("CARGO_FEATURE_SODIUMOXIDE").is_ok() {
println!(
"cargo:warning=Use of the sodiumoxide backend is deprecated, as it is no longer \
maintained; please consider switching to another resolver."
)
}
if version_meta().unwrap().channel == Channel::Nightly {
println!("cargo:rustc-cfg=feature=\"nightly\"");
}
Expand Down
4 changes: 3 additions & 1 deletion src/resolvers/libsodium.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
extern crate sodiumoxide;
//! # NOTE
//! This backend is deprecated, as sodiumoxide is unmaintained. This will be removed in a
//! following version of snow.

use byteorder::{ByteOrder, LittleEndian};

Expand Down

0 comments on commit faf0560

Please sign in to comment.