summaryrefslogtreecommitdiffstats
path: root/openpgp
AgeCommit message (Collapse)Author
2020-09-29openpgp: Align Signature::normalized_cmp with Signature::cmp.Justus Winter
2020-09-29openpgp: Put all information into the hashed subpacket area.Justus Winter
- Put the Issuer, IssuerFingerprint, and EmbeddedSignature subpackets into the hashed subpacket area. - Even though this information is self-authenticating (the act of validating the signature authenticates the subpacket), it is stored in the unhashed subpacket area. This has the advantage that the signer authenticates the set of issuers. Furthermore, it makes handling of the resulting signatures more robust: If there are two two signatures that are equal modulo the contents of the unhashed area, there is the question of how to merge the information in the unhashed areas. Storing issuer information in the hashed area avoids this problem.
2020-09-29openpgp: Add comment.Justus Winter
2020-09-29openpgp: Fix signature deduplication.Justus Winter
- In order to deduplicate signatures, we need to sort them first. Previously, we used sig_cmp for that, which sorts by signature creation time and uses the actual signature data as a tie breaker. This, however, is not a suitable relation for deduplication with Signature::normalized_eq: Here, we need an order that is consistent with the equality operation, which sig_cmp is not. - Fix this by providing and using Signature::normalized_cmp. - Fixes #573.
2020-09-29openpgp: Implement PartialOrd, Ord for signature-related types.Justus Winter
- In order to deduplicate signatures, we need to be able to sort them. This change implements PartialOrd and Ord for all relevant types. Like PartialEq and Eq it is based on the serialized form, and can be derived for most of the types.
2020-09-25openpgp, ipc: Make clippy ignore lalrpop output.Nora Widdecke
2020-09-25openpgp: Adjust default algorithm preferences.Justus Winter
- Fixes #523.
2020-09-25openpgp: Either derive both Eq and Hash, or impl both.Justus Winter
- crypto::mpi::SecretKeyMaterial is the sole exception to this rule, because we are trying to compare them in constant time. Add a hint for clippy that this is okay. - KeyHandle no longer implements Eq, so there is no point in implementing Hash. Simply remove it. - Implement Hash for SubpacketLength by hashing the serialized form. Manually implement Eq for consistency. - Fixes #567.
2020-09-25openpgp: Properly deduplicate signatures when canonicalizing certs.Justus Winter
- Use the correct equality function when deduplicating signatures. - Fixes #568.
2020-09-25openpgp: Fix documentation.Justus Winter
2020-09-25openpgp: Fix deprecation notices.Nora Widdecke
2020-09-24openpgp: Ensure entire header is read.Nora Widdecke
- https://rust-lang.github.io/rust-clippy/master/index.html#unused_io_amount - Replace `read` with `read_exact`, so that an error is returned if the buffer cannot be filled.
2020-09-23openpgp: Typos.Nora Widdecke
2020-09-22openpgp: Consider subkeys of expired certs also expired.Justus Winter
- Fixes #564.
2020-09-22openpgp: Replace certificate with one that does not expire.Justus Winter
- The tests used a certificate that expired by now. However, because Sequoia did not consider subkeys of expired certificates to be also expired, the tests were happy.
2020-09-22openpgp: Remove erroneous assertion.Justus Winter
- We erroneously assumed that when BufferedReader::next() is called, a SEIP container must be opaque and hence there cannot be a buffered_reader::Reserve on the stack with Cookie::fake_eof set. But, we could simply call BufferedReader::next() after the SEIP packet is decrypted, or buffer a SEIP packet's body, then call BufferedReader::recurse(), which falls back to BufferedReader::next() because some data has been read. - Remove the erroneous assertion. - Fixes #455.
2020-09-22openpgp: Hide stream::Encryptor::aead_algo from public API.Wiktor Kwapisiewicz
- Mark `aead_algo` as available only during tests, - Remove support for AEAD from `sop`, - Mark `aead` parameter in FFI as unused, - openpgp-ffi: Drop `aead_algo` argument from `pgp_encryptor_new`, - Fixes #550.
2020-09-22openpgp: Remove `quickcheck` feature.Wiktor Kwapisiewicz
- Adjust code to test for `cfg(test)` only, - Remove `quickcheck` and `rand` from dependencies so that they stay only in dev-dependencies, - Remove mention of `x-quickcheck` feature from the documentation, - Fixes #545.
2020-09-22openpgp: Remove trailing whitespace.Wiktor Kwapisiewicz
2020-09-21openpgp: Improve comment.Nora Widdecke
2020-09-21openpgp: Fix typos.Nora Widdecke
2020-09-21openpgp, ipc: Update lalrpop to 0.19.Nora Widdecke
2020-09-21openpgp: Unpin unicode-normalization.Nora Widdecke
2020-09-21openpgp: Unpin backtrace.Nora Widdecke
2020-09-21sq, openpgp: Update rpassword to 5.0.Nora Widdecke
2020-09-21Bump MSRV to 1.46.0.Nora Widdecke
2020-09-21openpgp: Refuse to parse ECDH public keys with unknown magic value.Justus Winter
- ECDH public fields have a mechanism for future extensions. Currently, this field has to be set to 1. Enforce this at parse time. - Fixes #561.
2020-09-21openpgp: Typo.Justus Winter
2020-09-21openpgp: Convert `extern crate` to `use` in examples.Wiktor Kwapisiewicz
2020-09-21openpgp: Call all layers of the message `message`.Wiktor Kwapisiewicz
2020-09-21openpgp: Fix examples to use stream::Armorer.Wiktor Kwapisiewicz
2020-09-21openpgp: Adjust examples to use try operator.Wiktor Kwapisiewicz
- Change `expect` to `context(...)?`, - Change `unwrap` to `?`.
2020-09-17openpgp: Make conventional User ID documentation available.Justus Winter
- Move the documentation, fix some formatting to prevent automatic escaping and mangling of the grammar. - Add some links to the various methods. - Fixes #558.
2020-09-17openpgp: Make UserID::assemble use concrete types.Justus Winter
- This prevents monomorphization.
2020-09-17openpgp: Rename file.Justus Winter
2020-09-17openpgp: Improve parsing examples to demonstrate body handling.Justus Winter
- Demonstrate dropping, buffering of all bodies, buffering of individual bodies, and streaming. - Fixes #540.
2020-09-17openpgp: Simplify examples.Justus Winter
2020-09-17openpgp: Add documentation for the new function.Justus Winter
- Fixes #549.
2020-09-17openpgp: Make function more ergonomic.Justus Winter
2020-09-17Revert "openpgp: Remove SignatureBuilder::set_key_expiration_time."Justus Winter
This reverts commit e18c79c37db27d138caeed67025d8b247410c3b8.
2020-09-17openpgp: Marker packets must be ignored, adapt heuristics.Justus Winter
- Marker packets must be ignored everywhere. Add them to the heuristics detecting base64 encoded OpenPGP data in the armor decoder, and to the packet parser's resyncing code. - Fixes #546.
2020-09-16openpgp: Update backsig when changing expiration time.Justus Winter
- When updating the expiration time of signing-capable subkeys, also create a new primary key binding signature. - Fixes #534.
2020-09-16openpgp: Improve documentation.Justus Winter
2020-09-16openpgp: Generalize ValidKeyAmalgamation conversions to references.Justus Winter
2020-09-15openpgp: Make test more robust.Justus Winter
- Evaluate the certificate five minutes in the future now that we backdate newly created certs by one minute.
2020-09-15openpgp: Ensure signatures created from templates take precedence.Justus Winter
- If a signature is created from a template, make sure the new signature has a newer creation time than the original one, while still being valid (i.e. not in the future). This makes it easy to robustly update binding signatures. - Fixes #488.
2020-09-15openpgp: Backdate created certificates by a minute.Justus Winter
- If not given an explicit creation time, backdate created certificates by a minute. This has the advantage that the certificate can immediately be customized: In order to reliably override a binding signature, the overriding binding signature must be newer than the existing signature. If, however, the existing signature is created `now`, any newer signature must have a future creation time, and is considered invalid by Sequoia. To avoid this, we backdate certificate creation times (and hence binding signature creation times), so that there is "space" between the creation time and now for signature updates. - See #488.
2020-09-15Revert "openpgp: TPK -> cert."Justus Winter
This reverts commit ebe340e163c65078534c6905f3f46b4dbdef553c.
2020-09-15openpgp: Replace existing signatures in Cert::merge_packets.Justus Winter
- This allows updating signatures like we update keys. - Fixes #492.
2020-09-15openpgp: TPK -> cert.Justus Winter