Skip to content

Commit 1c1f934

Browse files
authored
ecdsa: bump der to v0.8.0-rc.5 (#1003)
This version notably automatically handles setting up a nested `Reader` for passing to `DecodeValue::decode_value`, eliminating the need to do it manually. Also cuts an `ecdsa` v0.17.0-rc.3
1 parent 310df4a commit 1c1f934

File tree

3 files changed

+10
-13
lines changed

3 files changed

+10
-13
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ecdsa/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ecdsa"
3-
version = "0.17.0-rc.2"
3+
version = "0.17.0-rc.3"
44
description = """
55
Pure Rust implementation of the Elliptic Curve Digital Signature Algorithm
66
(ECDSA) as specified in FIPS 186-4 (Digital Signature Standard), providing
@@ -22,7 +22,7 @@ signature = { version = "3.0.0-rc.1", default-features = false, features = ["ran
2222
zeroize = { version = "1.5", default-features = false }
2323

2424
# optional dependencies
25-
der = { version = "0.8.0-rc.2", optional = true }
25+
der = { version = "0.8.0-rc.5", optional = true }
2626
digest = { version = "0.11.0-rc.0", optional = true, default-features = false, features = ["oid"] }
2727
rfc6979 = { version = "0.5.0-rc.0", optional = true }
2828
serdect = { version = "0.3", optional = true, default-features = false, features = ["alloc"] }

ecdsa/src/der.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ struct SignatureRef<'a> {
357357
pub r: UintRef<'a>,
358358
pub s: UintRef<'a>,
359359
}
360+
360361
impl EncodeValue for SignatureRef<'_> {
361362
fn value_len(&self) -> der::Result<Length> {
362363
self.r.encoded_len()? + self.s.encoded_len()?
@@ -368,21 +369,17 @@ impl EncodeValue for SignatureRef<'_> {
368369
Ok(())
369370
}
370371
}
371-
impl<'a> SignatureRef<'a> {
372-
fn decode_value_inner<R: Reader<'a>>(reader: &mut R) -> der::Result<Self> {
372+
373+
impl<'a> DecodeValue<'a> for SignatureRef<'a> {
374+
type Error = der::Error;
375+
376+
fn decode_value<R: Reader<'a>>(reader: &mut R, _header: Header) -> der::Result<Self> {
373377
Ok(Self {
374378
r: UintRef::decode(reader)?,
375379
s: UintRef::decode(reader)?,
376380
})
377381
}
378382
}
379-
impl<'a> DecodeValue<'a> for SignatureRef<'a> {
380-
type Error = der::Error;
381-
382-
fn decode_value<R: Reader<'a>>(reader: &mut R, header: Header) -> der::Result<Self> {
383-
reader.read_nested(header.length, Self::decode_value_inner)
384-
}
385-
}
386383
impl<'a> Sequence<'a> for SignatureRef<'a> {}
387384

388385
/// Locate the range within a slice at which a particular subslice is located

0 commit comments

Comments
 (0)