Loading crates/tor-netdoc/src/doc/netstatus.rs +12 −0 Original line number Diff line number Diff line Loading @@ -593,6 +593,18 @@ define_derive_deftly! { Some(KeywordOrString::Unknown(..)) => {} } } /// Return the hash value for a specific algorithm, as a slice /// /// `None` if the value wasn't computed. /// That shouldn't happen. // XXXX make no longer pub(crate) pub(crate) fn hash_slice_for_verification(&self, algo: $ttype) -> Option<&[u8]> { // XXXX handle sha1_unnamed correctly match algo { $( $vtype => Some(self.$FNAME.as_ref()?), ) } } } } Loading crates/tor-netdoc/src/parse2/poc/netstatus.rs +1 −13 Original line number Diff line number Diff line Loading @@ -112,18 +112,6 @@ define_derive_deftly! { Some(algo.into()) } /// Return the hash value for a specific algorithm, as a slice /// /// `None` if the value wasn't computed. /// That shouldn't happen. // XXXX make no longer pub(crate) pub(crate) fn hash_slice_for_verification(&self, algo: $ttype) -> Option<&[u8]> { // XXXX handle sha1_unnamed correctly match algo { $( $vtype => Some(self.$FNAME.as_ref()?), ) } } } // XXXX we have two DirectorySignatureHashAlgo types, which we, briefly, Loading Loading @@ -254,7 +242,7 @@ fn verify_general_timeless( }; let h = hashes .hash_slice_for_verification(*hash_algo) .hash_slice_for_verification((*hash_algo).into()) .ok_or(VF::Bug)?; let () = cert.dir_signing_key.verify(h, rsa_signature)?; Loading Loading
crates/tor-netdoc/src/doc/netstatus.rs +12 −0 Original line number Diff line number Diff line Loading @@ -593,6 +593,18 @@ define_derive_deftly! { Some(KeywordOrString::Unknown(..)) => {} } } /// Return the hash value for a specific algorithm, as a slice /// /// `None` if the value wasn't computed. /// That shouldn't happen. // XXXX make no longer pub(crate) pub(crate) fn hash_slice_for_verification(&self, algo: $ttype) -> Option<&[u8]> { // XXXX handle sha1_unnamed correctly match algo { $( $vtype => Some(self.$FNAME.as_ref()?), ) } } } } Loading
crates/tor-netdoc/src/parse2/poc/netstatus.rs +1 −13 Original line number Diff line number Diff line Loading @@ -112,18 +112,6 @@ define_derive_deftly! { Some(algo.into()) } /// Return the hash value for a specific algorithm, as a slice /// /// `None` if the value wasn't computed. /// That shouldn't happen. // XXXX make no longer pub(crate) pub(crate) fn hash_slice_for_verification(&self, algo: $ttype) -> Option<&[u8]> { // XXXX handle sha1_unnamed correctly match algo { $( $vtype => Some(self.$FNAME.as_ref()?), ) } } } // XXXX we have two DirectorySignatureHashAlgo types, which we, briefly, Loading Loading @@ -254,7 +242,7 @@ fn verify_general_timeless( }; let h = hashes .hash_slice_for_verification(*hash_algo) .hash_slice_for_verification((*hash_algo).into()) .ok_or(VF::Bug)?; let () = cert.dir_signing_key.verify(h, rsa_signature)?; Loading