summaryrefslogtreecommitdiffstats
path: root/tool/src/commands/sign.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-05sq: Fix handling of armored writers.Justus Winter
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-17tool: Add an option to specify the signing time.Neal H. Walfield
- Add the option `--time` to the `sign` and `encrypt` subcommands to allow the user to set the signature's creation time. - Use the value of this option to select the signing keys.
2019-11-28Call TPKs Certificates, update identifiers, documentation.Justus Winter
- Fixes #387.
2019-11-21openpgp: Replace time crate with std::time.Justus Winter
- In sq and sqv, use chrono to interface with the user. - Fixes #341.
2019-11-19openpgp: Use the builder pattern for stream::LiteralWriter.Justus Winter
- See #375.
2019-11-19openpgp: Use the builder pattern for stream::Signer.Justus Winter
- See #375.
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-10openpgp: Make 'LiteralWriter::new's arguments optional.Justus Winter
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-07-15Make more variables immutable.Justus Winter
- With the MIR-based borrow-checker being more precise than the AST-based one, we can make more variables immutable.
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-05-22openpgp: Trait Serialize/Parse cleanup.Justus Winter
- Currently, when we serialize a packet structure, like Signature, we get a full packet with CTB and length, even though we didn't really ask for that. If we want to create an embedded signature, we need to use the special interface Signature::serialize_naked() to get it without frame. - Also consider Key. Here, we don't know whether it is supposed to be primary or subkey, or public or secret. Therefore, we have SerializeKey, which is like Serialize, but also gets a tag. Now, if Key::serialize() would only emit the body, it wouldn't need to know what kind of key to emit. - The same applies to trait Parse. If we use, say, Signature::from_bytes(), the parser expects a framed signature. If we want to parse an embedded signature, we need to use a special interface again. - This patch changes how we parse and serialize packet structures to not expect or emit the frame. If we want to include the frame, we need to explicitly wrap it into an enum Packet. - This patch does not include any cleanups and optimizations to keep the size manageable. - See #255.
2019-05-11openpgp: Make {is,possible}_{message,keyring,tpk} return a ResultNeal H. Walfield
- PacketParserEOF::is_message, PacketParserEOF::is_keyring, PacketParserEOF::is_tpk, PacketParserResult::possible_message, PacketParserResult::possible_keyring, and PacketParserResult::possible_tpk returned a boolean. - Change them to return a Result<()> instead, which is more Rusty, and, in particular, allows the caller to determine why the message didn't parse.
2019-03-26openpgp: Add enum Signature.Justus Winter
- See #228.
2019-03-18openpgp: Make hash algorithm configurable in streaming Signer.Justus Winter
- See #208.
2019-01-15openpgp: Hand a Vec<crypto::Signer> to stream::Signer.Justus Winter
- Using `crypto::Signer`s has several benefits. First, it shifts the decision which key to use to the caller, moving policy out of the caller. Second, it forces the caller to deal with encrypted keys. Finally, it allows us to use remote keys like smart cards in the future. - Fixes #142.
2018-12-18tool: Move the signing code to a new module.Justus Winter