1076 Commits

Author SHA1 Message Date
Neal H. Walfield
fc617dee6b
Clean up sq key list's output. 2024-12-03 18:56:59 +01:00
Justus Winter
f6e7efa371
Implement sq config inspect network.
- Fixes #431.
2024-12-03 18:39:08 +01:00
Justus Winter
ac0044a677
Implement sq config inspect paths.
- Fixes #275.
2024-12-03 17:43:35 +01:00
Justus Winter
3bde91aeb4
Implement sq config inspect policy.
- Fixes #276.
2024-12-03 16:34:20 +01:00
Justus Winter
68522f7bf1
Make sq key list fail without key store, align error messages.
- Fixes #479.
2024-12-03 16:11:51 +01:00
Justus Winter
f0df37d13f
Align error messages when listing certs.
- Previously, `sq key list` showed a different error for a certificate
    in the certificate store from a certificate that is not in the
    certificate store.  Align these.

  - Fixes #462.
2024-12-03 15:06:27 +01:00
Justus Winter
32bdb2598d
Import the secret key so that the example has something to list.
- Otherwise, `--cert-domain=example.org` matches no key.
2024-12-03 14:54:39 +01:00
Neal H. Walfield
3263a5e2d5
Change sq inspect to show the cert associated with a recipient.
- When `sq inspect` displays a PKESK, it displays the recipient key
    ID.  For a user of `sq`, this information is nearly useless.  The
    recipient is normally a subkey, and `sq` doesn't support looking
    up certificates by subkey.

  - Extend `sq inpsect` to look up the recipient, and display
    information about the the associated certificate, if it is
    available.
2024-12-03 11:42:27 +01:00
Justus Winter
9085ef8638
Simplify code.
- The policy and time were only used to reason over subkeys.  Since
    we don't match on subkeys,  we no longer need the specialized
    functions.
2024-12-03 10:45:51 +01:00
Justus Winter
ee29f3c8f8
Remove unreachable code.
- We no longer resolve certs by subkey fingerprint.

  - Fixes 8c47caaee971f9f175f5e803518ec2260c62965b.
2024-12-03 10:43:16 +01:00
Justus Winter
84928e39d0
Fix resolving --signer-self.
- Fixes 25e99e5afb1e2f382e138a4502c9e00641dd903b.

  - Fixes #475.
2024-12-03 10:39:52 +01:00
Justus Winter
169da29c09
Improve formatting of message.
- We don't emit anything for a backend with devices, so it doesn't
    make sense to indent this more.
2024-12-03 09:53:43 +01:00
Justus Winter
25e99e5afb
Implement sq sign --signer-self and sq encrypt --signer-self.
- This selects the default set of signing keys controlled by the
    `sign.signer-self` setting.

  - Fixes #475.
2024-12-02 18:05:53 +01:00
Justus Winter
61210f856d
Make the number of iterations configurable for sq network search.
- See #336.
2024-12-02 16:44:07 +01:00
Justus Winter
0d5fbb0cb6
Make use of DANE configurable when doing sq network search.
- See #336.
2024-12-02 16:31:40 +01:00
Justus Winter
a81a1a7689
Make use of WKD configurable when doing sq network search.
- See #336.
2024-12-02 16:28:58 +01:00
Justus Winter
1fe498db4e
Make the path to the backend servers configurable.
- See #336.
2024-12-02 16:00:21 +01:00
Justus Winter
e58f47e434
Fix displaying effective configuration. 2024-12-02 15:56:55 +01:00
Justus Winter
dcc3db167d
Make hints configurable.
- See #336.
2024-12-02 14:58:18 +01:00
Justus Winter
092ba48e5a
Generalize function. 2024-12-02 14:57:49 +01:00
Justus Winter
7d2fab14f9
Make verbosity configurable.
- See #336.
2024-12-02 14:42:04 +01:00
Justus Winter
24ce3aa2e9
Introduce accessors for sq.quiet and sq.verbose. 2024-12-02 14:35:25 +01:00
Justus Winter
099e9c8737
Use platform-specific prompt in hints. 2024-12-02 12:52:01 +01:00
Justus Winter
f5fff14661
Indent hints so that they look different from shell prompts.
- Fixes #473.
2024-12-02 12:47:54 +01:00
Justus Winter
b565f7ec90
Improve the --for-self encryption hint.
- Mention the configuration file, if any.

  - Fixes #472.
2024-12-02 12:15:23 +01:00
Justus Winter
04615bc768
Don't show hint if a recipient is listed in encrypt.for-self.
- Fixes #471.
2024-12-02 12:02:59 +01:00
Justus Winter
dfc36e38d8
Don't explicitly create Recipients. 2024-12-02 12:02:59 +01:00
Neal H. Walfield
84a8807173
Show the configuration file's location in sq config --help.
- Include the location of the configuration file in `sq config
    --help`.

  - See #470.
2024-11-30 10:00:32 +01:00
Neal H. Walfield
de9c5f48b0
Fix message.
- Always parenthesize the message.
2024-11-30 09:56:21 +01:00
Justus Winter
d6992416f4
Display a hint if encrypting a message that one can not decrypt.
- This is a heuristic, of course, as we cannot know which keys the
    user controls, but we can try to be helpful and display a hint.
2024-11-29 19:03:09 +01:00
Justus Winter
b88367ce36
Implement sq encrypt --for-self.
- This adds a mechanism to add a list of certificates presumably
    owned by the user to the recipients using the `--for-self` flag.
    This makes sure the encrypted message can be decrypted again.

  - Fixes #461.
