Commit Graph

1147 Commits

Author SHA1 Message Date
Neal H. Walfield
5a500f8fee
Rename sq toolbox armor to sq packet armor.
- See #326.
2024-11-16 10:09:56 +01:00
Neal H. Walfield
d46844ca35
Move sq toolbox packet to sq packet.
- Make `sq packet` a top-level subcommand.

  - See #326.
2024-11-16 10:07:07 +01:00
Neal H. Walfield
e1a4fa656c
Move sq toolbox keyring to sq keyring.
- Make `sq keyring` a top-level subcommand.

  - See #326.
2024-11-16 10:06:59 +01:00
Neal H. Walfield
050bba99f8
Fix comment. 2024-11-16 07:13:29 +01:00
Neal H. Walfield
8e41fb7cd4
tests: Fix check.
- When checking if there are any user ID arguments, also check for
    `--userid`.
2024-11-16 07:12:13 +01:00
Neal H. Walfield
574dcf9b22
Show standard usage if no arguments are supplied to sq cert export.
- `sq cert export` uses a custom error message if the user does not
    designate any certificates.

  - Instead, require that the user designate using clap, which prints
    a nicer error message if this is violated.
2024-11-15 20:59:15 +01:00
Neal H. Walfield
b76cec64b6
Port sq toolbox userid-strip to the user ID designator framework.
- Fixes #434.
2024-11-15 20:43:50 +01:00
Neal H. Walfield
4dbeebc045
Port sq cert list and two more to the user ID designator framework.
- Port `sq cert list`, `sq pki authenticate` and `sq pki lookup` to
    the user ID designator framework.  See #434.

  - This changes the user ID parameter from a positional parameter
    to a named parameter, and drops the `--email` flag.  See #318.
2024-11-15 17:47:05 +01:00
Neal H. Walfield
472ba5a3a7
Upgrade sequoia-wot.
- Upgrade to the 0.13.2, which includes a fix that the next change
    requires.
2024-11-15 17:45:55 +01:00
Neal H. Walfield
b655bb2730
Move the authenticate function to its own module under common.
- Move `commands::pki::authenticate` to `common::pki::authenticate`.

  - Also move the output module.
2024-11-15 16:17:49 +01:00
Neal H. Walfield
f419837b31
Improve the format of error messages for failing examples.
- Compiler error messages are usually formatted as follows:

    PROGRAM:FILE_NAME:LINENO: MESSAGE

  - When an example fails, format it accordingly.

  - This has the advantage that IDEs like emacs can jump to the
    specified location.
2024-11-15 11:04:39 +01:00
Neal H. Walfield
10cb342612
Revise the authenticate code's linting.
- `commands::pki::authenticate` is now given the certificate to
    authenticate.  Revise the linting code to take advantage of this.
2024-11-15 11:04:38 +01:00
Neal H. Walfield
2e17dec9ad
Port sq pki {authenticate,identify} to the cert designator framework.
- Port `sq pki authenticate` and `sq pki identify` to the cert
    designator framework.  See #207.

  - This changes the certificate parameter from a positional parameter
    to a named parameter.  See #318.
2024-11-15 11:04:38 +01:00
Neal H. Walfield
d561fad1a6
Move the sq pki identify cli definition to its own module. 2024-11-14 21:09:53 +01:00
Neal H. Walfield
dd7345340b
Move the sq pki lookup cli definition to its own module. 2024-11-14 21:09:52 +01:00
Neal H. Walfield
64aaa04914
Move the sq pki authenticate cli definition to its own module. 2024-11-14 21:09:42 +01:00
Justus Winter
beb850a673
Improve documentation.
- Fixes 14f4c8fd3a.
2024-11-14 17:35:30 +01:00
Justus Winter
64ab3c6dd3
Expand ~ in state directories.
- Fixes #391.
2024-11-14 17:30:41 +01:00
Justus Winter
0a8ba2b3f7
Make sq encrypt --set-metadata-filename take a simple string.
- Previously, the file name was constructed from the path of the
    input file, using some transformations that may be considered
    surprising (notably, the file name of unspecified encoding was
    transformed into UTF-8 using a lossy mechanism).

  - Avoid this opaque transformation by taking an explicit string
    argument.

  - Fixes #351.
