Skip to content

Commit

Permalink
ecdsa: fixup unnecessary qualification warnings (#824)
Browse files Browse the repository at this point in the history
  • Loading branch information
baloo authored May 17, 2024
1 parent fae9707 commit 6544071
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions ecdsa/src/der.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ where
writer
.finish()?
.try_into()
.map_err(|_| der::Tag::Sequence.value_error())
.map_err(|_| Tag::Sequence.value_error())
}

/// Borrow this signature as a byte slice
Expand Down Expand Up @@ -360,7 +360,7 @@ where
fn decode_der(der_bytes: &[u8]) -> der::Result<(UintRef<'_>, UintRef<'_>)> {
let mut reader = der::SliceReader::new(der_bytes)?;
let header = der::Header::decode(&mut reader)?;
header.tag.assert_eq(der::Tag::Sequence)?;
header.tag.assert_eq(Tag::Sequence)?;

let ret = reader.read_nested::<_, _, der::Error>(header.length, |reader| {
let r = UintRef::decode(reader)?;
Expand Down
10 changes: 6 additions & 4 deletions ecdsa/src/verifying.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ use {core::str::FromStr, elliptic_curve::pkcs8::DecodePublicKey};
use elliptic_curve::pkcs8::{
self,
der::AnyRef,
spki::{AlgorithmIdentifier, AssociatedAlgorithmIdentifier, SignatureAlgorithmIdentifier},
spki::{
self, AlgorithmIdentifier, AssociatedAlgorithmIdentifier, SignatureAlgorithmIdentifier,
},
AssociatedOid, ObjectIdentifier,
};

Expand Down Expand Up @@ -419,9 +421,9 @@ where
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: sec1::ModulusSize,
{
type Error = pkcs8::spki::Error;
type Error = spki::Error;

fn try_from(spki: pkcs8::SubjectPublicKeyInfoRef<'_>) -> pkcs8::spki::Result<Self> {
fn try_from(spki: pkcs8::SubjectPublicKeyInfoRef<'_>) -> spki::Result<Self> {
PublicKey::try_from(spki).map(|inner| Self { inner })
}
}
Expand All @@ -433,7 +435,7 @@ where
AffinePoint<C>: FromEncodedPoint<C> + ToEncodedPoint<C>,
FieldBytesSize<C>: sec1::ModulusSize,
{
fn to_public_key_der(&self) -> pkcs8::spki::Result<pkcs8::Document> {
fn to_public_key_der(&self) -> spki::Result<pkcs8::Document> {
self.inner.to_public_key_der()
}
}
Expand Down

0 comments on commit 6544071

Please sign in to comment.