Skip to content

Commit

Permalink
ensure ed25519 pkcs8 is consumed
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugeny committed Aug 17, 2023
1 parent 43edc32 commit 59112c9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions russh-keys/src/format/pkcs8.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ fn read_key_v1(reader: &mut BERReaderSeq) -> Result<key::KeyPair, Error> {
.ok_or(Error::KeyIsCorrupt)
.and_then(|s| SigningKey::try_from(s).map_err(|_| Error::CouldNotReadKey))?
};
// Consume the public key
reader
.next()
.read_tagged(yasna::Tag::context(1), |reader| reader.read_bitvec())?;
Ok(key::KeyPair::Ed25519(secret))
} else {
Err(Error::CouldNotReadKey)
Expand Down

0 comments on commit 59112c9

Please sign in to comment.