2024-11-14 16:55:42 +01:00
Justus Winter
b916a13426
Remove sq encrypt --set-metadata-time.
- The literal data packet's time field is problematic for a variety
    of reasons.  The previous timestamp interface allows a number of
    time sources (ctime, mtime, message time (that is way better
    encoded in the signature creation time), explicit timestamp), but
    the information about what kind of timestamp this should be is
    lost when the time is encoded, without warning.

  - Remove it.

  - See #351.
2024-11-14 16:55:41 +01:00
Neal H. Walfield
f16ef5d878
Port sq pki path to the user ID designator framework.
- Port `sq pki path` to the user ID designator framework.
    See #434.

  - This change adds two new additional arguments, `--email` and
    `--name`.
2024-11-14 16:48:49 +01:00
Neal H. Walfield
24f12c6fd8
Add support for adding a user ID by display name.
- Extend the user ID designator framework to allow designating a
    self-signed user ID by its display name, or adding a new user ID
    if none match.
2024-11-14 16:48:49 +01:00
Neal H. Walfield
0e36a20d97
Make sq pki path's user ID argument a named argument.
- See #318.
2024-11-14 16:48:49 +01:00
Neal H. Walfield
428e4dbde3
Move the sq pki path cli definition to its own module. 2024-11-14 16:48:49 +01:00
Neal H. Walfield
4095e19529
Move the sq pki path implementation to its own module. 2024-11-14 16:48:49 +01:00
Justus Winter
ec80c67e47
Make sq download --output mandatory.
- Fixes #438.
2024-11-14 16:24:43 +01:00
Neal H. Walfield
435b127e5f
Port sq key userid revoke to the user ID designator framework.
- Port `sq key userid revoke` to the user ID designator framework.
    See #434.

  - This replaces the `--add-userid` flag with the `--add-userid`,
    `--add-email` and `--add-name` arguments.  See #318.

  - This change also makes a user ID mandatory, which fixes #428.
2024-11-14 11:30:29 +01:00
Neal H. Walfield
58ccedb655
Add support for adding a user ID by display name.
- Extend the user ID designator framework to allow designating a
    self-signed user ID by its display name, or adding a new user ID
    if none match.
2024-11-14 11:30:29 +01:00
Neal H. Walfield
c236b3bbab
When printing self-signed user IDs, also show invalid user IDs.
- When `UserIDDesignators::resolve` fails to resolve a user ID, it
    prints a list of valid self-signed user IDs.  If there are also
    invalid user IDs according to the current policy, print those and
    indicate that they are invalid.
2024-11-14 11:30:28 +01:00
Neal H. Walfield
9712dc5cc6
Port sq key approvals update to the user ID designator framework.
- See #434.
2024-11-14 11:30:28 +01:00
Neal H. Walfield
c7795149c2
Port sq key approvals list to the user ID designator framework.
- See #434.
2024-11-14 11:30:28 +01:00
Neal H. Walfield
b203dacd00
Add support for designating a self-signed user ID by display name.
- Extend the user ID designator framework to allow designating a
    self-signed user ID by its display name.
2024-11-14 11:30:28 +01:00
Neal H. Walfield
75dcd33193
Improve naming.
- Rename the user ID designator types to make them a bit clearer.
2024-11-14 11:30:28 +01:00
Justus Winter
ae36aaccf0
Optimize downloading of data files with detached signatures. 2024-11-13 17:20:12 +01:00
Justus Winter
c1cad320e7
Forbid --output when verifying detached signatures.
- Fixes #410.
2024-11-13 17:07:23 +01:00
Justus Winter
5e56f23a59
Add note. 2024-11-13 17:06:52 +01:00
Neal H. Walfield
a8567be5ed
Cause sq download to fail faster if the output file can't be used.
- Open the output file before downloading anything so that we fail
    earlier.
