Skip to content

Commit

Permalink
signer: Update futhark
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Neuroth <[email protected]>
  • Loading branch information
nepet committed Sep 30, 2023
1 parent 4a72abc commit 80df5db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 15 deletions.
3 changes: 2 additions & 1 deletion libs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 8 additions & 14 deletions libs/gl-client/src/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,24 +272,18 @@ impl Signer {
return Err(anyhow!("rune is missing pubkey field"));
}

let mut checks: HashMap<String, Box<dyn futhark::Tester>> = HashMap::new();
checks.insert(
"pubkey".to_string(),
Box::new(futhark::ConditionTester {
value: hex::encode(request.pubkey),
}),
);
let mut checks: HashMap<String, String> = HashMap::new();
checks.insert("pubkey".to_string(), hex::encode(request.pubkey));

// Runes only check on the version if the unique id field is set. The id
// and the version are part of the empty field.
if let Some(device_id) = rune.get_id() {
checks.insert(
"".to_string(),
Box::new(futhark::ConditionTester {
value: format!("{}-{}", device_id, RUNE_VERSION),
}),
);
checks.insert("".to_string(), format!("{}-{}", device_id, RUNE_VERSION));
}
match self.master_rune.check_with_reason(&rune64, &checks) {
match self
.master_rune
.check_with_reason(&rune64, futhark::MapChecker { map: checks })
{
Ok(_) => Ok(()),
Err(e) => Err(e.into()),
}
Expand Down

0 comments on commit 80df5db

Please sign in to comment.