From c7da007c2cb9684c983a1ab512e566f3e68c8069 Mon Sep 17 00:00:00 2001 From: Peter Neuroth Date: Mon, 4 Sep 2023 23:07:39 +0200 Subject: [PATCH] rs: Remove rune from signature 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 --- libs/gl-client/src/node/service.rs | 6 ------ libs/gl-client/src/signer/mod.rs | 2 -- 2 files changed, 8 deletions(-) diff --git a/libs/gl-client/src/node/service.rs b/libs/gl-client/src/node/service.rs index 960123fe7..a47e80e4b 100644 --- a/libs/gl-client/src/node/service.rs +++ b/libs/gl-client/src/node/service.rs @@ -119,12 +119,6 @@ impl Service> 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(); diff --git a/libs/gl-client/src/signer/mod.rs b/libs/gl-client/src/signer/mod.rs index 51fc2bbd1..061c2b5ed 100644 --- a/libs/gl-client/src/signer/mod.rs +++ b/libs/gl-client/src/signer/mod.rs @@ -233,8 +233,6 @@ impl Signer { if r.timestamp != 0 { data.put_u64(r.timestamp); } - let rune: Vec = r.rune.clone(); - data.put(&rune[..]); pk.verify(&data, &r.signature) .map_err(|e| anyhow!("signature verification failed: {}", e))?;