2024-11-13 16:36:22 +01:00
Justus Winter
4d5e481b08
Split the argument sq network wkd publish --create into two.
- This avoids an ambiguity when parsing the arguments.

  - Fixes #426.
2024-11-13 15:19:46 +01:00
Justus Winter
cc244afd79
Use cert designators for the signer arguments of sq encrypt.
- Fixes #429.
2024-11-13 15:08:11 +01:00
Justus Winter
359245db14
Use cert designators for the signer arguments of sq sign.
- See #429.
2024-11-13 15:08:11 +01:00
Neal H. Walfield
6645fdee6c
Change --email and --add-email to only match user IDs unambiguously.
- Commands like `sq pki vouch certify` allow designating a user ID
    by email address.  Currently, if multiple self-signed user IDs
    include the specified email address, all are used.  Change the
    semantics of `--email` and --add-email` to only match
    unambiguously.

  - Fixes #309.
2024-11-13 14:29:32 +01:00
Justus Winter
78d8538707
Add sq sign --mode to create binary or text signatures.
- Fixes #390.
2024-11-13 14:08:57 +01:00
Neal H. Walfield
9eb0f0754e
Change --add-userid from a flag to two arguments.
- `sq pki link add`, `sq pki link authorize`, `sq pki vouch
    certify`, and `sq pki vouch authorize` have a `--add-userid` flag.

  - Replace the `--add-userid` flag with an `--add-userid` argument,
    and an `--add-email` argument.

  - This change means that a flag does not change how an argument is
    interpreted.  It also makes it more explicit whether a user ID
    should be added, because `--userid` and `--email` could be given
    multiple times.

  - See #309 and #318.
2024-11-13 13:51:35 +01:00
Neal H. Walfield
eabbd68240
Generalize active_certifications.
- `active_certifications` returns what user IDs match.  Sometimes it
    is useful to preserve additional details.

  - This can be fixed by changing `active_certifications` to take
    something that implements `AsRef<UserID>` instead of taking
    `UserID`s directly.  Unfortunately, we can't use the standard
    `AsRef` trait, because `UserID` doesn't implement `AsRef`, and due
    to the orphan rule, we change implement it ourselves.  As thus,
    introduce a local copy of `AsRef` and use that instead.
2024-11-13 13:19:42 +01:00
Neal H. Walfield
267a3d3481
tests: When calling sq pki authenticate include --show-paths.
- When `sq pki authenticate` fails, it is helpful to see as much
    details as possible.  As such, include `--show-paths` when calling
    `sq pki authenticate`.  `--show-paths` shows more information, but
    doesn't change the command's behavior.
2024-11-13 13:19:41 +01:00
Neal H. Walfield
fbd7f260e7
tests: Abstract user ID argument passing.
- Add a new type, `UserIDArg`, which represents a user ID argument.

  - Change functions that take user IDs like `Sq::key_generate` to use
    it.
2024-11-13 13:19:40 +01:00
Justus Winter
82a5f13a96
Drop debugging remnant. 2024-11-13 12:38:05 +01:00
Justus Winter
14f4c8fd3a
Replace --no-cert-store and --no-key-store.
- Replace the flag `sq --no-cert-store` with `sq
     --cert-store=none`.

   - Replace the flag `sq --no-key-store` with `sq --key-store=none`.

   - Similarly, `sq --home=none` disables all state, unless explicitly
     re-enabled using `--cert-store` or `--key-store`.

   - Fixes #427.
2024-11-13 12:34:53 +01:00
Justus Winter
5414ceec07
Make home directory optional. 2024-11-13 12:04:49 +01:00
Justus Winter
b8dba63d39
Introduce accessors. 2024-11-13 11:52:59 +01:00