diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-02-05 12:31:14 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-02-05 16:27:53 +0100 |
commit | 0383d6c4dc7633cf3e4968f174996748063f8b65 (patch) | |
tree | 341b077ab4bce190d820270c11474c954bfc4212 | |
parent | 9d72d44a7de26350caa4bcfbc499f3018b060434 (diff) |
openpgp: Duplicate signatures if we used our reordering heuristic.
- The cost of missing a revocation certificate merely because we put
it into the wrong place seem to outweigh the cost of duplicating
it.
-rw-r--r-- | openpgp/src/cert/mod.rs | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/openpgp/src/cert/mod.rs b/openpgp/src/cert/mod.rs index 9e884553..d1843d32 100644 --- a/openpgp/src/cert/mod.rs +++ b/openpgp/src/cert/mod.rs @@ -900,6 +900,9 @@ impl Cert { // place. 'outer: for sig in mem::replace(&mut self.bad, Vec::new()) { + // Did we find a new place for sig? + let mut found_component = false; + macro_rules! check_one { ($desc:expr, $sigs:expr, $sig:expr, $verify_method:ident, $($verify_args:expr),*) => ({ @@ -968,8 +971,16 @@ impl Cert { $sig.digest_prefix()[1], $sig.typ(), $desc); - $sigs.push($sig); - continue 'outer; + $sigs.push($sig.clone()); + // The cost of missing a revocation + // certificate merely because we put + // it into the wrong place seem to + // outweigh the cost of duplicating + // it. + t!("Will keep trying to match this sig to \ + other components (found before? {:?})...", + found_component); + found_component = true; } } } @@ -1095,6 +1106,10 @@ impl Cert { }, } + if found_component { + continue; + } + // Keep them for later. t!("Self-sig {:02X}{:02X}, {:?} doesn't belong \ to any known component or is bad.", |