Skip to content

Commit 42718c1

Browse files
committed
fix: bump ed25519-dalek to v2.0 for RUSTSEC-2022-0093
Update ed25519-dalek dependency from v^1.0.1 to v2.0 to address the security vulnerability described in RUSTSEC-2022-0093. This update is backward-compatible as it does not introduce changes to the public API of rusty-paseto. Signed-off-by: Roland Rodriguez <[email protected]>
1 parent c76bd4f commit 42718c1

File tree

4 files changed

+1623
-1597
lines changed

4 files changed

+1623
-1597
lines changed

Cargo.toml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rusty_paseto"
3-
version = "0.5.0"
3+
version = "0.6.0"
44
edition = "2021"
55
readme = "readme.md"
66
authors = ["Roland Rodriguez <[email protected]>"]
@@ -9,11 +9,11 @@ repository = "https://github.com/rrrodzilla/rusty_paseto"
99
license = "MIT OR Apache-2.0"
1010
keywords = ["paseto", "token", "security", "api", "web"]
1111
categories = [
12-
"cryptography",
13-
"authentication",
14-
"encoding",
15-
"network-programming",
16-
"web-programming",
12+
"cryptography",
13+
"authentication",
14+
"encoding",
15+
"network-programming",
16+
"web-programming",
1717
]
1818
documentation = "https://docs.rs/rusty_paseto/latest/rusty_paseto/"
1919

@@ -29,18 +29,16 @@ v2_local = ["v2", "local", "core", "blake2", "chacha20poly1305"]
2929
v3_local = ["v3", "local", "core", "aes", "hmac", "sha2", "chacha20"]
3030
v4_local = ["v4", "local", "core", "blake2", "chacha20"]
3131
v1_public = ["v1", "public", "core"]
32-
v2_public = ["v2", "public", "core", "ed25519-dalek"]
32+
v2_public = ["v2", "public", "core", "ed25519-dalek", "ring/std"]
3333
v3_public = ["v3", "public", "core", "p384"]
34-
v4_public = ["v4", "public", "core", "ed25519-dalek"]
34+
v4_public = ["v4", "public", "core", "ed25519-dalek", "ring/std"]
3535
core = []
3636
generic = ["core", "serde", "erased-serde", "serde_json"]
3737
batteries_included = ["generic"]
3838
default = [
39-
"batteries_included",
40-
"v3_public",
41-
"v3_local",
42-
"v4_local",
43-
"v4_public",
39+
"batteries_included",
40+
"v4_local",
41+
"v4_public",
4442
]
4543

4644
[lib]
@@ -56,7 +54,7 @@ ring = { version = "^0.16", features = ["std"], optional = false }
5654
base64 = { version = "^0.13.0", optional = false }
5755
hex = { version = "^0.4.3", optional = false }
5856
serde = { version = "1.0.117", features = ["derive"], optional = true }
59-
ed25519-dalek = { version = "1.0.1", optional = true }
57+
ed25519-dalek = { version = "2.0.0", features = ["zeroize"], optional = true }
6058
serde_json = { version = "^1.0.68", optional = true }
6159
thiserror = "1.0.29"
6260
iso8601 = "0.4.0"

src/core/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use std::array::TryFromSliceError;
12
use thiserror::Error;
23

34
/// Potential errors from attempting to build a token claim
@@ -40,6 +41,12 @@ pub enum PasetoError {
4041
///Occurs when a signature fails verification
4142
#[error("The token signature could not be verified")]
4243
InvalidSignature,
44+
#[error("A slice conversion error occurred")]
45+
TryFromSlice {
46+
///Surfaces errors from slice conversion attempts
47+
#[from]
48+
source: TryFromSliceError,
49+
},
4350
///Occurs when an untrusted token string is unable to be parsed into its constituent parts
4451
#[error("This string has an incorrect number of parts and cannot be parsed into a token")]
4552
IncorrectSize,

0 commit comments

Comments
 (0)