Commit Graph

1407 Commits

Author SHA1 Message Date
Justus Winter
2d8ee7a146
Apply the cert filter only once.
- Fixes ec933036dd.
2024-10-09 16:57:48 +02:00
Justus Winter
d4ce7ac095
Add tests for sq toolbox keyring filter. 2024-10-09 16:57:48 +02:00
Justus Winter
fcfbfb73b6
Run tests in a separate working directory.
- This way they can create artifacts in their working directory.
2024-10-09 16:57:48 +02:00
Justus Winter
0e5b1c0611
Deduplicate function to locate test artifacts. 2024-10-09 16:57:48 +02:00
Neal H. Walfield
62d7813900
Change sq pki certify to reject expired and revoked certs.
- It was possible to use `--allow-not-alive-certifier` and
    `--allow-revoked-certifier` to force `sq pki certify` to use
    expired and revoked certificates.

  - Consistent with the principle that `sq` should support a lot, but
    not everything, remove them.

  - Fixes #365.
2024-10-09 14:57:02 +02:00
Justus Winter
79b3f035f1
Don't word-wrap commands in hints. 2024-10-08 18:49:47 +02:00
Justus Winter
aadf406c9e
Fix hints emitted when fetching certs from the network.
- Fixes #330.
2024-10-08 18:46:08 +02:00
Justus Winter
a22f40410a
Improve hint formatting. 2024-10-08 18:45:48 +02:00
Justus Winter
54b0613e19
Add an explicit output parameter for sq toolbox packet split.
- Fixes #357.
2024-10-08 16:14:13 +02:00
Justus Winter
fb0680ff30
Align the value-name for --home. 2024-10-08 16:14:13 +02:00
Justus Winter
fce1bc2110
Add an ENVIRONMENT section to the top-level man page. 2024-10-08 16:14:13 +02:00
Justus Winter
6517b63378
Rename environment variables to override cert and key store.
- This makes them more consistent with the other environment
    variables SEQUOIA_HOME and SEQUOIA_CRYPTO_POLICY.

  - Fixes #364.
2024-10-08 16:14:09 +02:00
Justus Winter
907a16caa2
Use a custom CLI parser for state directories.
- Add and use a custom value parser for absolute directories with
   explicit default for --home, --cert-store, and --key-store.

 - If `default` is given, this parses to `None`.  If an empty path is
   given, a hint is displayed to give `default` instead.

 - If a relative path is given, a hint is displayed to use an
   absolute path instead.

 - Fixes #299.
2024-10-08 15:10:13 +02:00
Neal H. Walfield
4dde1b2928
Improve documentation for sq key expire and sq key subkey expire. 2024-10-08 12:06:38 +02:00
Neal H. Walfield
5e80d02b5e
Don't extend the expiration of subkeys that are hard revoke.
- If a subkey is hard revoked, refuse to extend the expiration.
2024-10-08 11:46:07 +02:00
Neal H. Walfield
7862c1609f
Add a unit test for sq key subkey expire for soft revocations.
- Check that `sq key subkey expire` extends the expiration of a
    subkey that is soft revoked.
2024-10-08 11:42:33 +02:00
Neal H. Walfield
b266d9dea1
Add a unit test for sq key subkey expire for unbound subkeys.
- Check that `sq key subkey expire` won't extend the expiration of a
    subkey that isn't bound.

  - Improve the error message when this happens.
2024-10-08 11:42:27 +02:00
Neal H. Walfield
f6d62ab749
Normalize naming.
- Make the code (and output) less confusing by normalizing names.
2024-10-08 11:41:53 +02:00
Neal H. Walfield
7292c6c347
Fix setting a certificate's expiration time.
- When setting a certificate's expiration time, we update each user
    ID's self signature.  If a user ID is revoked, creating a new self
    signature will "unrevoke it."

  - Skip user IDs that are revoked.
2024-10-08 10:52:33 +02:00
Neal H. Walfield
9a2f2bc72b
Fix setting a certificate's expiration time.
- When setting a certificate's expiration time, we update the
    direct key signature, and each user ID's self signature.  This
    fails if a user ID doesn't have a valid self signature.

  - User IDs, however, don't need to be self signed!  For instance, a
    user ID may only have a third-party certification.

  - Relax `sq key expire` to only add a self signature for a user ID,
    if the user ID already has a self signature.
