summaryrefslogtreecommitdiffstats
path: root/tool/src/commands/decrypt.rs
AgeCommit message (Collapse)Author
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-02-18openpgp: Improve tracking of secret keys.Justus Winter
- We use marker traits to track with the type system if a Key has secret key material attached. Previously, it was possible to subvert that by taking the secret key material using Key4::set_secret, creating a Key4<SecretParts, ..> without any secrets. - Related, the accessor functions returned an Option<SecretKeyMaterial> even for Key4<SecretParts, ..>. - Replace set_secret by add_secret and take_secret that also change the Key's type accordingly. Make the accessors infallible if we know we have a secret key, rename Key4<P, R>::secret to Key4<P, R>::optional_secret to make the distinction clear. - Fixes #435.
2020-02-12openpgp: Add optional cipher argument to DecryptionHelper::decrypt.Justus Winter
2020-02-12openpgp: Add optional cipher argument to PKESK3::decrypt.Justus Winter
2020-02-06openpgp: Rename methods 'set_policy' to 'with_policy'.Justus Winter
- Fixes #427.
2020-01-31openpgp: Add a policy object.Neal H. Walfield
- Change all functions that need to evaluate the validity of a signature (either directly or indirectly to take a policy object. - Use the policy object to allow the user to place additional constraints on a signature's validity. - This addresses the first half of #274 (it introduces the policy object, but does not yet implement any policy).
2020-01-22openpgp: Rework default component lookup functions.Justus Winter
2020-01-20openpgp: Use the new framework for Cert::userid.Justus Winter
- Fixes #414.
2020-01-18openpgp: Use Cert::keys instead of Cert::subkeys.Justus Winter
2020-01-10openpgp: Pass MessageStructure by value, not reference.Neal H. Walfield
- Instead of passing MessageStructure to VerificationHelper::check by reference, pass it by value. - After calling VerificationHelper::check, it is dropped. Passing it by value allows the caller to avoid some cloning.
2019-12-18openpgp: Make type aliases for keys pub(crate).Justus Winter
- They can still be used as a convenience, but the documentation will refer to them as their expanded counterparts. - This makes the structure of they Key<_, _> type more visible.
2019-12-12tool: Prefer crossterm library over termsize.Igor Matuszewski
- This allows us to get rid of another dependency that uses winapi 0.2, the last being mio 0.6 (0.7 is not yet released). In terms of linkage we still should only link to what we use - no new Windows API usage introduced here.
2019-12-06tool: Add packet decrypt that unwraps encryption containers.Justus Winter
2019-12-05openpgp: Make crypto::{Signer,Decryptor} non-polymorphic.Justus Winter
- These are low-level cryptographic traits that are not concerned with the role of a key. - Fixes #382.
2019-12-04openpgp: Rename KeyFlag's accessors.Justus Winter
- Fixes #359.
2019-12-03openpgp: Rename openpgp::conversions to openpgp::fmt.Justus Winter
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-27openpgp: Fix issuer handling in the streaming verifier.Justus Winter
- To that end, make VerificationHelper::get_public_keys take KeyHandles for all the issuers.
2019-11-26openpgp: Implement From<Fingerprint> for KeyID.Justus Winter
- Remove Fingerprint::to_keyid, use From instead.
2019-11-25openpgp: Rename openpgp::constants to openpgp::types.Justus Winter
- Fixes #381.
2019-09-27linting: Clear up bare trait object warningsDaniel Silverstone
Newer Rust compilers requre `dyn` marking trait objects. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
2019-09-18openpgp: Change TPK::primary to return the key and not the bindingNeal H. Walfield
- The primary key is not a binding; it is a single component. Thus, returning a ComponentBinding is misleading. - Add methods to the TPK structure to return the direct signatures, certifications, self revocations, and other revocations.
2019-09-18store: Rename store::Store to Mapping.Justus Winter
- Fixes #88.
2019-09-17openpgp: Change TPK::primary_key_signature to take a time.Neal H. Walfield
- Change `TPK::primary_key_signature` and `TPK::primary_key_signature_full` to take an additional parameter, a time. - Return the primary key signature at that time rather than the newest primary key signature.
2019-09-17openpgp: Add a timestamp arg to ComponentBinding::binding_signatureNeal H. Walfield
- Change ComponentBinding::binding_signature to take an optional timestamp and return the self signature that is active at that time.
2019-09-06tool: Support decrypting messages with wildcard recipients.Justus Winter
2019-09-06tool: Rework decryption.Justus Winter
- Decrypt encrypted keys in-place, so that we will never prompt twice for the same key. Rework for clarity.
2019-08-23openpgp: Use marker types to denote a Key's type.Neal H. Walfield
- In addition to providing some added protection, this allows us to implement 'From<Key<_, _>> for Packet'.
2019-08-23openpgp: Use a KeyBinding to store the primary key binding in a TPKNeal H. Walfield
2019-08-23openpgp: Rename SubkeyBinding to KeyBinding.Neal H. Walfield
- Also rename the `subkey` method to `key`.
2019-08-23openpgp: Rename SecretKey to SecretKeyMaterial.Neal H. Walfield
- When the `SecretKey` type only refers to the secret key material and not a TPK-like thing, call it `SecretKeyMaterial`.
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-24openpgp, tool: Fix decryption.Justus Winter
- Try to decrypt all PKESKs, not just the first one.
2019-05-30openpgp: Make PKESK::decrypt use crypto::Decryptor.Justus Winter
2019-05-09openpgp: Communicate message structure from the decryptor.Justus Winter
- Fixes #100.
2019-04-12tool: Indent based on the terminal size.Justus Winter
2019-04-12tool: Improve packet dumper.Justus Winter
- Indent the hexdumps, but don't exceed a target width.
2019-04-09tool: Don't ask the user to decrypt a key we don't support.Justus Winter
2019-04-09tool: Fix error handling when decrypting using encrypted keys.Justus Winter
- Fixes #241.
2019-04-09openpgp: Guard signature verifications with a time.Justus Winter
- In the streaming verifier and decryptor, check that signatures (and binding signatures) are valid at the given time. - Fixes #247.
2019-03-26tool: Read passwords from the tty.Justus Winter
- Fixes #24.
2019-03-25tool: Dump session keys.Justus Winter
2019-03-25openpgp: Rework the DecryptionHelper trait.Justus Winter
- Simplify the protocol by removing the iteration. Instead, the callee gets a proxy for PacketParser::decrypt() that she can use to decrypt the message. If successful, the session key can be cached without involving the DecryptionHelper trait. This also allows us to dump session keys. - Fixes #219.
2018-12-12openpgp: Move SecretKey to packet::key.Justus Winter
2018-12-07openpgp: Make PacketParser's header field private.Justus Winter
2018-12-07openpgp: Make PacketParser's map field private.Justus Winter
2018-11-24Rename the openpgp crate to sequoia-openpgp.Justus Winter
2018-10-09openpgp: Drop redundant recursive_depth field.Neal H. Walfield
- The packet parser's recursive depth can be computed from the path, which we now track. As such, don't track the recursive depth separately, just derive it from the path.
2018-10-06tool: Dump output belongs on stderr.Neal H. Walfield
- decrypt called dumper.flush() with the same output destination as that used for the decrypted data. But, the output of dump belongs on stderr.
2018-09-28openpgp: Check intended recipients in the decryptor.Justus Winter
- Fixes #111.