Skip to content

Commit 28b0cee

Browse files
committed
build: bump p256, p384 & sec1 crates
1 parent 081f0e4 commit 28b0cee

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

jwt/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ crate-type = ["cdylib", "rlib"]
1414
[dependencies]
1515
thiserror = "1"
1616
serde = "1"
17-
base64 = "0.21.0"
17+
base64 = "0.21"
1818
uuid = { version = "1.1", features = ["v4"] }
19-
p256 = "0.12"
20-
p384 = "0.12"
21-
sec1 = "0.3"
19+
p256 = "0.13"
20+
p384 = "0.13"
21+
sec1 = "0.7"
2222
url = { version = "2.3", features = ["serde"] }
2323
serde_json = "1.0"
2424
sha2 = "0.10"

jwt/src/error.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ pub enum RustyJwtError {
1414
#[error(transparent)]
1515
RandError(#[from] rand::Error),
1616
/// Elliptic curve error
17-
#[error("Elliptic curve error because {0}")]
18-
Sec1Error(sec1::Error),
17+
#[error(transparent)]
18+
Sec1Error(#[from] sec1::Error),
1919
/// Invalid URL
2020
#[error(transparent)]
2121
UrlParseError(#[from] url::ParseError),

jwt/src/jwk/ecdsa.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ impl TryIntoJwk for AnyEcPublicKey {
6262
let Self(alg, bytes) = self;
6363
let (x, y) = match alg {
6464
JwsEcAlgorithm::P256 => {
65-
let point = p256::EncodedPoint::from_bytes(bytes).map_err(RustyJwtError::Sec1Error)?;
65+
let point = p256::EncodedPoint::from_bytes(bytes)?;
6666
let x = RustyJwk::base64_url_encode(point.x().ok_or(RustyJwtError::ImplementationError)?);
6767
let y = RustyJwk::base64_url_encode(point.y().ok_or(RustyJwtError::ImplementationError)?);
6868
(x, y)
6969
}
7070
JwsEcAlgorithm::P384 => {
71-
let point = p384::EncodedPoint::from_bytes(bytes).map_err(RustyJwtError::Sec1Error)?;
71+
let point = p384::EncodedPoint::from_bytes(bytes)?;
7272
let x = RustyJwk::base64_url_encode(point.x().ok_or(RustyJwtError::ImplementationError)?);
7373
let y = RustyJwk::base64_url_encode(point.y().ok_or(RustyJwtError::ImplementationError)?);
7474
(x, y)

0 commit comments

Comments
 (0)