1334 Commits

Author SHA1 Message Date
Justus Winter
44d97fc920
Upgrade hickory-proto to avoid vulnerable idna 0.4.0.
- See https://rustsec.org/advisories/RUSTSEC-2024-0421
2024-12-11 12:44:49 +01:00
Justus Winter
01aa4dc06a
Gracefully handle missing ui section in config file.
- Fixes `sq config get` without the [ui] section in the config file,
    while making sure that `sq config get` reflects whether hints are
    displayed.

  - Fixes #495.
2024-12-09 15:21:35 +01:00
Justus Winter
3ab852aba2
Add sq encrypt --profile in preparation for RFC9580.
- Fixes #463.
2024-12-04 16:18:43 +01:00
Justus Winter
6cf2acc893
Add sq key generate --profile in preparation for RFC9580.
- See #463.
2024-12-04 16:17:28 +01:00
Justus Winter
ab01bd9557
Parse key.generate.cipher-suite case sensitively.
- This matches the parsing of the command line parameter.  Let's
    reduce variance.
2024-12-04 15:31:07 +01:00
Justus Winter
9e2af6a92f
Mention the configuration key in the augmented help texts. 2024-12-04 15:15:24 +01:00
Justus Winter
98203e6cd0
Make sq network dane generate require cert designators or --all.
- Fixes #476.
2024-12-04 14:39:20 +01:00
Justus Winter
7397a8a440
Make sq pki link list fail if a designated cert has no link.
- Fixes #484.
2024-12-04 14:04:22 +01:00
Justus Winter
5c2829fa7a
Refactor user ID matching when resolving certificates. 2024-12-04 14:04:22 +01:00
Justus Winter
148b647715
Generalize the filter for `Sq::resolve_certs_filter. 2024-12-04 13:40:01 +01:00
Justus Winter
660d1eb39d
Align sq sign --detached-file with sq verify --detached-file.
- `sq sign --signature-file` now takes a value specifying where the
    signature should be written to.  It conflicts with `--output`.
    This aligns `sq sign` with `sq verify`.

  - Fixes #444.
2024-12-04 12:22:47 +01:00
Justus Winter
cc50bd36ac
Make the default third-party certification expiration configurable.
- Fixes #336.
2024-12-04 11:55:18 +01:00
Justus Winter
2d17692dda
Introduce a specialization for third-party certifications. 2024-12-04 11:55:18 +01:00
Justus Winter
74edd46721
Make ExpirationArg configurable. 2024-12-04 11:55:18 +01:00
Justus Winter
c6eb28eb1b
Manually implement clap::Args for ExpirationArg. 2024-12-04 11:55:18 +01:00
Neal H. Walfield
f0e73deb7f
Add tests for sq pki link list.
- Add tests that check that `sq pki link list` returns an
    appropriate error code.

  - See #484.
2024-12-04 11:22:23 +01:00
Neal H. Walfield
0cc2aba0be
Add tests for sq key list.
- Add tests that check that `sq key list` returns an appropriate
    error code.
2024-12-04 11:22:20 +01:00
Neal H. Walfield
fde96e5790
Listing an empty certificate store should not be an error.
- `sq cert list` on an empty certificate store should not be an
    error.
2024-12-04 11:15:13 +01:00
Neal H. Walfield
500447b804
Fix hint. 2024-12-04 11:15:13 +01:00
Malte Meiboom
a7cbf56067
Hide --without-password from the sq key generate examples.
- The `sq key generate` examples shouldn't include
    `--without-password`, but it is needed for the automated tests.

  - Hide it.
2024-12-04 11:15:12 +01:00
Malte Meiboom
ae0609006c
Make it possible to hide parts of an example.
- Sometimes an example needs an argument to run in an automated way,
    but which the user shouldn't actually use, like
    `--without-password`.

  - Add a mechanism to hide specific arguments.
2024-12-04 11:15:12 +01:00
Justus Winter
f6b4b31976
Change the default third-party certification expiration to 10y.
- Fixes #225.
2024-12-03 20:44:50 +01:00
Justus Winter
1fcdd57d93
Implement sq pki vouch {add,authorize} --certifier-self.
- This selects the default certification key controlled by the
    `pki.vouch.certifier-self` setting.

  - See #336.
2024-12-03 20:32:09 +01:00
Justus Winter
0d37335aad
Improve the --self-signer help texts and add to the template.
- Fixes 25e99e5afb1e2f382e138a4502c9e00641dd903b.
2024-12-03 20:05:40 +01:00
Justus Winter
84a57d45d1
Add a pattern argument to sq pki link list.
- This harmonizes the interface with `sq cert list` and `sq key
    list`.

  - Fixes #210.
2024-12-03 19:21:19 +01:00
Justus Winter
888c82e4ec
Add missing conflict for sq key list. 2024-12-03 19:12:15 +01:00
Neal H. Walfield
0b11ee4ef9
Change sq config inspect network to use stdout.
- Change `sq config inspect network ` to use `stdout`, not `stderr`,
    for its main output.

  - See #342.
2024-12-03 19:03:11 +01:00
Neal H. Walfield
a47a130d42
Change sq config inspect paths to use stdout.
- Change `sq config inspect paths ` to use `stdout`, not `stderr`,
    for its main output.

  - See #342.
2024-12-03 18:59:38 +01:00
Neal H. Walfield
93217dcfd0
Change sq cert import and sq key import to use stdout.
- Change `sq cert import` and `sq key import` to use `stdout`, not
    `stderr`, for their main output.

  - See #342.
2024-12-03 18:59:38 +01:00
Neal H. Walfield
4b76ba2b81
Improve sq network wkd publish's output.
- Add a header to a list so that it doesn't run into the previous
    list.  Consider:

    ```
    $ sq network wkd publish --domain example.org  /tmp/example.org --cert 9889EAA8B493129489EF7D235CE7215F115DA8A6
    Note: Skipping the following certificates because they don't have a valid self-signed user ID in example.org:
     - 9889EAA8B493129489EF7D235CE7215F115DA8A6
     - F57D5B402CEA11F8F22228A64AC1A5F0C16EE42D
       - alice (UNAUTHENTICATED)
       - updated

    1 update applied.
    ```
2024-12-03 18:59:38 +01:00
Neal H. Walfield
a96a1ea538
Change sq network wkd publish to use stdout.
- Change `sq network wkd publish` to use `stdout`, not `stderr`, for
    its main output.

  - See #342.
2024-12-03 18:59:37 +01:00
Neal H. Walfield
de2d022007
Convert a hint to a warning. 2024-12-03 18:59:37 +01:00
Neal H. Walfield
eec362d75f
Change sq network keyserver publish to use stdout.
- Change `sq network keyserver publish` to use `stdout`, not
    `stderr`, for its main output.

  - See #342.
2024-12-03 18:59:37 +01:00
Neal H. Walfield
61e3b67505
Change sq pki link add, etc. to use stdout.
- Change `sq pki link add`, `sq pki link authorize`, `sq pki link
    retract` to use `stdout`, not `stderr`, for their main output.

  - See #342.
2024-12-03 18:59:37 +01:00
Neal H. Walfield
639503bf10
Generalize make_qprintln to write to a different stream.
- Add an optional parameter to `make_qprintln` to make it write to
    an alternate stream, e.g., `stdout`.

  - See #342.
2024-12-03 18:59:37 +01:00
Neal H. Walfield
acbc039031
Change sq pki link list to use stdout.
- Change `sq pki link list` to use `stdout`, not `stderr`, for its
    main output.

  - See #342.
2024-12-03 18:59:37 +01:00
Neal H. Walfield
3ac37dc386
Before printing a hint, flush stdout.
- Hints are printed to `stderr`.  If the output is going to `stdout`
    and `stdout` is a terminal, first flush `stdout` to reduce the
    chance of incorrectly interleaving output and hints.

  - Note: this is a precaution; I haven't observed this happen in
    practice.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
a2beb96123
Change sq cert list, sq pki authenticate, etc. to use stdout.
- Change `sq cert list`, `sq pki authenticate`, `sq pki lookup`, `sq
    pki identify`, and `sq pki path` to use `stdout`, not `stderr`, for
    their main output.

  - See #342.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
8695928157
Generalize the authentication output routines to use any stream.
- `print_path_error`, `print_path_header`, `print_path`, and
    `ConciseHumanReadableOutputNetwork` unconditionally use `stderr`.

  - Change them to take an additional parameter, the stream
    to write to.

  - This change is in preparation for using these functions to write
    to `stdout`.

  - See #342.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
1611150f5c
Change sq key approvals list to use stdout.
- `sq key approvals list`'s main output is the approvals listing.
    Write this to `stdout`, not `stderr`.

  - See #342.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
9c15761f48
Change sq key list to use stdout.
- `sq key list`'s main output is the key listing.  Write this to
    `stdout`, not `stderr`.

  - See #342.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
9b46f2e239
Add new macro wwrintln.
- Add a new macro `wwriteln`, which is like `writeln`, but wraps the
    output.

  - Rewrite `weprintln` to use it.

  - See #342.
2024-12-03 18:59:36 +01:00
Neal H. Walfield
68e3ddf0b9
Generalize weprintln and iweprintln to write to any stream.
- `weprintln` and `iweprintln` unconditionally write to `stderr`.

  - Change the functions to take an additional parameter, the stream
    to write to.

  - Rename the functions to `wwriteln` and `iwwriteln` to reflect that
    the don't just write to `stderr` anymore, and are now closer to
    `writeln`.

  - This change is in preparation for using these functions to write
    to `stdout`.

  - See #342.
2024-12-03 18:59:35 +01:00
Neal H. Walfield
8902710333
Rename wprintln to weprintln.
- This change is in preparation for a `stdout` variant.

  - See #342.
2024-12-03 18:59:23 +01:00
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