summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-03-04Release 0.15.0.v0.15.0Justus Winter
2020-03-04Update dependencies.Justus Winter
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-03-03openpgp: Add a dedicated README.md.Justus Winter
2020-03-03openpgp: Update documentation.Justus Winter
2020-03-03openpgp: Mark experimental features.Justus Winter
- Fixes #446.
2020-03-01openpgp: Remove KeyBundleIter.Neal H. Walfield
- Since a `KeyAmalgamation` wraps a `KeyBundle` and we can get a `&KeyBundle` from a `KeyAmalgamation`, there is no need to have a `KeyBundleIter`, which iterates over a certificate's key bundles. We can instead just use a `KeyIter` to iterate over a certificate's `KeyAmalgamation`s, and extract the corresponding `KeyBundle` from them. In fact, this is trivial since a `KeyAmalgamation` derefs to a `&KeyBundle`.
2020-03-01oopenpgp: Add a conversion from [u8; 8] to a KeyID.Neal H. Walfield
2020-03-01openpgp: Rename CertAmalgamation to ValidCert.Neal H. Walfield
- A `CertAmalgamation` is more like a `ValidKeyAmalgamation` than a `KeyAmalgamation`: it contains a policy and a reference time. So, add the `Valid` prefix. - Since a `CertAmalgamation` doesn't actually amalgamate anything like a `KeyAmalgamation` (it just contains a back reference to the `Cert`), and we don't have a `CertAmalgamation` data type, remove the `Amalgamation` suffix.
2020-03-01openpgp: Only create a CertAmalgamation if it is valid.Neal H. Walfield
- Change `Cert::with_policy` to only create a `CertAmalgamation` if the certificate is valid for the given policy at the specified reference time. - These semantics match `Amalgamation::with_policy` and `KeyAmalgmation::with_policy`. - Fixes #445.
2020-03-01openpgp: Use a policy to determine what components are valid.Neal H. Walfield
- When generating armor headers, use a policy to determine what components are valid.
2020-03-01openpgp: Avoid unnecessary liveness check.Neal H. Walfield
- A binding signature is only returned if it is alive at time `t`. Don't check again.
2020-03-01autocrypt: When creating an Autocrypt header, use valid data.Neal H. Walfield
- When creating an Autocrypt header, make sure the components are valid according to the policy and not revoked, and include the current valid binding signature, not the newest one, whose creation time may be in the future.
2020-03-01openpgp: Also add KeyIter::subkeys to ValidKeyIter.Neal H. Walfield
- Add an equivalent method to `KeyIter::subkeys` to `ValidKeyIter`.
2020-03-01openpgp: Change KeyIter::subkeys' return type.Neal H. Walfield
- Change `KeyIter::subkeys` to return a `SubordinateKeyAmalgamation` instead of a `KeyBundle`. - Remove `KeyIter::skip_primary`. It does the samething as `KeyIter::subkeys`, but `KeyIter::subkeys` has a more accurate type.
2020-03-01openpgp: Add additional conversions for {,Valid}KeyAmalgamation.Neal H. Walfield
- Add additional conversion functions for ValidKeyAmalgamation and KeyAmalgamation to simultaneously convert the parts and erase the role. - We can't use a blanket conversion, because converting a `KeyAmaglamation` with public or unspecified parts to one with secret parts is not infallible.
2020-03-01openpgp: Add a function to unwrap a ValidKeyAmgalamtion.Neal H. Walfield
- Add a method to explicitly return the `KeyAmgalamtion` wrapped by a `ValidKeyAmgalamtion`. - Although this is possible using `into`, an explicit function makes it easy to do a second conversion, e.g., a change to the `KeyAmgalamtion`'s parts or role. Using two `into`s in a row is not possible. Instead, an intermediate variable with an explicit type is needed, which is less ergonomic.
2020-02-28openpgp: Implement Iterator for more variants of {,Valid}KeyIter.Neal H. Walfield
- Implement `Iterator` on KeyIter and ValidKeyIter for the cross product of {Primary, Subordinate, Unspecified} and {Public, Secret, Unspecified}.
2020-02-28openpgp: Generalize TryFrom<{,Valid}ErasedKeyAmalgamation>.Neal H. Walfield
- Generalize `TryFrom<ErasedKeyAmalgamation>` and `TryFrom<ValidErasedKeyAmalgamation>` to convert not only the `KeyAmalgamation`'s role, but also its parts (i.e., between `PublicParts`, `SecretParts`, and `UnspecifiedParts`).
2020-02-27openpgp: Make KeyIter and ValidKeyIter generic over the key's role.Neal H. Walfield
2020-02-26openpgp: Improve documentation.Neal H. Walfield
2020-02-26openpgp: Remove unnecessary use of .mark_role_primary{,_ref}().Neal H. Walfield
2020-02-26openpgp: Don't unnecessarily use ComponentAmalgamation::bundle.Neal H. Walfield
- A `ComponentAmalgamation` derefs to a `ComponentBundle`. Don't use `ComponentAmalgamation::bundle` if it is unnecessary and doesn't improve legibility.
2020-02-26openpgp: Complete the binding -> bundle rename.Neal H. Walfield
- Started in d183e12a3231e4c505f5f2cf48b6c1f881ad258a.
2020-02-26openpgp: Clean up exports.Neal H. Walfield
- Slightly reduce the number of reexports in `cert::components`. - Make `cert::amalgamation` public.
2020-02-26openpgp: Rework KeyAmalgamation to preserve the key's role.Neal H. Walfield
- Introduce three KeyAmalgamation variants: `PrimaryKeyAmalgamation`, `SubordinateKeyAmalgamation`, and `ErasedKeyAmalgamation`. - Unlike a `Key` or a `KeyBundle` with an `UnspecifiedRole`, an `ErasedKeyAmalgamation` remembers its role. This means that an `ErasedKeyAmalgamation` can implement the correct semantics even though the role marker has been erased (hence the name). - Have `Cert::keys` return `ErasedKeyAmalgamation`s. Recall: `Cert::keys` can't return a more specific type, because it returns an iterator that can contain both primary and subordinate keys. - We use a concrete type instead of a trait object so that when the user converts a `KeyAmalgamation` to a `ValidKeyAmalgamation` (via `with_policy`), the `ValidKeyAmalgamation` retains the type information about the `KeyAmalgamation`'s role. - Preserving this type information increases type safety for users of this API.
2020-02-26openpgp: Fix macro.Neal H. Walfield
2020-02-26openpgp: Use a slightly less ambiguous name.Neal H. Walfield
2020-02-26openpgp: Fix lifetime.Neal H. Walfield
- The reference returned by `ComponentAmalgamation::userid` and `ComponentAmalgamation::user_attribute` is bound by the reference to the `Component` in the `ComponentAmalgamation`, not the `ComponentAmalgamation` itself. - This matters, for instance, for: cert.userids().map(|ua| ua.userid())
2020-02-26openpgp: Fix spelling.Neal H. Walfield
2020-02-26openpgp: Fix clone.Neal H. Walfield
- derive(Clone) doesn't work with generic parameters that don't implement clone. - In the case of ComponentAmalgamation and ValidComponentAmalgamation, we don't need to require that their generic parameter implements Clone, because we're not cloning C, just the reference. See https://github.com/rust-lang/rust/issues/26925 .
2020-02-26openpgp: Make ComponentAmalgamation implement PartialEq.Neal H. Walfield
2020-02-26openpgp: Add a prelude file to import things related to certificatesNeal H. Walfield
- Add `openpgp/src/cert/prelude.rs` to import most types and traits related to certificates. - Use it instead of using the types and traits individually.
2020-02-26openpgp: Reorder code.Neal H. Walfield
- Define the trait before we use it.
2020-02-25openpgp: Drop XXX.Justus Winter
- We don't have to reset the `content_was_read` flag here: In PacketParser::next() we either return an error, EOF or a new PacketParser, which will have the flag cleared anyway. - Fixes #410.
2020-02-24openpgp: Clarify field documentation.Justus Winter
2020-02-24openpgp: Improve protection of unencrypted key material.Justus Winter
2020-02-24openpgp: Return a more appropriate error.Justus Winter
2020-02-24openpgp: Drop XXX.Justus Winter
- Error::MalformedPacket seems appropriate.
2020-02-24openpgp: Drop XXX.Justus Winter
- We no longer use that crate.
2020-02-24openpgp: Open issue for XXX.Justus Winter
- Opened #441.
2020-02-24openpgp: De-optimize crypto::random.Justus Winter
- Previously, we used a thread-local cache of the Yarrow CPRNG state. However, without fork(2)-detection this is not safe. For now, just initialize a fresh one on every invocation.
2020-02-24openpgp: Test that StandardPolicy can be a global const.Justus Winter
2020-02-24openpgp: Check critical notations against good-list.Justus Winter
- See #274.
2020-02-24openpgp: Extend StandardPolicy to check critical subpackets.Justus Winter
2020-02-24openpgp: Add missing docs.Justus Winter
2020-02-24openpgp: Implement Display for SubpacketTag.Justus Winter
2020-02-24openpgp: Fix EdDSA key generation.Justus Winter
- Fixes #437.
2020-02-24openpgp: Fix link in documentation.Justus Winter
2020-02-21openpgp: Change default hash algorithm to SHA512.Justus Winter
- SHA512 is almost twice as fast as SHA256 on 64-bit architectures because it operates on 64-bit words.