summaryrefslogtreecommitdiffstats
path: root/tool
AgeCommit message (Collapse)Author
2018-07-10tool: Use the new type.Justus Winter
- Fixes 9ce7ed2c8f53ece40b7f48d5cb9e7e06e80524e3.
2018-07-10openpgp: Use broken-down time in the literal data packet.Justus Winter
- Also, make the `date` argument in the LiteralWriter's constructor optional, and explain what the parameters are for.
2018-07-02tool: Emit armored data by default.Justus Winter
2018-07-02openpgp: Create a special Option-like type for PacketParser.Neal H. Walfield
- In the future, we want to return some summary information about a parsed packet sequence after the packet sequence is fully parsed. Currently, PacketParser::next() and PacketParser::recurse() consume the PacketParser and return None on EOF. Thus, even if the summary information were stored in the PacketParser, it becomes inaccessible on EOF. - This change introduces a new type, PacketParserResult, that contains either a PacketParser or a PacketParserEOF. PacketParserEOF is returned on EOF instead of None. Since it is a struct, it can hold only any information that we want to return to the caller.
2018-06-28tool: Add a test for the bug fixed in 1d63e71.Neal H. Walfield
2018-06-27tools: Make sqv check that a validated TPK is really wanted.Neal H. Walfield
- sqv only checked whether an *unvalidated* TPK was wanted; it needs to double-check that this is really the case after validating the TPK. Consider the case where key X is needed to validate a signature and the keyring contains two keys: Mallory's and Alice's, and both have key X as a subkey, but the back-sig is only valid for Alice's key. The current code will use Mallory's key, and the signature validation will fail. If we had double checked, then we'd have discarded Mallory's key, and correctly used Alice's. - To fix this problem, this commit changes the code to use the new TPKParser::unvalidated_tpk_filter, which is not only simpler to use, but takes care of this double checking.
2018-06-25openpgp: Generalize `hash_file`.Justus Winter
- Instead of giving it a path, just give it a reader. Adjust call site.
2018-06-25openpgp: Add support for parsing Autocrypt headers.Neal H. Walfield
- Also implement 'sq autocrypt decode' to convert an autocrypt header to an OpenPGP key.
2018-06-20Consistently call passwords password, not passwd or passphrase.Justus Winter
2018-06-14openpgp: Move Tag into the packet module.Justus Winter
2018-06-13openpgp: Rename Message to PacketPileNeal H. Walfield
- RFC 4880 defines an OpenPGP message to be a sequence of packets with a particular structure (Section 11.3; https://tools.ietf.org/html/rfc4880#section-11.3). Since there is no term for an unstructured sequence of packets, we invent one.
2018-06-11openpgp: Do not re-export *Algorithm in the root.Justus Winter
2018-06-06tool: Provide nicer error messages.Justus Winter
2018-06-06tool: Implement 'split' subcommand to split OpenPGP messages.Justus Winter
2018-06-06openpgp: Avoid making BufferedReader part of our public APINeal H. Walfield
- The `BufferedReader` trait is primarily an implementation detail. Thus, we avoid exporting Foo::from_buffered_reader constructors, and making public structures generic over `BufferedReader`.
2018-05-31tool: Implement encryption subcommand.Justus Winter
2018-05-31tool: Change store selection.Justus Winter
- Make --store a top-level flag, and give it the default 'default'.
2018-05-31tool: Improve decryption command.Justus Winter
- When hex-dumping, add a newline before the hex dump. - Process PKESK and SKESK packets after the call to 'recurse()' avoiding the clone.
2018-05-29tool: Transparently handle armored data.Justus Winter
2018-05-28openpgp: Encrypt with n passphrases.Justus Winter
- Also support decryption with any SKESK in sq.
2018-05-17openpgp: Rename HashAlgo to HashAlgorithm.Neal H. Walfield
- Make the naming consistent.
2018-05-14tool: Tweak 'sqv's flag handling.Justus Winter
- Clarify that multiple keyrings can be given, but only accept one per '--keyring' argument. This lets us use the '--keyring' argument in the front. - Simplify by removing superfluous configurations.
2018-05-14tool: Bump dependency.Justus Winter
2018-05-11tool: Generalize usage generation and document 'sqv'.Justus Winter
2018-05-11tool: Allow hex-dumping when decrypting data.Justus Winter
2018-05-03tool: Extend dump to write hexdumps with maps.Justus Winter
2018-05-03tool: Move the decryption command to a new file.Justus Winter
2018-05-03tool: Remove debugging remnant.Justus Winter
2018-05-03tool: Remove superfluous macro_use.Justus Winter
2018-05-03tool: Improve sqv.Justus Winter
- Canonicalizing TPKs turned out to be quite expensive, even though we do not check binding signatures at this point. If we want sqv to be a drop-in replacement for gpgv, it needs to be able to handle keyrings with a similar performance. - This patch builds and canonicalizes TPKs iff we actually need them, resulting in a performance similar to gpgv.
2018-05-01tool: Add new tool, sqv.Neal H. Walfield
2018-04-23openpgp: Enums for various alogrithmsKai Michaelis
Adds enums for cryptographic and compression algorithms. Functions that operate on algo identifiers are now member functions (hash_context -> HashAlgo::context()). The identifiers support convertions from and to u8 as well as Display.
2018-03-26tool: Add decryption subcommand.Justus Winter
- Add support for decrypting messages. For now, only symmetrically encrypted messages are supported.
2018-03-26tool: Rework indentation.Justus Winter
2018-03-26tool: Create completion scripts for bash and fish.Justus Winter
2018-03-26tool: Move command line parser to its own file.Justus Winter
2018-03-26tool: Add missing usage documentation.Justus Winter
2018-03-23openpgp: Move the TPK type definition to openpgp proper.Justus Winter
- We define all types in the root of the openpgp crate, and their implementations in separate modules. This makes using these types much simpler, yet keeps the root from getting too crowded. - Also fix all users accordingly.
2018-02-06tool: Improve log display.Justus Winter
- Do not provide slug when listing entries related to a specific binding.
2018-01-23Use the failure crate to handle errors.Justus Winter
- The failure crate is a young error handling solution for Rust. It may change the API, but since we pin our dependencies, this should not be a problem for us, albeit a bit inconvenient. - Introduction of the crate is a bit noisy, but not as bad as anticipated, because failure magically handles all errors used in the standard library. - Matching on concrete error values requires downcasting before matching, which seems a bit unidiomatic. This is the cost of using and "chaining" arbitrary error types. This is something that may be improved later on in the library or language. - Having said that, using the error type in the tool was nice. I did not have to use a downcast, so maybe my worries about downcasts are unjustified because it is not such a common use case after all. On the other hand, the tool is quite simple and our only mode of failure is to print the message.
2018-01-18store: Return tuples from iterators.Justus Winter
- Replace StoreIterItem, BindingIterItem, and KeyIterItem with tuples. - Remove binding counts from the items. If such information is needed, an RPC should be introduced. - Update all callers.
2018-01-18store: Use time::Timespec and fix stats.Justus Winter
- Use time::Timespec instead of std::time::SystemTime in the API. - Record timestamps of encryptions and verifications. - Adapt the tool.
2018-01-18store,tool: Improve logging framework.Justus Winter
- Move store::backend to its own directory, so that we can put the store::backend::log module in its own file. - Implement iterators for retrieving log messages related to stores, bindings, and keys. - Use loose coupling of logs and other entities, so that we can delete either without worrying about the other. - Add commands to the tool to retrieve logs.
2018-01-17store: Periodically update keys from the network.Justus Winter
- Update all keys stored in a store with network policy 'encrypted' and 'insecure' periodically using the SKS keyserver pool. - Slightly amend the net::ipc interface so that servers can spawn futures on the reactor. - As a background service cannot directly communicate failures, this patch adds a logging mechanism. - In sq, display the key update timestamp, and the status of the last update.
2018-01-14openpgp: Remove the openpgp/types moduleNeal H. Walfield
- It only contains a KeyId type which is redundant relative to KeyID and it is buggy (e.g., when it converts a Key ID to hex, it drops any leading zeros). - Update users to use KeyID instead.
2018-01-11store: Implement iteration over stores, bindings, and keys.Justus Winter
- Also add corresponding commands to the tool.
2018-01-10store: Implement store and binding deletion.Justus Winter
- Also add commands in the tool.
2018-01-10store: Do not require mutable references to the store.Justus Winter
- The only mutable reference that we need is to the reactor core, which we store in a RefCell anyway. Requiring mutable references makes using the store very awkward, because the borrow checker works on lexical scopes, not dynamic scopes.
2018-01-09tool: Add key store commands.Justus Winter
- Add commands to add, import, export keys, and to get binding and key stats.
2018-01-04tool: Implement keyserver interactions.Justus Winter
- Implement retrieving and sending keys. - Improve usage generation to include nested subcommands.