2024-11-29 19:03:09 +01:00
Justus Winter
abafa552f0
When encrypting a message, list signers.
- This makes the process more transparent.  Also see #459.
2024-11-29 18:57:50 +01:00
Justus Winter
0df3b9676e
When encrypting a message, list recipients and passwords.
- See #461.
2024-11-29 18:57:49 +01:00
Justus Winter
879b619dae
Use BufferedReader::copy to avoid an extra copy.
- In contrast, std::io::copy has to copy the data into an
    intermediate buffer.
2024-11-29 18:57:34 +01:00
Justus Winter
8d7650def7
Rework encryption subkey selection. 2024-11-29 18:57:33 +01:00
Justus Winter
0d9fae1820
Fix handling of --home=default and --home=none.
- Fixes 4b3f2c97adbce947bd9fb4f188f112977f1181f2 which predates the
    introduction of `--home=default` and `--home=none`.
2024-11-29 13:55:42 +01:00
Justus Winter
ea593feb02
Drop superfluous mut. 2024-11-28 19:16:32 +01:00
Justus Winter
012e762d38
Align user ID designators in sq pki link retract.
- User IDs have to be explicitly given, or `--all` has to be used to
    select them all (this was previously the default).

  - This aligns the retract subcommand with the other link and vouch
    management commands.

  - Fixes #442.
2024-11-28 18:07:30 +01:00
Neal H. Walfield
c9bde7fe47
Add support for addressing shadow CAs by symbolic names.
- Add a new paramter to `sq pki link add`, `sq pki link authorize`,
    and `sq pki link retract`, `--cert-special`, which allows addressing
    shadow CAs by symbolic names.

  - If the shadow CA doesn't exist yet, we create it.

  - This means `sq pki link authorize --cert-special keys.openpgp.org
    --all --unconstrained` can be used to fully trust the
    `keys.openpgp.org` key server, for instance.  This is more
    convenient, and especially useful for documentation.

  - Fixes #337.
2024-11-28 15:38:34 +01:00
Justus Winter
477f255f84
Make sq config get policy.path reflect SEQUOIA_CONFIG_POLICY.
- This is cosmetic, but makes the output more consistent.

  - Fixes #467.
2024-11-28 13:20:18 +01:00
Neal H. Walfield
99d97c0cc3
Support thiserror 2.0.
- Adjust one bit of syntax to be compatible with `thiserror` 1.0 and
    `thiserror` 2.0, and loosen the dependency requirements to accept
    either version.
2024-11-28 06:37:07 +01:00
Justus Winter
9f5c5ce930
Mark sq keyring filter experimental.
- Invoking it now requires the `--experimental` flag.  This is a
    template that we may use to introduce features into sq with a bit
    of a chance to stabilize it over time.

  - Fixes #455.
2024-11-27 17:27:04 +01:00
Justus Winter
4b3f2c97ad
Add a configuration file and associated management commands.
- Add a configuration file for sq, and sq config get to
    programmatically query configuration values, and sq config template
    to create a template as a starting point for a custom configuration
    file.

  - As a first step, the following things have been made configurable:

    - The cipher suite for key generation.
    - The set of keyservers.
    - The cryptographic policy, which can be sourced from an external
      file as well as modified inline.

  - If there is no configuration file, sq config template can be used to
    create a template for the user to modify.

  - If a default has been overridden using the configuration file,
    sq's --help output is augmented with the configured value.
2024-11-27 15:26:36 +01:00
Justus Winter
3b1bd79195
Align user ID designators in sq pki {link,vouch} {add,authorize}.
- Align user ID designators across these four commands.  Previously,
    `--all` was implied for the authorize commands if no user ID
    designator was given.

  - However, this is problematic for the following reasons:

    - First, it is inconsistent across the commands.

    - Second, while CAs can add any name to their cert because they
      are CAs, those certifications are subject to constraints, such
      as domain constraints, or the amount.  But, the link we add
      fully authenticates the current user IDs, which may not be what
      the user wants, so it should require explicit consent.

    - Third, making this implicit again is easier than going from
      implicit to explicit, which breaks existing users.

  - Fixes #442.
2024-11-27 13:33:30 +01:00
Justus Winter
1c6bf5d6fd
Require self-signed user IDs when publishing certs in a WKD.
- Fixes #449.
2024-11-27 11:36:32 +01:00
Justus Winter
f55015ab77
Remove argument sq key subkey export --cert-file.
- This doesn't work, and it is of questionable use.  Also, `sq key
    export` doesn't have `--cert-file` either.

  - Fixes #464.
2024-11-26 19:49:16 +01:00
Neal H. Walfield
8072a9f8e6
Fix message. 2024-11-26 13:59:23 +01:00
Justus Winter
a47da3ac33
Remove argument sq cert lint --export-secret-keys.
- If a secret key is provided as file input, it will be emitted.
    This makes it consistent with what other commands do.

  - Fixes #448.
2024-11-25 15:30:58 +01:00
Neal H. Walfield
be5b1f7103
Change sq pki link retract to use the NULL policy.
- Change `sq pki link retract` to use the NULL policy when resolving
    user IDs.  It's safer to retract a link for a user ID than to
    refuse.
2024-11-24 22:01:06 +01:00
Neal H. Walfield
4763cfef48
Improve hint. 2024-11-23 20:38:34 +01:00