Commit Graph

707 Commits

Author SHA1 Message Date
Neal H. Walfield
94b506ca37
Release v0.36.0. 2024-05-21 23:33:00 +02:00
Neal H. Walfield
11203237e3
Update Cargo.lock. 2024-05-21 23:31:10 +02:00
Neal H. Walfield
7fc7ccac38
Revise the sq key generate documentation.
- Revise the `sq key generate` documentation to emphasize the key
    store.
2024-05-21 23:15:31 +02:00
Neal H. Walfield
58d3753cba
Save revocation certificates to the user's home directory.
- When generating a new key, and saving that key to the key store,
    don't require that the user think about where the revocation
    certificate should be saved; just save it in the Sequoia home
    directory.
2024-05-21 22:57:21 +02:00
Neal H. Walfield
006482b352
Implement sq key export. 2024-05-21 21:22:44 +02:00
Neal H. Walfield
e75ad72c65
Use sequoia-directories.
- Use `sequoia-directories` to compute the home directory, and the
    various component directories.

  - This also allows the use of `SEQUOIA_HOME` to set the home
    directory.
2024-05-21 21:22:39 +02:00
Neal H. Walfield
1d162d214b
Upgrade sequoia-keystore. 2024-05-21 18:11:44 +02:00
Neal H. Walfield
81009e984d
Upgrade pest.
- Version 2.7.9 was yanked.  Update to 2.7.10.
2024-05-21 18:11:44 +02:00
Devan Carpenter
2f97c2ab9e
ci: use sequoia-pipeline component 2024-04-22 13:29:10 -04:00
Daiki Ueno
9483554e61
Replace "sq link" mentions with "sq pki link"
- While the commit b5a7d15710 moved the
   "sq link" command under "sq pki", there are some left-overs in the
   error messages.

