summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2022-06-08sq: Gracefully handle malformed certs in keyring list.Justus Winter
- Fixes #834.
2022-06-08openpgp: Accept unknown packets in production rules.Justus Winter
- We validate certificate structures based on packet tags. In the past, this lead to problems where a secret key packet was parsed to an unknown packet because the secret bits were malformed. This lead to a crash in the generated parser because it was assuming to see a secret key packet, but got an unknown packet. - This was changed in cd5eb82edfb326d7cbde29ee105f9f88e045c240 so that we validate the certificate structure based on packet kinds, i.e. we would only consider a packet a secret key packet if we managed to parse it into one. However, this caused the parser to be overly strict, causing problems with forward compatibility, and the parser to return an Error::MalformedCert instead of an Error::UnsupportedCert (see #170). - Return to validating on packet tags, but make the parser code aware that we may have parsed some packets (like secret key packets) to unknown packets. - This effectively reverts commit cd5eb82edfb326d7cbde29ee105f9f88e045c240. - Fixes #170.
2022-06-08openpgp: Implement TryFrom<Packet> for Unknown.Justus Winter
2022-06-07openpgp: Fix comment.Heiko Schaefer
2022-06-07openpgp: Clarify error message.Heiko Schaefer
- Fixes #587
2022-05-23openpgp: Release 1.9.0.openpgp/v1.9.0Justus Winter
2022-05-23ipc, openpgp: Reduce features of dependency lalrpop.Nora Widdecke
- lalpop v0.19 a default features we do not use, we should not build them, either. - lalrpop v0.17, which we allow for Debian's benefit, does not have any explicit features. In this case, stating "default-features = false" in Cargo.toml does not hurt.
2022-05-20openpgp: Add missing forwarder.Justus Winter
- Fixes inspecting of packets during signature verification.
2022-05-16sq: Add logging for shell completions.Nora Widdecke
- Output a cargo:warning with paths for generated shell completion files, or a warning if generation failed.
2022-05-16sq: Port command line handling from clap 2 to 3.Nora Widdecke
Change sq command line handling from using clap version 2 to version 3, and adapt to all the breaking changes. Clap version 3 is a major new version with a number of breaking changes. It also adds functionality to allow a structopt style declarative way of defining command line syntax. We want to use that, but first we need to port the old "builder style" of defining the command line syntax to clap version 3. The change to use the "derive style" comes later. The semantics of clap version 2's .multiple function were hard to understand and it was replaced with .multiple_occurences. Care was taken to preserve the original intention regarding an argument's number of occurrences and number of values. There are some changes to help output (in src/sq-usage.rs). These are mostly from upstream changes and we think the differences are minor so we are okay with following upstream's lead. In summary: FLAGS and OPTIONS are merged into just OPTIONS; the layout of subcommand lists are a little different (split into two lines); there is no "[--]" before filename arguments anymore; default and allowed values for options are on a separate line now; --version isn't repeated for every subcommand anymore; help is listed for each subcommand separately. In addition, we will help clap upstream fix a problem where the help output doesn't have a "..." to indicate that an option may be used several times. Further, upstream has changed --help text to be of the form "Print help", when it earlier was "Prints help". We will change our own help texts to follow suite in a future commit. We don't do it in this commit, to avoid making an even larger diff. By default, clap v3 now colors its help output. However, this does not support custom sections like our examples. Clap is tracking this as https://github.com/clap-rs/clap/issues/3108. In the meantime, disable colors.
2022-05-13sq: Fix subplot scenario.Nora Widdecke
- The subplot scenario "File is signed with all required keys" has a mistake, it uses a wrong argument, `--signer-key` instead of `--signer-cert`. - The issue was hidden, as the command was expected to fail with exit code 1, coincidentally the same exit code that clap 2 uses for usage errors. Clap 3 exits with 2 instead of 1, so now the test failed. - Fix the wrong argument.
2022-05-13sq: Do not try to use non-existent argument.Nora Widdecke
2022-05-12openpgp: Improve tracing.Justus Winter
2022-05-12openpgp: Add Curve::field_size.Justus Winter
2022-05-12openpgp: Add MPI::zero and MPI::is_zero.Justus Winter
2022-05-12openpgp: Deprecate `iv_size` in favor of `nonce_size`.Wiktor Kwapisiewicz
- See #812.
2022-05-12openpgp: Rename `iv_size` to `nonce_size` leaving `iv_size`.Wiktor Kwapisiewicz
- Rename `iv_size` to `nonce_size`. - Introduce `iv_size` that forwards to `nonce_size` for compatibility reasons. - Change all calls to `iv_size` to `nonce_size`.
2022-05-11sq: Add the cryptographic backend to the version string.Justus Winter
2022-05-11openpgp: Add crypto::backend that identifies the backend.Justus Winter
- This returns a short, human-readable description of the cryptographic backend for use in version strings to improve bug reports. - Fixes #818.
2022-05-11openpgp: Add explicit forwarder for crypto::random.Justus Winter
- This harmonizes the docstring across the different backends. Also, it avoids monomorphization of the backend functions.
2022-05-11openpgp: Fix comments.Justus Winter
2022-05-11openpgp: Update comment.Justus Winter
2022-05-11openpgp: Fix typo.Justus Winter
2022-05-11openpgp: Use the new downcasting methods to reword some tests.Justus Winter
2022-05-11openpgp: Implement downcasting of Packets to Packet Bodies.Justus Winter
- Fixes #794.
2022-05-11openpgp: Drop .skip(0), that's a NOP.Justus Winter
2022-05-11openpgp: Add NEWS entry.Justus Winter
2022-05-09openpgp: Add a v3 certificate and key.Justus Winter
2022-05-06sq: Add scenarios for auth-capable key generation.Nora Widdecke
- And update the other key generation scenarios to handle authentication-capable subkeys.
2022-05-06sq: Add option to generate an auth-capable subkey.Nora Widdecke
- Generate an authentication-capable subkey by default. - Add the flags `--can-authenticate` and `--cannot-authenticate` to sq key generate, analogous to `--can{not}-sign`. - Closes #844.
2022-05-06openpgp: Add `deprecated` attribute to `Reader::new`.Wiktor Kwapisiewicz
- Also warn about the potential deletion of this function in version 2.0.
2022-05-06autocrypt, net: openpgp: Rewrite all usages of `Reader::new`.Wiktor Kwapisiewicz
2022-05-06openpgp: Move documentation and warn against armor::Reader::new.Wiktor Kwapisiewicz
2022-05-05openpgp: Fix ECDH parameter selection on generation and import.Justus Winter
- Select an appropriate hash algorithm for the ECDH KDF and an appropriate cipher for the ECDH KEK depending on the curve. Harmonize that for import and generation. - Fixes #841.
2022-05-03openpgp: Make the stern warning sterner, add reference.Justus Winter
2022-05-03openpgp: Don't include decrypted block in error message.Justus Winter
- Even though the documentation warns that this function returns rich errors that must not be returned to the user, and the mid-level streaming decryption's API prevents leaking rich errors, including decrypted data in the error message seems dicey.
2022-05-03openpgp: Rename function.Justus Winter
2022-04-28openpgp: Rework handing of unknown compression algorithms.Justus Winter
- Currently, if we don't understand a compression algorithm, parsing a compressed data packet fails and it is turned into an Unknown packet. This is rather unfortunate, and deviates from what we do for the encryption containers. - Encryption containers are either not decrypted, in which case they have a Body::Unprocessed, decrypted with Body::Processed, or decrypted and parsed Body::Structured. - Likewise, if we don't understand a compression algorithm, we should simply return a compressed data packet with an unprocessed body. This change does exactly that. - Fixes #830.
2022-04-28openpgp: Fix comment.Justus Winter
2022-04-28openpgp: Don't mark unknown packets as encrypted.Justus Winter
- This goes back a long way, to e304deb0fc7a92801cf3ba58aafeb14ce2301aed where the flag was called `decrypted`, and every packet but SEIP had decrypted set to `true`. At some point, we inverted the flag, but for some reason decided to mark Unknown packets as encrypted, which makes no sense, and changing it doesn't seem to break documented (i.e. tested) behavior.
2022-04-27openpgp: Make Cert::merge_public_and_secret safe and usable.Justus Winter
- Previously, Cert::merge_public_and_secret was not predictable with respect to which secrets are kept (due to unstable sorting). It also didn't document which secrets would be kept. All in all that made the function unpredictable, and hence unsafe and not usable. - Document that the secrets in `other` are preferred over the ones in `self`. Implement that by first sorting components using a stable sort algorithm, then preferring the merged in (now predictably the latter) secrets over existing ones. Add a test. - Fixes #843.
2022-04-27openpgp: Succinctly express Key4::public_cmp.Justus Winter
2022-04-27openpgp: Improve test.Justus Winter
2022-04-27sq: Improve dumping of KDF and KEK parameters.Justus Winter
2022-04-27openpgp: Improve documentation.Justus Winter
2022-04-27openpgp: Consider ECDH KDF and KEK parameters in StandardPolicy.Justus Winter
- Previously, there were two issues: - There is an implicit policy that constraints the symmetric algorithm to AES. RFC6637 doesn't forbid other ciphers, so arguably this should be made explicit and moved to the standard policy. Only using AES seems to be a sane default choice and will not impede interoperability in practice (notably, GnuPG constrains to AES as well). - We constrain hashes only based on their output length, and are hence willing to use dubious combinations like (AES128, MD5). - Constrain the parameters in StandardPolicy::key. Mention this in the documentation. - Fixes #839.
2022-04-27openpgp: Don't compute the CRC24 when reading armored data.Justus Winter
- The CRC24 checksum is optional (and has been since at least RFC2440, released in 1998), expensive to compute, doesn't add a meaningful integrity check, and will be more strongly discouraged in the next revision of OpenPGP. - This changes our armor::Reader to not compute it in the first place. This improves reading performance.
2022-04-26openpgp: Remove unused dependencies.Nora Widdecke
- backtrace and quickcheck_macros are unused. - found with cargo-udeps (https://github.com/est31/cargo-udeps).
2022-04-22ipc: Release 0.28.0.ipc/v0.28.0Justus Winter
2022-04-22net: Assert that public types are Send + Sync.Justus Winter