Bugfix: parse ed25519 ids right in mds

This commit is contained in:
Nick Mathewson 2020-09-08 13:30:16 -04:00
parent b5ad25e0d4
commit e31652afe1
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@ fn main() -> Result<()> {
let dir = cfg.load()?;
for r in dir.relays() {
println!("{:?}", r.get_id().unwrap())
println!("{}", r.get_rsa_id())
}
Ok(())

View File

@ -232,10 +232,10 @@ impl Microdesc {
let id_tok = body
.get_slice(ID)
.iter()
.find(|item| item.get_arg(1) == Some("ed25519"));
.find(|item| item.get_arg(0) == Some("ed25519"));
match id_tok {
None => None,
Some(tok) => Some(tok.parse_arg::<Ed25519Public>(0)?.into()),
Some(tok) => Some(tok.parse_arg::<Ed25519Public>(1)?.into()),
}
};