Signed-off-by: Daiki Ueno <dueno@redhat.com>
2024-04-19 17:22:04 +02:00
Neal H. Walfield
9be9f83e72
sq pki list should work with subkey key IDs and fingerprints.
- Change `sq pki list`, etc. to work with subkey key IDs and
    fingerprints.

  - Consider: a user examines a signature using `sq inspect,, and then
    looks up the signer's key ID.  We shouldn't say that the
    certificate is not found, but allow naming the certificate by the
    subkey's key ID.

  - Fixes #246.
2024-04-16 10:17:10 +02:00
Neal H. Walfield
3e964085cd
Don't show binding-related guidance when no bindings are shown.
- `sq pki list` provides guidance on how to use bindings.  Don't
    show that guidance if no bindings are shown.

  - Fixes #245.
2024-04-16 10:15:16 +02:00
Neal H. Walfield
066340edc0
When sq inspect displays an issuer, also show a label.
- When `sq inspect` shows an `Alleged signer` or an `Alleged
    certifier`, it only shows the signing key's key ID.  Use
    `best_effort_primary_uid_for` to also display a label.

  - Fixes #242.
2024-04-16 08:44:26 +02:00
Neal H. Walfield
c48d1d48dc
Release 0.35.0. 2024-04-15 15:27:08 +02:00
Neal H. Walfield
645c3cb914
Update Cargo.lock. 2024-04-15 15:27:08 +02:00
Neal H. Walfield
aafce5da3f
Upgrade sequoia-cert-store.
- Upgrade `sequoia-cert-store` to at least 0.5.3.  0.5.1 and 0.5.2
    have a minor bug in the cert-d lookup code.
2024-04-15 15:26:58 +02:00
Justus Winter
96bd1956b4
man: Emit default values. 2024-04-15 13:49:19 +02:00
Justus Winter
8a44cc4706
man: Emit possible values. 2024-04-15 13:33:16 +02:00
Justus Winter
3e138d4c59
man: Support optional arguments to command line options. 2024-04-15 13:33:16 +02:00
Neal H. Walfield
a8f01ef1ae
Make the output of sq pki list, etc. more concise by default.
- The output of `sq pki list`, `sq pki authenticate`, `sq pki
    identify` and `sq pki lookup` are overwhelming.

  - Change the output to only show whether a binding can be
    authenticated, not the paths; group the user IDs according
    to the certificate; and, show whether the components are expired
    or revoked.

  - Use the old output format if the user passes `--show-paths`.

  - Fixes #240.
2024-04-12 18:55:34 +02:00
Neal H. Walfield
c453b401cf
When prompting for a password, show the user ID, if known.
- When `sq decrypt` prompts for a password to decrypt the PKESK,
    don't just show the recipient's key ID, also show the
    certificate's user ID, if that is available.
2024-04-12 15:56:35 +02:00
Neal H. Walfield
f0eaf78997
If decryption fails, show the message's recipients.
- If decrypting a message fails, show the message's recipients.
    This may help the user debug the problem, e.g., it is not
    encrypted to them, or they need to import a key.

  - Fixes #231.
2024-04-12 15:52:07 +02:00
Neal H. Walfield
e9b502a258
When wrapping lines of text, limit the maximum width.
- Limit the maximum width of text columns to improve readability.

  - Fixes #239.
2024-04-12 14:59:03 +02:00
Neal H. Walfield
9cefdf6b6a
Improve formatting.
- The formatting of `sq verify`'s guidance was poor.  In particular,
    the indentation was wrong when the lines wrapped.

  - Improve the formatting.
2024-04-12 14:54:38 +02:00
Neal H. Walfield
920bc83953
Show guidance when signature verifications.
- If signature verification fails because, a certificate is missing
    suggest that the user use `sq network fetch`.
2024-04-12 14:44:37 +02:00
Neal H. Walfield
1403d4c9c0
Handle unused return value.
- When generating a new key, we display the new certificate.

  - If inspecting the certificate fails, display the error, but don't
    fail: the key was created successfully.
2024-04-12 14:44:37 +02:00
Neal H. Walfield
b14087a364
When generating a key, display the generated key.
- This is particularly important when the key is saved to the key
    store as the user has no easy way to figure out the fingerprint of
    the generated key.

  - Fixes #227.
2024-04-12 13:15:06 +02:00
Neal H. Walfield
584e6be105
Split the inspect functionality out of the dispatch function.
- Split the `inspect` functionality out of
    `commands::inspect::dispatch` and into its own function so that it
    can be more easily used from other contexts.
2024-04-12 12:16:43 +02:00
Neal H. Walfield
3f26b038da
Simplify recovering a buffered reader.
- When we need to reuse a `BufferedReader`, pass a `&mut
    BufferedReader` instead of the `BufferedReader` and then doing a
    dance to recover the `BufferedReader`.
2024-04-12 12:11:42 +02:00
Neal H. Walfield
03c6e57d10
When possible, prefer from_buffered_reader to from_reader.
- Objects that work with either a `BufferedReader` or a `Read`er are
    often more efficient when they are directly passed the
    `BufferedReader`.

  - Prefer `from_buffered_reader` to `from_reader` when possible.
2024-04-12 11:59:47 +02:00
Neal H. Walfield
c2d5f24782
Change FileOrStdin::open to return a buffered reader with a cookie.
- `FileOrStdin::open` returns a buffered reader without a cookie,
    i.e., a `BufferedReader<()>`.

  - Sequoia functions that a buffered reader, they expect a
    `BufferedReader<openpgp::parse::Cookie>`.

  - Make it easier to use the Sequoia functions by changing
    `FileOrStdin::open` to return a
    `BufferedReader<openpgp::parse::Cookie>`.
2024-04-12 11:14:30 +02:00
Neal H. Walfield
3a0fc2fdb5
Show more error context in the output of sq inspect.
- When showing why a key is not valid, or why a certification is not
    valid, `sq inspect` only showed the top-level error.

  - To make the issue clearer, show the whole error chain.

  - Fixes #237.
2024-04-10 13:07:08 +02:00
Neal H. Walfield
d44ea64fa5
When generating a key, write out the revocation certificate first.
- When generating a key using `sq key generate`, we first write out
    the certificate, and then the revocation certificate.

  - If writing out the revocation certificate fails, then we error
    out *after* we've already written out the certificate.

  - This is particularly surprising when the certificate is written to
    the key store: the operation failed, but a new key was added to the
    key store!

  - Change the order of operations so that we write out the revocation
    certificate first, and then the new certificate.
2024-04-09 13:31:52 +02:00
Neal H. Walfield
bf51db6e02
When generating a key, show how to use sq toolbox extract-cert.
- When `sq key generate` saves the key to a file, provide guidance
    on how to extract the certificate using `sq toolbox extract-cert`.
2024-04-09 12:37:41 +02:00
Neal H. Walfield
a5502e9f2f
Display hints on stderr, not stdout. 2024-04-09 12:34:22 +02:00
Neal H. Walfield
a549cabf8d
Require canonical user IDs by default.
- Change `sq key generate` and `sq key userid add` to require
    canonical user IDs by default.

  - If a user ID is not in canonical form, explain the problem, and
    suggest a solution, if possible.

  - Allow the user to disable this check by passing the
    `--allow-non-canonical-userids` flag.

  - Fixes #209.
2024-04-09 12:07:42 +02:00
Neal H. Walfield
3344444407
Change the type of user ID arguments to UserID instead of String.
- `sq key generate --userid USERID`, `sq key add --userid USERID`,
    and `sq key strip --userid USERID` expect a user ID.  Use the more
    precise type, `UserID`, instead of `String`.
2024-04-09 11:57:08 +02:00
Neal H. Walfield
5cc0398384
Output guidance when failing to authenticate bindings.
- `sq pki list`, etc. have two failure modes: there are no matching
    bindings, and some matching bindings couldn't be authenticated.

  - In both cases, the current error message is less than helpful,
    e.g.:

    ```
    $ sq pki list user@example.org
    No paths found.
    ```

  - If there are no matching bindings, suggest that the run `sq
    network fetch`.

  - If there are matching bindings that can't be authenticated, tell
    they user that they can see them by using the `--gossip` option.

  - Fixes #221.
2024-04-08 15:47:14 +02:00
Neal H. Walfield
893a7aafe9
Show guidance when sq key generate saves the key to the key store.
- When `sq key generate` saves the generated certificate on the key
    store, add guidance on how to designate it as a trusted introducer,
    or to mark it as certified.  Also explain how to export it, and
    how to publish it.
2024-04-05 18:14:13 +02:00
Neal H. Walfield
0cd8bae06f
Don't generate user ID-less certificates by default.
- Although Sequoia is able to use user ID-less certificates, they
    don't have good support in the ecosystem, and are probably not
    what most users want.

  - Consequently, don't make user ID-less certificates the default.
    Instead, require users to opt in by passing the `--no-userids` flag
    to `sq key generate`.

  - Fixes #223.
2024-04-05 18:08:45 +02:00
Neal H. Walfield
68cc605687
Fix spelling.
- It's a "user ID" not a "userid."
2024-04-05 17:14:55 +02:00
Neal H. Walfield
8954033c29
Output guidance when there are no matching certificates.
- If `sq pki list KEYID|FINGERPRINT` doesn't match any certificates,
    suggest that the user run `sq network fetch`.
2024-04-05 15:17:44 +02:00
Neal H. Walfield
68296b1058
When authenticating a certificate, check if it exists earlier.
- When authenticating a certificate by fingerprint e.g., using `sq
    pki identify FINGERPRINT`, check that it exists earlier.
2024-04-05 13:33:36 +02:00
Neal H. Walfield
ddfda32cec
Upgrade sequoia-keystore. 2024-04-04 17:33:30 +02:00
Luca Saiu
0035a412e7
When generating a key, store the key in the key store by default.
- Change `sq key generate` to store the generated key in the key
    store by default.

  - See #219.
2024-04-03 22:36:03 +02:00
Neal H. Walfield
30696427e6
Upgrade h2.
- Upgrade `h2` based on RUSTSEC-2024-0332.  See:

    https://rustsec.org/advisories/RUSTSEC-2024-0332
2024-04-03 22:36:02 +02:00
Justus Winter
2143899236
deny: Remove old goodlist and license entry, goodlist yaml-rust.
- yaml-rust is unmaintained.

  - yaml-rust is used by subplot/roadmap/serde_yaml thus an indirect
    dependency.  Remove when a new version of roadmap is released that
    uses a newer version of serde_yaml.  See
    https://gitlab.com/larswirzenius/roadmap/-/issues/13
2024-03-26 18:22:11 +01:00
Justus Winter
1ac709cda4
Fix documentation. 2024-03-25 14:47:28 +01:00
Justus Winter
5b898e3529
Move sq key extract-cert to sq toolbox.
- Fixes #204.
2024-03-25 14:47:28 +01:00
Justus Winter
345ac4c474
Use imperative mood to describe commands, subcommands, arguments. 2024-03-25 13:46:18 +01:00