From 36d8502fed806081252b961418b02d5cb546369b Mon Sep 17 00:00:00 2001 From: AniaPiotrowska Date: Wed, 3 Nov 2021 20:31:40 +0000 Subject: [PATCH 1/2] Update clients/socks5/src/commands/init.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jędrzej Stuczyński --- clients/socks5/src/commands/init.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/socks5/src/commands/init.rs b/clients/socks5/src/commands/init.rs index 24f312fe7d..f6bc31624b 100644 --- a/clients/socks5/src/commands/init.rs +++ b/clients/socks5/src/commands/init.rs @@ -81,7 +81,7 @@ async fn _prepare_temporary_credential(validators: &[Url], raw_identity: &[u8]) serial_number: params.random_scalar(), binding_number: params.random_scalar(), voucher_value: hash_to_scalar(BANDWIDTH_VALUE.to_be_bytes()), - voucher_info: hash_to_scalar(String::from("BandwidthVoucher").as_bytes()), + voucher_info: hash_to_scalar("BandwidthVoucher"), }; let bandwidth_credential = credentials::bandwidth::obtain_signature( From 87c8b512b0bd2771b9e4e7c752bdf514bf68e7f2 Mon Sep 17 00:00:00 2001 From: AniaPiotrowska Date: Wed, 3 Nov 2021 20:32:24 +0000 Subject: [PATCH 2/2] Update common/credentials/src/bandwidth.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jędrzej Stuczyński --- common/credentials/src/bandwidth.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/credentials/src/bandwidth.rs b/common/credentials/src/bandwidth.rs index bce2cda06e..cbb80439e2 100644 --- a/common/credentials/src/bandwidth.rs +++ b/common/credentials/src/bandwidth.rs @@ -38,10 +38,7 @@ pub struct BandwidthVoucherAttributes { impl BandwidthVoucherAttributes { pub fn get_public_attributes(&self) -> Vec { - let mut pub_attributes = Vec::with_capacity(PUBLIC_ATTRIBUTES as usize); - pub_attributes.push(self.voucher_value); - pub_attributes.push(self.voucher_info); - pub_attributes + vec![self.voucher_value, self.voucher_info] } pub fn get_private_attributes(&self) -> Vec {