Commit Graph

81 Commits

Author SHA1 Message Date
David Runge
dc501f7a6e
Add specific information on validity period to subcommand docs
Add specific information on default validity periods to the long
documentation of `sq certify`, `sq key generate` and `sq link add`.
2023-06-05 15:57:45 +02:00
David Runge
96bd7e9b9e
Fix help output for sq key generate
Make a specific connection between "both" and "universal", so that the
user has an easier time to infer, that with choosing "universal" both
encryption purposes are added.
2023-06-05 15:57:43 +02:00
David Runge
9c35ffa019
Use common abstraction to get CipherSuite in sq key generate
Use `sq_cli:🔑:CipherSuite::as_ciphersuite()` in `sq key` subcommand
to derive a valid `openpgp::cert::CipherSuite` from a variant of
`sq_cli:🔑:CipherSuite`.
2023-06-05 15:57:40 +02:00
David Runge
778741b2f8
Simplify use of validity in certify, key and link subcommands
- Change the behavior of the `sq certify`, `sq key generate` and `sq
  link add` subcommands to rely on a single `--expiry` input argument
  (same as `sq key subkey generate`), which replaces `--expires` and
  `--expires-in`. This allows to directly parse a specific ISO 8601
  timestamp, a custom duration or `"never"` and create a verified data
  type that can be used further.
- Use `Expiry::as_duration()` in `sq certify` and `sq key`
  subcommands to calculate the validity (duration until expiration) of
  certifications and keys.
- Add the constants `KEY_VALIDITY_IN_YEARS` and
  `THIRD_PARTY_CERTIFICATION_VALIDITY_IN_YEARS` to `sq_cli` to allow
  centralized modifications of the default validity duration of keys and
  certifications (in years).
- Add the constants `KEY_VALIDITY_DURATION` and
  `THIRD_PARTY_CERTIFICATION_VALIDITY_DURATION` to provide
  the default `Duration` for keys/subkeys and third party
  certifications (based on `KEY_VALIDITY_IN_YEARS` and
  `THIRD_PARTY_CERTIFICATION_VALIDITY_IN_YEARS`).
2023-06-05 15:57:38 +02:00
David Runge
57e4958dfe
Add sq key subkey add command to add newly generated subkeys
- Add `sq key subkey add` to allow to add a newly generated `SubKey` to
  an existing key.
- Add `sq_cli::types::Expiry` to allow providing expiry with a
  single `--expiry` input argument, that covers providing an ISO 8601
  timestamp, a custom duration and "never".
- Add impl block for `sq_cli:🔑:CipherSuite` to allow returning a
  `sequoia_openpgp::cert::CipherSuite`.
2023-06-05 15:56:08 +02:00
David Runge
5033e8842b
Move expiry constants to CLI module
Move the constants `SECONDS_IN_DAY` and `SECONDS_IN_YEAR` to the CLI
module so that they can be used there and export them in the top-level
module agaian so that they can be used elsewhere as well.
2023-06-05 13:35:30 +02:00
David Runge
4587269d1f
Move key subcommands to their own modules
Move the code for `adopt`, `attest-certifications`, `extract-cert`,
`generate`, `password` and `userid` subcommands to their respective
own modules.
This separates the various features from one another and makes adding
new features less unwieldy.
2023-06-05 13:35:20 +02:00
Neal H. Walfield
3433e6e806
Release 0.30.1.
* Changes in 0.30.1
 * Notable changes
   - The `crypto-botan` feature now selects Botan's v3 interface.  Use
     the new `crypto-botan2` feature to continue using Botan's v2
     interface.
 * Notable fixes
   - Several parser bugs were fixed in sequoia-openpgp 1.16.0 and
     buffered-reader 1.2.0.  These are all low-severity as Rust
     correctly detects the out of bounds access and panics.  Update
     Cargo.lock to make sure we use these versions.
2023-05-31 10:33:31 +02:00
Neal H. Walfield
1b3568580e
Update Cargo.lock. 2023-05-31 10:33:15 +02:00
Neal H. Walfield
60ba1d11cc
Add a feature to build sq using Botan's version 2 interface.
- sequoia-openpgp 1.16 changed `sequoia-openpgp/crypto-botan` to
    build against Botan's v3 interface, and exposed
    `sequoia-openpgp/crypto-botan2` to build against the v2 interface.

  - Do the same.  Add a `crypto-botan2` feature to allow the user to
    build against Botan's v2 interface.
