Skip to content

Commit

Permalink
spki: fix UnknownOid reporting
Browse files Browse the repository at this point in the history
As noted in RustCrypto/RSA#422, we're not returning the actual "unknown
OID" encountered in these cases, but the expected one, which makes it
hard to debug mismatches.
  • Loading branch information
tarcieri committed Apr 1, 2024
1 parent 4f63531 commit 78ab27a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spki/src/algorithm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ impl<Params> AlgorithmIdentifier<Params> {
if self.oid == expected_oid {
Ok(expected_oid)
} else {
Err(Error::OidUnknown { oid: expected_oid })
Err(Error::OidUnknown { oid: self.oid })
}
}
}
Expand All @@ -122,7 +122,7 @@ impl<'a> AlgorithmIdentifierRef<'a> {
if actual_oid == expected_oid {
Ok(actual_oid)
} else {
Err(Error::OidUnknown { oid: expected_oid })
Err(Error::OidUnknown { oid: actual_oid })
}
}

Expand Down

0 comments on commit 78ab27a

Please sign in to comment.