Commit Graph

619 Commits

Author SHA1 Message Date
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
Justus Winter
a906a5dc84
Improve wording. 2024-03-25 12:28:15 +01:00
Justus Winter
acff12f8a7
Improve wording.
- Fixes #215.
2024-03-25 12:27:15 +01:00
Justus Winter
93e8543748
Trim dependencies. 2024-03-25 12:18:53 +01:00
Neal H. Walfield
24b383275a
Port sq inspect's examples to the example framework.
- #190.
2024-03-13 10:26:32 +01:00
Devan Carpenter
7e3334740c
ci: use common-ci 2024-03-13 09:48:56 +01:00
Neal H. Walfield
039aa33153
When using ioctl's, be as general as possible.
- On some platforms, the arguments are u32s on others they are u64s,
    use `into` to cover more situations.

  - Fixes #211.
2024-03-13 09:34:05 +01:00
Neal H. Walfield
cef91ffbe7
Upgrade generator.
- Version 0.7.6 of `generator` was yanked.  Upgrade to the latest
    version.
2024-03-13 09:34:05 +01:00
Neal H. Walfield
e2e6fa8195
Upgrade mio.
- Version 0.8.10 of `mio` has a vulnerability, which is tracked as
    RUSTSEC-2024-0019.

    See https://rustsec.org/advisories/RUSTSEC-2024-0019

  - Upgrade to 0.8.11, which fixes the issue.
2024-03-13 09:34:05 +01:00
Neal H. Walfield
1d29ea0b90
ci: Don't spell check openpgp-policy.toml. 2024-03-13 09:26:21 +01:00
Devan Carpenter
9edfc9a412
add openpgp-policy
copied from sequoia.git
2024-03-06 12:35:27 -05:00
Neal H. Walfield
8fbaf04431
Move key import functionality to Config.
- Move the key import functionality from
    `commands:🔑:import::import` to `Config::import_key` so that
    it can be used by other subcommands that import or update keys.
2024-03-01 09:42:56 +01:00
Neal H. Walfield
2f38af4805
Update NEWS.
- This fixes the NEWS file, and adds missing information.
2024-02-29 17:35:10 +01:00
Neal H. Walfield
696bf3a677
Release 0.34.0. 2024-02-29 17:21:43 +01:00
Neal H. Walfield
828eb4dd44
Relax version requirements on textwrap.
- Also accept version 0.15.x of `textwrap`.
2024-02-29 17:21:37 +01:00
Neal H. Walfield
139ee6e044
Update Cargo.lock. 2024-02-29 17:18:37 +01:00
Justus Winter
fcac57be3d
Correctly reset the dumping state when processing next armor block.
- Fixes erroneously duplicated packets in the output.
2024-02-29 14:06:02 +01:00
Neal H. Walfield
1982366e08
Improve sq network fetch output.
- Call `best_effort_primary_uid` after inserting the certificate
    into the certificate store.  Otherwise, `best_effort_primary_uid`
    won't be able to take any new authentication information into
    account.

  - Sort the certificates by the degree to which we can authenticate
    them.
2024-02-29 13:42:28 +01:00
Neal H. Walfield
6a73570626
Change best_effort_primary_uid to also return the trust amount.
- Change `best_effort_primary_uid` to also return the trust amount.

  - Instead of using an unergonomic tuple, use a dedicated type,
    `PreferredUserID`, so that it is easier to extend in the future.
2024-02-29 13:42:28 +01:00
Neal H. Walfield
011c426970
Change best_effort_primary_uid to prefer authenticated user IDs.
- Change `best_effort_primary_uid` to prefer authenticated user IDs
    to user IDs that are only self signed.
2024-02-29 13:42:28 +01:00
Neal H. Walfield
92e8c5c1d5
Change best_effort_primary_uid to return a sanitized string.
- The result of `best_effort_primary_uid` should always be
    sanitized.

  - Change `best_effort_primary_uid` to return a sanitized string, and
    update the callers.
2024-02-28 12:33:26 +01:00
Neal H. Walfield
df00d8fc86
Implement Display for more variants of Safe.
- Implement `Display` for `Safe<&[u8]>`, `Safe<Cow<str>>`,
    `Safe<&String>`, and `Safe<String>`.
2024-02-28 11:42:11 +01:00
Neal H. Walfield
d45ebaa04b
Optionally pass a Config to best_effort_primary_uid.
- Add an optional `Config` to `best_effort_primary_uid` in
    preparation for optionally printing authenticated user IDs instead
    of self-signed user IDs.
