From 73ce68ac21bb1d432e9c385ecfc7b95ec50e91a8 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 9 Feb 2023 08:57:09 -0500 Subject: [PATCH] Rename DescEncNonce => HsDescEncNonce --- crates/tor-netdoc/src/doc/hsdesc/desc_enc.rs | 4 ++-- crates/tor-netdoc/src/doc/hsdesc/middle.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/tor-netdoc/src/doc/hsdesc/desc_enc.rs b/crates/tor-netdoc/src/doc/hsdesc/desc_enc.rs index 1d8f83678..7783ef8b4 100644 --- a/crates/tor-netdoc/src/doc/hsdesc/desc_enc.rs +++ b/crates/tor-netdoc/src/doc/hsdesc/desc_enc.rs @@ -29,7 +29,7 @@ pub(super) struct HsDescEncryption<'a> { /// For the encryption layer, it is `descriptor_cookie` (2.5.2.1) /// which is present when descriptor-encryption authentication via /// `KP_hsc_desc_enc` is in use. - pub(super) desc_enc_nonce: Option<&'a DescEncNonce>, + pub(super) desc_enc_nonce: Option<&'a HsDescEncNonce>, /// The "subcredential" of the onion service. pub(super) subcredential: &'a Subcredential, /// The current revision of the onion service descriptor being decrypted. @@ -47,7 +47,7 @@ pub(super) struct HsDescEncryption<'a> { /// This is `N_hs_desc_enc` in the spec, where sometimes we also call it a /// "descriptor cookie". #[derive(derive_more::AsRef, derive_more::From)] -pub(super) struct DescEncNonce([u8; 16]); +pub(super) struct HsDescEncNonce([u8; 16]); /// Length of our cryptographic salt. const SALT_LEN: usize = 16; diff --git a/crates/tor-netdoc/src/doc/hsdesc/middle.rs b/crates/tor-netdoc/src/doc/hsdesc/middle.rs index 36afee3ff..aaeb6d0b3 100644 --- a/crates/tor-netdoc/src/doc/hsdesc/middle.rs +++ b/crates/tor-netdoc/src/doc/hsdesc/middle.rs @@ -12,7 +12,7 @@ use crate::parse::{keyword::Keyword, parser::SectionRules}; use crate::types::misc::B64; use crate::{Pos, Result}; -use super::desc_enc::{DescEncNonce, HsDescEncryption}; +use super::desc_enc::{HsDescEncNonce, HsDescEncryption}; use super::DecryptionError; /// A more-or-less verbatim representation of the middle document of an onion @@ -78,7 +78,7 @@ impl HsDescMiddle { &self, subcredential: &Subcredential, ks_hsc_desc_enc: &HsClientDescEncSecretKey, - ) -> Option { + ) -> Option { use cipher::{KeyIvInit, StreamCipher}; use digest::{ExtendableOutput, Update}; use tor_llcrypto::cipher::aes::Aes256Ctr as Cipher;