File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -14,11 +14,11 @@ crate-type = ["cdylib", "rlib"]
14
14
[dependencies ]
15
15
thiserror = " 1"
16
16
serde = " 1"
17
- base64 = " 0.21.0 "
17
+ base64 = " 0.21"
18
18
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 "
22
22
url = { version = " 2.3" , features = [" serde" ] }
23
23
serde_json = " 1.0"
24
24
sha2 = " 0.10"
Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ pub enum RustyJwtError {
14
14
#[ error( transparent) ]
15
15
RandError ( #[ from] rand:: Error ) ,
16
16
/// Elliptic curve error
17
- #[ error( "Elliptic curve error because {0}" ) ]
18
- Sec1Error ( sec1:: Error ) ,
17
+ #[ error( transparent ) ]
18
+ Sec1Error ( # [ from ] sec1:: Error ) ,
19
19
/// Invalid URL
20
20
#[ error( transparent) ]
21
21
UrlParseError ( #[ from] url:: ParseError ) ,
Original file line number Diff line number Diff line change @@ -62,13 +62,13 @@ impl TryIntoJwk for AnyEcPublicKey {
62
62
let Self ( alg, bytes) = self ;
63
63
let ( x, y) = match alg {
64
64
JwsEcAlgorithm :: P256 => {
65
- let point = p256:: EncodedPoint :: from_bytes ( bytes) . map_err ( RustyJwtError :: Sec1Error ) ?;
65
+ let point = p256:: EncodedPoint :: from_bytes ( bytes) ?;
66
66
let x = RustyJwk :: base64_url_encode ( point. x ( ) . ok_or ( RustyJwtError :: ImplementationError ) ?) ;
67
67
let y = RustyJwk :: base64_url_encode ( point. y ( ) . ok_or ( RustyJwtError :: ImplementationError ) ?) ;
68
68
( x, y)
69
69
}
70
70
JwsEcAlgorithm :: P384 => {
71
- let point = p384:: EncodedPoint :: from_bytes ( bytes) . map_err ( RustyJwtError :: Sec1Error ) ?;
71
+ let point = p384:: EncodedPoint :: from_bytes ( bytes) ?;
72
72
let x = RustyJwk :: base64_url_encode ( point. x ( ) . ok_or ( RustyJwtError :: ImplementationError ) ?) ;
73
73
let y = RustyJwk :: base64_url_encode ( point. y ( ) . ok_or ( RustyJwtError :: ImplementationError ) ?) ;
74
74
( x, y)
You can’t perform that action at this time.
0 commit comments