2024-10-08 09:30:51 +02:00
Justus Winter
5620da1a10
Fix documentation. 2024-10-07 15:45:10 +02:00
Justus Winter
b767f1f445
Fix capitalization of example section in help texts. 2024-10-07 15:45:06 +02:00
Justus Winter
55b3d988ff
Port cert lint examples to the example framework. 2024-10-07 15:41:19 +02:00
Justus Winter
e0ec6de2e2
Port keyring examples to the example framework. 2024-10-07 15:27:28 +02:00
Justus Winter
d6a69aca72
Implement examples containing pipelines. 2024-10-07 15:27:28 +02:00
Justus Winter
43edb2c190
Add missing example data file bob.pgp.
- The README mentions it, but it is missing.
2024-10-07 15:27:28 +02:00
Justus Winter
f35af0c9b2
Port dearmor examples to the example framework. 2024-10-07 15:27:28 +02:00
Justus Winter
834b5afe86
Port armor examples to the example framework. 2024-10-07 15:27:28 +02:00
Justus Winter
842f708e8a
Port extract-cert examples to the example framework. 2024-10-07 15:27:27 +02:00
Justus Winter
c3b2e86223
Port link examples to the example framework. 2024-10-07 15:27:27 +02:00
Justus Winter
16eb8aef3a
Fix line wrapping when printing examples. 2024-10-07 15:27:27 +02:00
Neal H. Walfield
43885a05b5
Update futures-util (and related packages).
- `futures-util` 0.3.30 was yanked.  Update to the latest version.
2024-10-07 14:07:29 +02:00
Neal H. Walfield
fd35509784
Don't call exit, just return an error.
- Never call `exit`.  If there is an error, propagate the error to
    the caller.  This ensures that any clean up handlers (like
    flushing state to disk) are run.
2024-10-07 13:28:24 +02:00
Neal H. Walfield
fd37c3d675
Fix example.
- Make the example match the description.
2024-10-07 13:28:24 +02:00
Justus Winter
4f1ecb61a2
Use cert designators for sq network keyserver publish.
- Fixes #272.
2024-10-04 17:52:56 +02:00
Justus Winter
7bab5aeafb
Use cert designators for sq network wkd publish.
- See #272.
2024-10-04 17:43:28 +02:00
Justus Winter
08c19ed924
Use cert designators for sq network dane generate.
- See #272.
2024-10-04 17:35:57 +02:00
Justus Winter
3b27efa629
Prevent cert designators from over-eagerly grabbing other options. 2024-10-04 17:34:54 +02:00
Justus Winter
8afc4a264c
Fix composing cert designators. 2024-10-04 17:34:33 +02:00
Justus Winter
00e70148e3
Make the domain argument a long argument like in wkd publish. 2024-10-04 16:45:13 +02:00
Justus Winter
c27988f586
Improve listing of secret keys.
- Changes the format to a certificate-centric view.  I believe we
    should present the data aligned with the OpenPGP concepts, and the
    device tree structure, or where the secret key material resides,
    is an implementation detail.

  - Where the secret key material resides is an important detail that
    we should still show, of course, but it shouldn't be the basis of
    the structure we show.

  - Incidentally, this greatly improves how user IDs are related to
    certificates, and what happens if a subkey is bound to two
    certificates.  Hence, it fixes #334.

  - In addition to the best user ID, we show key creation times to
    help users differentiate between old and new keys.

  - We print the fingerprints on a line on their own in preparation
    for the considerably longer RFC 9580 fingerprints.

  - We use data structures that naturally order their items, resulting
    in a predictable output order.

  - Fixes #292.
2024-10-04 16:22:10 +02:00
Justus Winter
7ed26a805d
Fix argument name computation.
- Fixes ba121b2339.
2024-10-04 11:54:55 +02:00
Justus Winter
20df76538e
Rename sq encrypt --recipient to sq encrypt --for`.
- Fixes #356.
2024-10-04 11:54:53 +02:00
Justus Winter
ba121b2339
Rename --recipient-cert to --recipient.
- Fixes #355.
2024-10-04 11:16:33 +02:00
Justus Winter
20fb370de7
Rename --signer-key to --signer.
- See #355.
2024-10-04 11:16:24 +02:00
Justus Winter
dff6664f47
Rename the global --force flag to --overwrite.
- This flag now only controls whether existing files are
    overwritten.

  - Fixes #31.
2024-10-02 18:42:31 +02:00
Justus Winter
80d51a9a87
New flag sq pki link add --recreate instead of --force.
- Likewise for `sq pki link retract --recreate`.

  - See #31.
2024-10-02 18:40:29 +02:00
Justus Winter
527e207067
New flag sq key userid revoke --add-userid instead of --force.
- See #31.
2024-10-02 18:37:28 +02:00
Justus Winter
fc76b99c55
Make the file creation utilities take a reference to Sq. 2024-10-02 18:05:40 +02:00
Justus Winter
7b05d6ad49
Move some file support code so that it can use Sq. 2024-10-02 17:58:31 +02:00