2024-02-27 15:40:38 +01:00
Neal H. Walfield
d0e3b0d4d8
Don't get a mutable reference to a cert store if it is not needed.
- `sequoia_cert_store::StoreUpdate` no longer requires a mutable
    reference to update the certificate store (it instead relies on
    interior mutability).

  - Don't get a mutable reference using
    `Config::cert_store_mut_or_else` if it is not necessary.  Just use
    `Config::cert_store_mut`.
2024-02-27 15:37:28 +01:00
Neal H. Walfield
074f1ab2d2
Change Config::cert_store to a wot::store::CertStore.
- A `wot::store::CertStore` is a thin wrapper around a
    `cert_store::CertStore`, which implements two traits, and maintains
    a cache of web of trust computations.

  - Change `Config` to use `wot::store::CertStore` instead of a
    `cert_store::CertStore`.

  - This makes it easier to use the web of trust elsewhere in `sq`,
    and doesn't cost anything if we don't do any web of trust
    calculations.
2024-02-27 14:59:42 +01:00
Neal H. Walfield
98cc4510b4
Change Config::policy from an owned value to a reference.
- To allow a field of `Config` to hold a reference to the policy,
    change the policy from an owned value to a reference, which can be
    copied.
2024-02-27 13:25:04 +01:00
Neal H. Walfield
314e19c1af
Upgrade sequoia-cert-store and sequoia-wot.
- Upgrade `sequoia-cert-store` and `sequoia-wot` and adapt to their
    API changes.
2024-02-23 16:58:15 +01:00
Neal H. Walfield
20f6512085
Make --key-store and --no-key-store global options.
- Change `--key-store` and `--no-key-store` to be global options,
    like `--cert-store` and `--no-cert-store`.
2024-02-21 13:49:00 +01:00
Neal H. Walfield
340751a587
Add a note to --help that global options are described by sq --help.
- To avoid overwhelming users, we don't describe global options in a
    subcommand's help output.

  - Add a short section that tells the user that there are global
    options, and that they can learn about them from the top-level's
    help output.

  - See #202.
2024-02-21 12:28:37 +01:00
Neal H. Walfield
0382001a65
Only show global options in the top-level help output.
- Fixes #202.
2024-02-21 12:28:32 +01:00
Neal H. Walfield
19f8893c46
Put global options in their own section.
- See #202.
2024-02-21 11:35:03 +01:00
Neal H. Walfield
ed4a038321
Implement sq key import.
- Add a new subcommand, `sq key import`, which imports a soft key
    into the key store.
2024-02-20 16:27:16 +01:00
Neal H. Walfield
d6e8e72d24
Add a utility function to return the path to the key store.
- Add `Config::key_store_path` and `Config::key_store_path_or_else`
    to return the path to the configured key store, if any.
2024-02-20 16:27:16 +01:00
Neal H. Walfield
5aceb397a3
Allow examples to use a key store.
- Examples may want to use the key store.

  - Don't pass `--no-key-store`; direct `sq` to use a fresh key store
    in the temporary directory.
2024-02-20 16:27:16 +01:00
Neal H. Walfield
b07a922bb6
Upgrade sequoia-keystore and sequoia-ipc.
- `sequoia-ipc` version 0.33.0 fixes a bug on Windows.

  - See 44b349e32d .
2024-02-20 16:25:39 +01:00
Neal H. Walfield
d55b3d5f81
Add missing NEWS.
- Mention `sq key list` in the NEWS file.
2024-02-18 16:48:25 +01:00
Neal H. Walfield
27093c1709
Add support for using a key store.
- Support using keys managed by `sequoia-keystore`.

  - When decrypting a message, have `sq` automatically ask the
    key store to decrypt the PKESKs.

  - Extend `sq sign` and `sq encrypt` with the `--signer-key`
    parameter to use a key managed by the keystore.

  - Add two top-level options: `--no-key-store`, which disables the
    use of the key store, and `--key-store`, which uses an alternate
    key store instance.

  - Add `sq key list` to list keys on the key store.
2024-02-18 15:24:02 +01:00
Justus Winter
c8567714e5
Check that there is at least one entry in the map when hex dumping.
- This is a robustness fix for problems similar to #201.
2024-02-15 12:26:51 +01:00
Justus Winter
4aec54d502
Turn on buffering when producing hex dumps.
- To produce hex dumps, we need to enable mapping, but also turn
    on buffering.  This makes sure that the map contains the whole
    packet content, even if it has not been parsed (such as when
    encountering unknown or junk pseudo packets).

  - Fixes a crash when hex dumping pseudo packets created by the
    packet parser for junk data in the packet stream.

  - Fixes #201.
2024-02-15 12:22:53 +01:00