Skip to content

Commit

Permalink
rs: Remove rune from signature
Browse files Browse the repository at this point in the history
We do not need to inclued the rune in the signature as the rune is
bound to the public key by a restriction. A rune can grow quickly with
the comlexity of the restrictions that the rune provides. We can safe
quite some space if we remove the rune from the signature.

Signed-off-by: Peter Neuroth <[email protected]>
  • Loading branch information
nepet committed Sep 10, 2023
1 parent 7e01856 commit c7da007
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
6 changes: 0 additions & 6 deletions libs/gl-client/src/node/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ impl Service<Request<BoxBody>> for AuthService {
let mut ts = vec![];
ts.put_u64(time.try_into()?);
buf.put_u64(time.try_into()?);
buf.put(
general_purpose::URL_SAFE
.decode(rune.clone())
.unwrap_or_else(|_| vec![])
.as_ref(),
);

let rng = rand::SystemRandom::new();
let pubkey = keypair.public_key().as_ref();
Expand Down
2 changes: 0 additions & 2 deletions libs/gl-client/src/signer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,6 @@ impl Signer {
if r.timestamp != 0 {
data.put_u64(r.timestamp);
}
let rune: Vec<u8> = r.rune.clone();
data.put(&rune[..]);

pk.verify(&data, &r.signature)
.map_err(|e| anyhow!("signature verification failed: {}", e))?;
Expand Down

0 comments on commit c7da007

Please sign in to comment.