diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2024-05-29 14:05:22 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2024-05-29 14:05:22 +0200 |
commit | 8e776fe543699041e73f51b52d1624bedf3ab747 (patch) | |
tree | ab00cee18b64eef89c74d7831cc50cb40d99ffa4 /openpgp/src | |
parent | 43b070c4eaa118c018e538ba9ab9f127788576ab (diff) |
openpgp: When sorting sigs, set the computed hash on the clone.
- This way when the signature fits into two components, the computed
hash is correctly set for every copy of the signature.
Diffstat (limited to 'openpgp/src')
-rw-r--r-- | openpgp/src/cert.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/openpgp/src/cert.rs b/openpgp/src/cert.rs index 3c6de2e8..4f2b9eb8 100644 --- a/openpgp/src/cert.rs +++ b/openpgp/src/cert.rs @@ -1899,8 +1899,12 @@ impl Cert { $sig.digest_prefix()[1], $sig.typ(), $desc); - $sig.set_computed_digest(Some(hash)); - $sigs.push($sig.clone()); + $sigs.push({ + let sig = $sig.clone(); + sig.set_computed_digest(Some(hash)); + sig + }); + // The cost of missing a revocation // certificate merely because we put // it into the wrong place seem to |