445 Commits

Author SHA1 Message Date
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
Justus Winter
b01e8ff0b6
Only export exportable certs. 2024-02-14 17:12:42 +01:00
Justus Winter
c29bcee689
Move utility function. 2024-02-14 17:12:42 +01:00
Justus Winter
5ae91e8b4b
Make sq pki list <KEYHANDLE> behave like sq pki identify.
- Fixes #179.
2024-02-14 17:12:42 +01:00
Justus Winter
2e07bbe6d1
Make sq cert export do what I mean.
- Add --all to export all certificates.

  - Add a query argument that can be a subkey fingerprint or key ID,
    an email address, or a user ID fragment.

  - Fixes #181.
2024-02-14 17:12:42 +01:00
Justus Winter
e78576ce97
man: Include global options in sq.1, refer to it from other pages. 2024-02-14 14:28:38 +01:00
Justus Winter
09fbaf515d
man: Fix spelling of Sequoia PGP. 2024-02-14 14:28:30 +01:00
Justus Winter
f37df9a211
Implement sq key expire.
- Fixes #113.
2024-02-14 12:47:41 +01:00
Justus Winter
3cbca60dd5
Add a framework for displaying hints to the user. 2024-02-14 12:45:54 +01:00
Justus Winter
65bc02e089
Use the decryption helper to decrypt when dumping packets. 2024-02-13 18:07:07 +01:00
Justus Winter
0a7a75a102
Allow breaking the SKESK password loop using empty passwords. 2024-02-13 17:59:42 +01:00
Justus Winter
d2fc78ba25
Use appropriate function to load secret keys. 2024-02-13 17:59:30 +01:00
Justus Winter
f017009b15
Remove --dump and --hex from sq decrypt, those are power tools. 2024-02-13 17:12:00 +01:00
Justus Winter
f53e0cfd32
Move the top-level command dispatcher. 2024-02-13 17:00:28 +01:00
Justus Winter
3fce463ba6
Suspend progress bar when emitting CA information. 2024-02-13 14:22:55 +01:00
Justus Winter
5b622a7899
Update the sq network fetch documentation to reflect recent changes. 2024-02-13 14:22:28 +01:00
Justus Winter
d9f9bf6ea2
Certify certs downloaded from the web.
- Fixes #174.
2024-02-13 14:21:33 +01:00
Justus Winter
2824dce5d8
Make sq cert lint's input argument work as documented.
- Previously, giving no argument did not read from stdin, contrary
    to what the documentation claimed and how other subcommands
    behave.  Align documentation and behavior.
2024-02-12 23:42:07 +01:00
Justus Winter
d56a510040
Make sq network fetch download certs over http.
- See #174.
2024-02-12 23:42:07 +01:00
Justus Winter
b1f0502d5c
Rename function. 2024-02-12 23:42:07 +01:00
Justus Winter
0f784ed0e6
Add a switch to the network fetch methods to update all certs.
- See #6.
2024-02-12 23:42:07 +01:00
Justus Winter
cce9a0dabf
Move sq keyring to sq toolbox keyring.
- Keyring manipulation should not be necessary, but is a good wrench
    to have in ones toolbox.

  - Fixes #195.
2024-02-09 18:53:51 +01:00
Justus Winter
869b7acec8
Move sq keyring lint to sq cert lint.
- It lints certs, so it should go to sq cert.

  - See #192.
2024-02-09 18:52:11 +01:00
Justus Winter
c1618a8aef
Consider certs in the cert store in sq network fetch.
- This considers more aliases from known certificates.

  - Fixes #159.
2024-02-09 18:16:43 +01:00
Justus Winter
f37b366154
Fix documentation. 2024-02-09 18:16:43 +01:00