Age | Commit message (Collapse) | Author |
|
- This way, the callback can have side-effects.
|
|
|
|
- Add `KeyBuilder` and `SubkeyBuilder` for creating a key, and
attaching a subkey to a certificate.
- See #483.
|
|
- Cert::insert_packets2 is a variant of Cert::insert_packets that
returns whether the certificate actually changed. Fixes #528.
- Cert::insert_packets_merge is a variant of Cert::insert_packets2
that allows one to control how duplicate packets are handled.
Fixes #494.
|
|
- In contrast to UnsupportedCert, this variant carries all the
packets that we failed to parse into a cert. Notably, this
includes primary keys that we don't understand. Keeping the
packets with the errors allows us to at least roundtrip the
packets.
|
|
- We validate certificate structures based on packet tags. In the
past, this lead to problems where a secret key packet was parsed
to an unknown packet because the secret bits were malformed. This
lead to a crash in the generated parser because it was assuming to
see a secret key packet, but got an unknown packet.
- This was changed in cd5eb82edfb326d7cbde29ee105f9f88e045c240 so
that we validate the certificate structure based on packet kinds,
i.e. we would only consider a packet a secret key packet if we
managed to parse it into one. However, this caused the parser to
be overly strict, causing problems with forward compatibility, and
the parser to return an Error::MalformedCert instead of an
Error::UnsupportedCert (see #170).
- Return to validating on packet tags, but make the parser code
aware that we may have parsed some packets (like secret key
packets) to unknown packets.
- This effectively reverts commit
cd5eb82edfb326d7cbde29ee105f9f88e045c240.
- Fixes #170.
|
|
|
|
- Previously, Cert::merge_public_and_secret was not predictable with
respect to which secrets are kept (due to unstable sorting). It
also didn't document which secrets would be kept. All in all that
made the function unpredictable, and hence unsafe and not usable.
- Document that the secrets in `other` are preferred over the ones
in `self`. Implement that by first sorting components using a
stable sort algorithm, then preferring the merged in (now
predictably the latter) secrets over existing ones. Add a test.
- Fixes #843.
|
|
|
|
|
|
|
|
- Adapt to the new API:
- Gen is now a struct, not a Trait, and replaces StdThreadGen.
- The rand re-export has been removed. As a consequence, we need
our own function to generate an arbitrary value from a range.
|
|
- Found with clippy::useless_conversion.
|
|
- Replace
let bar = std::mem::replace(&foo, Default::Default());
with
let bar = std::mem::take(&foo);
The new version seems a little clearer.
- Found by clippy:
https://rust-lang.github.io/rust-clippy/master/index.html#mem_replace_with_default
|
|
- Found by clippy::redundant_slicing.
|
|
- Fixed with the help of clippy::needless_borrow.
|
|
|
|
- Fixes #769.
|
|
|
|
|
|
In this code:
self.user_attributes.retain(|_| (keep[i], i += 1).0);
it can be unclear to the reader that the increment of i actually
happens before keep is indexed. Especially so for people who've been
inflicted by C and its many surprising reasons for undefined behavior.
It seems better to write this using an iterator.
Found by clippy lint eval_order_dependence:
https://rust-lang.github.io/rust-clippy/master/index.html#eval_order_dependence
|
|
|
|
|
|
- Some link targets have moved or were replaced since the link's
creation. Make them point to the new location or replacement.
|
|
- openpgp: Make broken relative links absolute:
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+packet),\1crate::packet,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+cert),\1crate::cert,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+parse),\1crate::parse,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+policy),\1crate::policy,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+serialize),\1crate::serialize,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+armor),\1crate::armor,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+types),\1crate::types,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!] *(\[`PacketPile`\]):).*$,\1 crate::PacketPile,' {} +
- openpgp: Link to PacketParser and Policy structs, not the modules.
- ffi: Make links to sequoia_openpgp and sequoia_net absolute
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_openpgp),\1sequoia_openpgp,' {} +
- find -name "*.rs" -exec sed -i -E 's,^( *//[/!](.*): )((super::)+sequoia_net),\1sequoia_net,' {} +
|
|
- Apply cargo intraconv.
|
|
|
|
- Before we do anything, we'll order and deduplicate the components.
If two components are the same, they will be merged, and their
signatures will also be deduplicated. This improves the
performance considerably when we update a certificate, because the
certificates will be most likely almost identical, and we avoid
about half of the signature verifications.
- And indeed, benchmarking shows a 45% performance improvement on a
typical cert.
- Fixes #644.
|
|
- When reconsidering signatures on unknown components, consider all
signatures in the bundle.
|
|
|
|
|
|
- Comparing Certs ignores any secret key material, in accordance
with our definition of equality based on the serialized form. To
take secret key material into account, define equality of TSKs.
- Fixes #701.
|
|
- Fixes #731.
|
|
|
|
|
|
- The documentation refers to this function, however, until now it
was missing. Adding it is simple enough, but technically breaks
the API, because it breaks callers invoking
ValidCert::revocation_keys, which would previously deref to
Cert::revocation_keys.
- Avoid the breakage by adding an optional argument, which should be
None but can be Some(_) in order to appease existing users. See
#725.
|
|
- adds a new method to support the [Policy URI
subpacket](https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.3.20).
Close #536.
|
|
- The current implementation of `Cert::insert_packets` is O(n*m)
where n is the number of signatures in the certificate and m is
the number of signatures in the packets to insert.
- Be smarter. Put the signatures in a BTreeMap and search it
instead of doing a linear scan to see if we already have a
given packet.
- Fixes #706.
|
|
- Fixes #335.
|
|
- See #335.
|
|
- See #335.
|
|
- This is a low-level interface. We will provide nicer abstractions
in a followup.
- See #335.
|
|
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#len_zero
- https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
|
|
- https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
|
|
- Compiling with 1.51 toolchains prints warnings about redundant
semicolons. Remove them.
|
|
|
|
- At some point, invalid self-signatures would be mis-classified as
third-party certifications by Cert::canonicalize. As a side-effect,
invalid self-revocations would be considered third-party
revocations, changing the certificates revocation status to
CouldBe. Confusingly, also changing the digest prefix would break
this mis-classification, resulting in a revocation status of
NotAsFarAsWeKnow.
- The underlying issue was fixed in
7afee60b7cf0f19559bfccd8c42fdc77f6b9c655.
- Add a test that demonstrates that bad signatures are now
recognized as such, and that the confusing behavior previously
observed is now consistent.
- Fixes #486.
|
|
- Add a test exercising key encryption.
- Demonstrate that key packets are correctly replacing existing
packets when using Cert::insert_packets.
|