summaryrefslogtreecommitdiffstats
path: root/openpgp/src/parse
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-12-13 15:31:43 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-12-13 16:37:02 +0100
commit5bef82801ced8f754552110959ad6fcfcf94c7ac (patch)
treeed170b037b6d6a5b6aabba53746ca2862750ae99 /openpgp/src/parse
parent87f175aacd370e3bf8e1d736a51e3710f7142506 (diff)
openpgp: Call the computed hash a digest.
Diffstat (limited to 'openpgp/src/parse')
-rw-r--r--openpgp/src/parse/parse.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/openpgp/src/parse/parse.rs b/openpgp/src/parse/parse.rs
index db591304..202041ba 100644
--- a/openpgp/src/parse/parse.rs
+++ b/openpgp/src/parse/parse.rs
@@ -1026,7 +1026,7 @@ impl Signature4 {
// Locate the corresponding HashedReader and extract the
// computed hash.
- let mut computed_hash = None;
+ let mut computed_digest = None;
{
let recursion_depth = pp.recursion_depth();
@@ -1057,8 +1057,8 @@ impl Signature4 {
})
{
t!("popped a {:?} HashedReader", hash_algo);
- computed_hash = Some((cookie.signature_level(),
- hash.clone()));
+ computed_digest = Some((cookie.signature_level(),
+ hash.clone()));
}
if cookie.sig_group_unused() {
@@ -1072,14 +1072,14 @@ impl Signature4 {
}
}
- if let Some((level, mut hash)) = computed_hash {
+ if let Some((level, mut hash)) = computed_digest {
if let Packet::Signature(ref mut sig) = pp.packet {
sig.hash(&mut hash);
let mut digest = vec![0u8; hash.digest_size()];
hash.digest(&mut digest);
- sig.set_computed_hash(Some(digest));
+ sig.set_computed_digest(Some(digest));
sig.set_level(level);
} else {
unreachable!()
@@ -1388,12 +1388,12 @@ fn one_pass_sig_test () {
crate::fmt::to_hex(&test.hash_prefix[sigs][..], false),
crate::fmt::to_hex(sig.hash_prefix(), false));
eprintln!(" computed hash: {}",
- crate::fmt::to_hex(&sig.computed_hash().unwrap(),
- false));
+ crate::fmt::to_hex(&sig.computed_digest().unwrap(),
+ false));
assert_eq!(&test.hash_prefix[sigs], sig.hash_prefix());
assert_eq!(&test.hash_prefix[sigs][..],
- &sig.computed_hash().unwrap()[..2]);
+ &sig.computed_digest().unwrap()[..2]);
sigs += 1;
} else if one_pass_sigs > 0 {