summaryrefslogtreecommitdiffstats
path: root/openpgp/tests
AgeCommit message (Collapse)Author
2020-11-27openpgp: Improve debugging output.Neal H. Walfield
- When two serialized messages in the for-each-artifact test differ, print more helpful debugging output.
2020-11-24openpgp: Accept any number of (unicode) dashes in armor framing.Justus Winter
- Fixes #610.
2020-11-24openpgp: Handle truncated armor prefixes.Justus Winter
- Fixes #618.
2020-11-13openpgp: Add the vectors from The first collision for full SHA-1.Justus Winter
2020-11-12openpgp: Add test vector from SHA-1 is a Shambles.Justus Winter
2020-10-18openpgp: Change Cert::into_packets to not drop any information.Neal H. Walfield
- Change `Cert::into_packets` to return the underlying packets. That is don't drop secret key material like `Cert::serialize` does.
2020-10-14Replace most 'extern crate' directives with 'use'.Justus Winter
- See #480.
2020-10-06Remove top-level sequoia packageIgor Matuszewski
This runs into surprising interactions when trying to build member packages with other than default feature set. See https://gitlab.com/sequoia-pgp/sequoia/-/issues/575 for more info.
2020-08-17openpgp: Move crypto::Keygrip to the ipc crate.Justus Winter
2020-08-17openpgp: Move crypto::sexp to the ipc crate.Justus Winter
- This is only used to communicate with the GnuPG agent, so it should not be in the openpgp crate.
2020-08-07openpgp: Check that primary key binding signatures are alive.Justus Winter
- Fixes #539.
2020-08-07openpgp: Apply the policy to primary key binding signatures.Justus Winter
- Fixes #531.
2020-07-15openpgp: Gracefully handle malformed notation names.Justus Winter
2020-06-05openpgp: Fix parsing.Justus Winter
- Previously, a signature packet with a malformed embedded signature would break the parsing, because the embedded signature is turned into an unknown packet, hence `Signature::from_reader` returns `Error::InvalidOperation` and so does `SubpacketArea::parse`. Errors from that function are handled using php_try!, but that did not make the packet turn into an unknown packet, but terminated the parsing. - Looking at `Subpacket::parse` revealed that there are more errors that would terminate parsing in the outlined way, notably `Error::MalformedPacket`, but there may be others. - Fix this by tweaking php_try! to return unknown packets on any `openpgp::Error`.
2020-04-30openpgp: Improve documentation of the parse module.Justus Winter
- See #471.
2020-04-27openpgp: Fix tests when building without compression support.Justus Winter
- Fixes #495.
2020-04-20openpgp: Add armor::Writer::with_headers.Justus Winter
- Add a new constructor that takes headers. This allows us to make the header argument polymorphic.
2020-04-16Revert "openpgp: Make PacketParserResult a std::result::Result."Justus Winter
This reverts commit 2e1eec5fe4157a391a13554ff7df3075cfe043cc.
2020-04-15openpgp: We don't throw away components with no self signaturesNeal H. Walfield
- We don't throw away components with no (valid) self signatures. - Add a test demonstrating this. - Correct the documentation.
2020-04-09openpgp: Make PacketParserResult a std::result::Result.Justus Winter
- This avoids the partial implementation imitating std::option::Option, replacing it with std::result::Result. - As a benefit, std::result::Result is in the prelude, simplifying a lot of parsing loops.
2020-04-09openpgp: Rename PacketParserBuilder::finalize to build.Justus Winter
- Writers should be finalized, builders should be built.
2020-03-31openpgp: Implement Preferences for ValidCert.Neal H. Walfield
- Preferences should be implemented for ValidComponentAmalgamation and ValidCert, not ValidComponentAmalgamation and ValidKeyAmalgamation. - Adjust the Preferences trait since ValidCert doesn't implement ValidAmalgamation.
2020-03-26openpgp: Fix test.Justus Winter
2020-03-13openpgp: Avoid casts.Justus Winter
2020-03-10openpgp: Fix keygrip computation.Justus Winter
- If we strip the opaque encoding marker, preserve any leading zeros. - Fixes #439.
2020-03-09Switch from failure to anyhow.Justus Winter
- Use the anyhow crate instead of failure to implement the dynamic side of our error handling. anyhow::Error derefs to dyn std::error::Error, allowing better interoperability with other stdlib-based error handling libraries. - Fixes #444.
2020-03-03openpgp: Only impl Serialize for objects that are normally exported.Neal H. Walfield
- Add two new traits: `Marshal` and `MarshalInto`. - Implement them instead of `Serialize` and `SerializeInto`. - Only implement `Serialize` and `SerializeInto` for data structures that are normally exported. - This should prevent users from accidentally serializing a bare signature (`Signature`) when they meant to serialize a signature packet (`Packet`), for instance. - Fixes #368.
2020-02-19openpgp: Add test.Justus Winter
- This test demonstrates that we consider binding signatures valid even if the primary key is not marked as certification-capable. - Fixes #321.
2020-02-11openpgp: Enable weak hash algorithms.Justus Winter
- Now that we have the policy trait, we can enable weak hash algorithms. Enable MD5 and RipeMD160. - Add test vectors.
2020-02-07openpgp: Conclude this patch series.Justus Winter
- This patch series adds methods to query key constraints and other key-related signature subpackets to trait Amalgamation. Key-related subpackets are relevant to all components. Recall that primary key constraints may be expressed on userid binding signatures, and that userid components may be stripped off. - We do the same for the key holder's preference packets. These subpackets are not relevant to subkeys, therefore we introduced a new trait Preferences that is implemented for valid componentsand primary keys. - Add the original test case from the bug report. - Fixes #215.
2020-02-06autocrypt: New crate.Justus Winter
- Move the autocrypt-related functionality to a new crate. - Fixes #424.
2020-02-05openpgp: Fix handling of unknown components during canonicalization.Justus Winter
- Previously, signatures following an unknown packet (like a version 3 signature) were attributed to the unknown component. To fix that, try to reorder all signatures on unknown components. If we fail, we put them back where we found them, assuming they are at the correct location on an component unknown to us. - Also split signatures of unknown components. - Add test case.
2020-02-05openpgp: Make Cert::into_packets() and to_vec() agree on sig order.Justus Winter
- The signatures are ordered from authenticated and most important to not authenticated and most likely to be abused. The order is: - Self revocations first. They are authenticated and the most important information. - Self signatures. They are authenticated. - Other signatures. They are not authenticated at this point. - Other revocations. They are not authenticated, and likely not well supported in other implementations, hence the least reliable way of revoking keys and therefore least useful and most likely to be abused.
2020-02-05openpgp: Dump certificate if they do not match.Justus Winter
2019-12-20openpgp: Improve test.Justus Winter
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-18spell "detached" correctlyDaniel Kahn Gillmor
Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2019-11-01openpgp: Fix Transform::read_helper.Neal H. Walfield
- To avoid an infinite loop, we need to not only read data, but also consume it. - Add a regression test. - Fixes #349.
2019-10-09openpgp: Attempt to cope with prefixed armored blocks.Daniel Silverstone
- Add a heuristic to attempt to dearmor blocks which have a prefix such as if they were quoted in an email. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-17openpgp: Add function TPK::primary_userid.Neal H. Walfield
- Returns the TPK's primary User ID. - Also add a variant `TPK::primary_userid_full`, which also returns the primary User ID's binding signature and revocation status.
2019-09-17openpgp: Fix TPK and TPK component revocation handling.Neal H. Walfield
- Consider a TPK, subkey, User ID, or User Attribute to be revoked at time `t` if the most recent revocation certificate that is live at time `t` is younger than the most recent self signature that is live at time `t`. - Further, consider a TPK or a subkey to be revoked at all times if there is a hard revocation (i.e., independent of what time that revocation was created and whether or not the revocation is alive at time `t`).
2019-09-03openpgp: Improve debugging outputNeal H. Walfield
2019-08-29openpgp: Add test vector.Justus Winter
2019-07-15Prepare for Rust 2018.Justus Winter
- This is the result of running `cargo fix --edition`, with some manual adjustments. - The vast majority of changes merely qualify module paths with 'crate::'. - Two instances of adding an anonymous pattern to a trait's function. - `async` is a keyword in Rust 2018, and hence it needs to be escaped (e.g. in the case of the net::r#async module). - The manual adjustments were needed due to various shortcomings of the analysis employed by `cargo fix`, e.g. unexpanded macros, procedural macros, lalrpop grammars.
2019-06-11openpgp: Convert signature s-expressions to mpis::Signature.Justus Winter
2019-06-06openpgp: New type representing s-expressions.Justus Winter
- *S-Expressions* as described in the internet draft [S-Expressions], are a way to communicate cryptographic primitives like keys, signatures, and ciphertexts between agents or implementations. [S-Expressions]: https://people.csail.mit.edu/rivest/Sexp.txt
2019-05-03openpgp: Improve test to also SerializeInto.Justus Winter
2019-04-29openpgp: New TSK type.Justus Winter
- With a1e226f8f1418de43e577fdaa1d087b68bbb09ae in place, we have a more general way to add components to a TPK. Retire the current `TSK` type and replace it with a thin shim that only allows serialization of secret keys. - Fixes #107.
2019-04-24openpgp: Improve test.Justus Winter
2019-04-05openpgp: New test key.Justus Winter