Commit Graph

1306 Commits

Author SHA1 Message Date
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
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
Neal H. Walfield
a69b8f4921
policy: Update certificates. 2024-03-30 10:00:00 +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 8c47caaee9.
2024-12-03 10:43:16 +01:00
Justus Winter
84928e39d0
Fix resolving --signer-self.
- Fixes 25e99e5afb.

  - 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