2023-05-31 09:36:15 +02:00
David Runge
0682d6dcea
Add cargo-deny integration
- Add `deny.toml` for `cargo deny` with advisory error for `RUSTSEC-
  2020-0071` disabled as it does not affect chrono (or us for that
  matter).
  Allow multiple versions as there is not much we can do about those
  anyways and it clutters the output immensely.
  Add all currently used licenses to allow list.
  Deny the use of `ring` as it does not have a responsible disclosure
  policy: https://github.com/briansmith/ring#bug-reporting
- Run `cargo deny` as further `test` step in GitLab CI, so that it is
  among the last things that may fail in a merge request.
2023-05-30 13:19:24 +02:00
David Runge
f6aa19294a
Replace the unmaintained term_size with terminal_size
As term_size is no longer maintained, switch to terminal_size.
2023-05-30 10:52:54 +02:00
David Runge
8cc4a64fba
Update bumpalo to 3.12.2
As bumpalo 3.12.1 has been yanked, update to 3.12.2.
2023-05-30 10:52:50 +02:00
David Runge
58ee338056
Update buffered-reader to 1.2.0
Update lock file to use buffered-reader 1.2.0.
2023-05-19 20:04:25 +02:00
David Runge
cd8ef12ef4
Update sequoia-openpgp to 1.16.0
Update lock file to use sequoia-openpgp 1.16.0.
2023-05-19 20:04:19 +02:00
Neal H. Walfield
a99c5acdd3
Update NEWS file
- Add missing news entries for 0.30.0.
2023-05-08 12:39:04 +02:00
Neal H. Walfield
be99608961
Release 0.30.0 2023-05-08 11:04:41 +02:00
Neal H. Walfield
f5a5d0d8dd
Fix spelling 2023-05-08 11:04:41 +02:00
Neal H. Walfield
7db05f8d18
Upgrade dirs to version 5 2023-05-08 11:04:41 +02:00
Neal H. Walfield
355352e467
Update Cargo.lock 2023-05-08 11:04:41 +02:00
Neal H. Walfield
68a2223d43
Don't spellcheck Cargo.lock 2023-05-08 11:04:40 +02:00
Gabriel de Perthuis
75b5360a38
Update subplot to fix tera issue
- See https://gitlab.com/subplot/subplot/-/merge_requests/317 .

  - Fixes #2
2023-04-19 10:55:09 +02:00
Gabriel de Perthuis
2c57cd77d7
Move subplot tests to a feature so subplot doesn't affect most builds
Installing sq from crates.io (cargo install sequoia-sq) was broken by a
semver-compatible change in Tera.  Running cargo test uses the lockfile
and isn't affected.

This has the side benefit of reducing dependency bloat, the baseline
depends on check/build/build --release but in the case of a non-release
build the dependency count goes from 403 to 315.

Fixes #2.

The subplot/tera issue was likely triggered by this change in tera
1.18: <https://github.com/Keats/tera/pull/799>.
2023-04-19 10:54:05 +02:00
Neal H. Walfield
689ed7428b
Add support for using pEp certificate stores
- Add the top-level option `--pep-cert-store` and the environment
    variable `PEP_CERT_STORE`, which allow users to use pEp
    certificate stores.

  - By default, no pEp certificate store is used.  Users can however
    put `export PEP_CERT_STORE=$HOME/.pEp` in their `.bashrc` file, for
    instance, to turn it on.
2023-04-19 10:31:33 +02:00
Neal H. Walfield
e01ec617eb
Update to sequoia-net 0.27
- Change the Windows CI job from `windows-msvc` to `windows-gnu` as
    `sq` now depends on OpenSSL, which is easier to install under
    `windows-gnu`.
2023-04-19 10:31:33 +02:00
Neal H. Walfield
1492c0a6fe
Update README
- Remove section on how to generate the man pages.  They are now
    generated automatically.
2023-04-18 14:27:34 +02:00
Justus Winter
f7cdc4274d
Implement sq key adopt --expire. 2023-04-14 10:15:14 +02:00
Justus Winter
956dc42faf
Honor --time as signature creation time when adopting keys. 2023-04-14 10:15:14 +02:00
Justus Winter
8f5e617b6b
Fix typo. 2023-04-14 10:15:14 +02:00
Justus Winter
d0445e67bf
Implement types::Time::timestamp for easy use with Sequoia. 2023-04-14 10:15:14 +02:00
Neal H. Walfield
0b33c9c603
Generate man pages using clap_mangen
- `clap_mangen` generates the man pages directly from `Clap`, and is
    the successor to `manpage-maker`.

  - Use it, and delete the checked-in (and stale) man pages.
