summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2020-08-05openpgp: Don't implement Default for the Bitflags types.Justus Winter
- See #525.
2020-08-05openpgp: Fix documentation.Justus Winter
2020-08-04openpgp: Improve documentation for crypto::random.Justus Winter
- See #474.
2020-08-04openpgp: Improve documentation.Justus Winter
- See #474.
2020-08-04openpgp: Improve documentation of mod asymmetric.Justus Winter
- See #474.
2020-08-04sq: Remove superfluous use.Justus Winter
2020-08-04openpgp: Fix documentation.Justus Winter
2020-08-03openpgp: Remove SignatureBuilder::set_key_expiration_time.Neal H. Walfield
- Internally, we work with relative times, not absolute times. - Working with absolute times is error prone: when setting the key expiration should it be relative to the current value of the Signature Creation subpacket or the one when the SignatureBuilder is finalized? - Just remove `SignatureBuilder::set_key_expiration_time.`
2020-08-03openpgp: Change CertBuilder to use a relative expiration time.Neal H. Walfield
- `CertBuilder::set_expiration_time` takes an absolute time. - Most callers use a relative time. - Internally, we need a relative time (that's what the Key Expiration Time packet takes). - Converting the absolute time to a relative time is error prone: should it be relative to the creation time when called or when `CertBuilder` is finalized? - KISS: Change it to just take a relative time. - To better reflect the new semantics, also change the name to `CertBuilder::set_validity_period`.
2020-08-03openpgp: Add a getter to CertBuilder to return the creation time.Neal H. Walfield
- Add a getter to `CertBuilder` to return the configured creation time. - This is useful when gradually building up a `CertBuilder` and you want to set an absolute expiration time.
2020-08-03openpgp: Simplify code.Neal H. Walfield
- Instead of computing the hash manually and then calling `SignatureBuilder::sign_hash`, use the appropriate signing function, `SignatureBuilder::sign_direct_key`, `SignatureBuilder::sign_userid_binding` or `SignatureBuilder::sign_subkey_binding`.
2020-08-03openpgp: Don't use doc comments with macros.Neal H. Walfield
- rustc 1.43 considers this an error.
2020-07-31Release 0.18.0.v0.18.0Justus Winter
2020-07-31openpgp: Make it easier to add an Intended Recipient.Neal H. Walfield
- `SignatureBuilder::set_intended_recipients` sets multiple Intended Recipient subpackets at once. However, if we want to build the intended recipients gradually, it is not appropriate: it first clears any existing Intended Recipient subpackets. - Add `SignatureBuilder::add_intended_recipient` to add an Intended Recipient subpacket without first clearing any existing Intended Recipient subpackets.
2020-07-31openpgp: Add variants to SignatureBuilder to add issuer subpackets.Neal H. Walfield
- `SignatureBuilder::set_issuer` and `SignatureBuilder::set_issuer_fingerprint` first clear the unhashed area of any existing Issuer or Issuer Fingerprint subpackets, respectively. - Add a variant to add an additional Issuer or Issuer Fingerprint subpacket.
2020-07-31openpgp: Improve the introduction of module crypto.Justus Winter
- See #474.
2020-07-31openpgp: Improve documentation of crypto::mpi.Justus Winter
- See #474.
2020-07-31openpgp: Improve comparing secret key material.Justus Winter
- Do not explicitly shortcut the iteration by using fold instead of find.
2020-07-31openpgp: Use ProtectedMPI::cmp instead of secure_mpi_cmp.Justus Winter
2020-07-31crypto: Implement (Partial)Ord, (Partial)Eq for ProtectedMPI.Justus Winter
2020-07-31openpgp: Rename MPI::new_weierstrass to MPI::new_point.Justus Winter
2020-07-31openpgp: Add and use MPI::new_compressed_point.Justus Winter
2020-07-31openpgp: Fix documentation.Justus Winter
- encrypt_shared is also used by the ECDH over NIST curves.
2020-07-31openpgp: Improve documentation of crypto::mem.Justus Winter
- See #474.
2020-07-31openpgp: Improve documentation of crypto::Password.Justus Winter
- See #474.
2020-07-31openpgp: Improve documentation of crypto::SessionKey.Justus Winter
- See #474.
2020-07-31openpgp: Improve documentation of crypto::hash.Justus Winter
- See #474.
2020-07-31openpgp: Fix the type of OPS packets.Justus Winter
- Use the type from the template instead of hardcoding it to binary.
2020-07-31Update README.md.Justus Winter
2020-07-31openpgp: Remove SignatureBuilder::set_signature_expiration_time.Neal H. Walfield
- `SignatureBuilder::set_signature_expiration_time` takes an absolute time and converts it to a duration relative to the `Signature Creation Time` subpacket. - Since we sometimes set the `Signature Creation Time` subpacket lazily, this should probably also be set lazily. - But that makes the `SignatureBuilder` more complicated. And, it means that `SignatureBuilder::modify_hashed_area`'s behavior is more complicated. - Instead of adding complexity, only provide the `SignatureBuilder::set_signature_validity_period` method, which is what is appears to be needed in practice.
2020-07-31openpgp: Improve SignatureBuilder's API.Neal H. Walfield
- Most of the setters do not take an `Option` where `None` means remove the subpacket. There is no particular reason that set_signature_validity_period or set_signature_expiration_time should either. So, don't. - Don't take a bare `time::Duration` or `time::SystemTime`, but anything that implements `Into<time::Duration>` or `Into<time::SystemTime>`.
2020-07-29openpgp: Move some ECDH helper functions to backend-agnostic moduleIgor Matuszewski
2020-07-29openpgp: Allow modifying subpacket areas using a builder-style API.Neal H. Walfield
- For the most part, `SignatureBuilder` provides a builder-style API. - Adding custom subpackets requires working with a mutable reference to a subpacket area, which is jarring: let mut builder = SignatureBuilder::new(SignatureType::Binary) // Build up the signature. ; builder.unhashed_area_mut().add(Subpacket::new( SubpacketValue::Unknown { tag: SubpacketTag::Private(61), body: [ 0x6D, 0x6F, 0x6F ].to_vec(), }, true)?)?; let sig = builder.sign_message(&mut signer, msg)?; - Provide a function to allow the user to work with subpacket areas using a builder-style interface.
2020-07-29openpgp: Derive PartialOrd and Ord for SubpacketTag.Neal H. Walfield
- It's useful to get a deduplicated list of all subpacket tags in a subpacket area. For this, we need `Ord`.
2020-07-29openpgp: Add a conversion from Signature to Signature4.Neal H. Walfield
- Implement `TryFrom<Signature>` for `Signature4`.
2020-07-29openpgp: Make Cert::from_packets fail on additional input.Justus Winter
- Previously, Cert::TryFrom<PacketParserResult> expected the packet sequence to contain exactly one certificate. If it finds anything else, it fails. On the other hand, Cert::from_packet (and therefore also Cert::TryFrom<Vec<Packet>> and TryFrom<PacketPile>) expected the packet sequence to start with a certificate. If it contains additional certificates or invalid packets, those were silently ignored. - Harmonize the behavior by changing Cert::from_packet (and therefore also Cert::TryFrom<Vec<Packet>> and TryFrom<PacketPile>) to behave like Cert::TryFrom<PacketParserResult> and fail if the certificate is followed by any more packets. - Fixes #504.
2020-07-28openpgp: Explicitly handle plaintexts being too large.Justus Winter
- Fixes undefined behavior (a likely crash) in pkcs5_pad.
2020-07-28openpgp: Reimplement the KeyFlags struct using Bitfield.Justus Winter
- This also drops the implementation of PartialOrd since we did not use it in the key selection after all. - Fixes #525.
2020-07-28openpgp: Reimplement the KeyServerPreferences struct using Bitfield.Justus Winter
- Also improve the documentation of the KSP::no_modify and the corresponding setters. - See #525.
2020-07-28openpgp: Rename Features::check to Features::get.Justus Winter
2020-07-28openpgp: Extract the Bitfield type from struct Features.Justus Winter
2020-07-28openpgp: Derive Eq, Hash for Features.Justus Winter
2020-07-27openpgp: Document parse::Dearmor.Justus Winter
- Fixes #471.
2020-07-27openpgp: Avoid monomorphization of generic_serialize_into.Justus Winter
2020-07-24openpgp: Improve documentation of PacketParserResult.Justus Winter
- See #471.
2020-07-24openpgp: Improve PacketParserResult::as_ref, as_mut, and map.Justus Winter
- Previously, these method withheld information in the EOF case (and in case of `map` this loss is irrecoverable). Fix this by returning a Result instead.
2020-07-24openpgp: Don't mention private type in documentation.Justus Winter
- See #471.
2020-07-24openpgp: Add links to the documentation.Justus Winter
- See #471.
2020-07-24openpgp: Clarify what happens when verifying detached signatures.Justus Winter
- See #471.
2020-07-24openpgp: Improve documentation of enum MessageLayer.Justus Winter
- See #471.