2023-04-08 19:36:50 +02:00
Neal H. Walfield
df012b859c
sq sign --merge shouldn't conflict with --time
- `--time` is now a global option and can be set even if `--merge`
    is passed to `sq sign`.
2023-04-08 19:36:44 +02:00
Neal H. Walfield
1ab79eb1d4
Release 0.29.0 2023-04-07 21:47:55 +02:00
Neal H. Walfield
6b77af08dd
Update Cargo.lock 2023-04-07 21:47:55 +02:00
Neal H. Walfield
54fd575a00
Have sq link list also print any expiration date
- Change `sq link list` to print the date a certification expires
    on, if any.
2023-04-05 19:01:21 +02:00
Neal H. Walfield
be48eca4f6
When --time is not specified, use the current OpenPGP time
- When `--time` is not specified, we set `config.time` to
    `SystemTime::now()`.

  - `SystemTime::now()` has subsecond resolution, and a different
    range from OpenPGP timestamps.  Lossily round trip it via
    `openpgp::types::Timestamp` to adjust the resolution, and to make
    sure the current time is valid in an OpenPGP context.
2023-04-05 17:35:46 +02:00
Neal H. Walfield
4ae448cef8
Add an option to sq link add to temporarily accept a binding
- Add an option to `sq link add`, `--temporary`, to temporarily
    accept a binding.

  - This creates a fully trusted certification that expires after a
    week, and a second certification that is one second older, which
    doesn't expire, but is only partially trusted (trust amount = 40)
    so that the user remembers this decision.
2023-04-05 17:35:41 +02:00
Neal H. Walfield
96a65b4b97
Fix signature comparison
- When checking whether two signatures are the same, we forgot to
    mark the signatures as being different when the expiration times
    are different.  Do it.
2023-04-05 17:34:58 +02:00
Neal H. Walfield
825c0aab52
Fix computation of a SignatureBuilder's expiration time
- Unfortunately, `SignatureBuilder::signature_expiration_time` is
    broken.

    See https://gitlab.com/sequoia-pgp/sequoia/-/issues/998

  - Workaround this issue by computing the expiration time manually.
2023-04-05 17:34:53 +02:00
Neal H. Walfield
78972b3ae1
Add --all option to sq link add.
- If the user doesn't specify any User IDs, don't link all
    self-signed User IDs.  Print out the self-signed User IDs and prompt
    the user to specify `--all` or just the ones they want to link.
2023-04-05 11:11:26 +02:00
Neal H. Walfield
a8dd7061e6
Don't set any trust roots if --gossip is specified
- When the `--gossip` option is passed to `sq wot`, don't set any
    trust roots.
2023-04-03 14:15:35 +02:00
Neal H. Walfield
cbcaa73e09
Add crypto-botan feature 2023-03-31 09:17:37 +02:00
Neal H. Walfield
893e4cd2e3
Update project metadata
- `repository` still pointed to the old repository.
2023-03-31 09:17:37 +02:00
Neal H. Walfield
0dc63db72d
Update Cargo.lock 2023-03-31 09:17:36 +02:00
Neal H. Walfield
580c977ef7
Fix formatting 2023-03-31 09:17:36 +02:00
Neal H. Walfield
2359acb230
When iterating over all certificates, prefetch the data
- Have `sq list` prefetch the data, when the search is
    unconstrained.
2023-03-31 09:17:15 +02:00
Neal H. Walfield
4efea87492
Add sq inspect --cert KEYHANDLE
- Extend `sq inspect` to read from the certificate store.
2023-03-31 09:17:09 +02:00
Neal H. Walfield
cd1a26de1c
Change sq import to print what is imported
- Change `sq import` to print what is imported.
2023-03-30 22:52:29 +02:00
Neal H. Walfield
2ffa96dbca
Add sq link list.
- Add the subcommand `sq link list` to list active and retracted
   links.
2023-03-30 16:08:14 +02:00
Neal H. Walfield
0665df5cf4
Don't create a link when it already exists
- When adding a link, check if the active link has the same
    parameters, if so don't update the link.  If the parameters
    changed, show a diff.
2023-03-30 16:08:14 +02:00