Commit Graph

1286 Commits

Author SHA1 Message Date
Neal H. Walfield
7ecc843dee
Add new command sq download.
- Add a new command, `sq download`, which downloads a file and a
    signature file, and then authenticates the file.

  - Fixes #84.
2024-11-09 13:28:17 +01:00
Neal H. Walfield
6697846b78
Don't move when passing a reference will do.
- `commands::pki::authenticate` takes ownership of `sq`, but it only
     needs a reference.

  - Change it accordingly.
2024-11-09 09:19:33 +01:00
Neal H. Walfield
ee1c6f3fcf
Add new argument, --cli-version, to require a CLI version.
- Add a new argument, `--cli-version`, which the user can use to
    request a particular semver-compatible version of the CLI.

  - This enables breaking changes to the CLI, and enables `sq` to
    support multiple CLI versions.

  - Fixes #75.
2024-11-08 11:42:18 +01:00
Neal H. Walfield
f6a8a4ab2c
Rename OutputVersion to Version and move it to its own module.
- Rename `OutputVersion` to `Version`, and move it from the
    `cli::output` module to `cli::types::version` module.
2024-11-08 09:19:27 +01:00
Neal H. Walfield
2c548dfb74
Fix sq toolbox packet dump's help text.
- `sq toolbox packet dump` decrypts any encrypted containers by
    default.  Adjust the documentation accordingly.

  - Fixes #403.
2024-11-07 18:26:17 +01:00
Neal H. Walfield
f48a8ce033
Don't show the progress bar if --batch is specified.
- The progress bar changes the terminal.

  - If `--batch` is specified, `sq` is probably running from a script,
    and we shouldn't change the terminal.

  - Fixes #395.
2024-11-07 14:10:20 +01:00
Neal H. Walfield
53f28f6008
Print out the certificate that decrypted a message.
- When decrypting a message using `sq decrypt`, `sq` shows what
    symmetric and compression algorithms it used when processing the
    message.

  - Also show what certificate was used to decrypt the session key.

  - Fixes #400.
2024-11-07 13:51:10 +01:00
Neal H. Walfield
afe00251a9
Show more information about certificates in sq key list.
- Extend `sq key list`'s human readable output to show if a
    certificate is not valid under the current policy, is expired, or is
    revoked.

  - Fixes #361
2024-11-07 11:16:01 +01:00
Neal H. Walfield
b4976919c5
Normalize output.
- In `sq cert list`'s output, don't say "expired on," just say
    "expired", which matches other messages, like "created"
2024-11-07 11:11:20 +01:00
Neal H. Walfield
aa469739d1
Show more information about certificates in sq cert list.
- Extend `sq cert list`'s human readable output to show if a
    certificate is not valid under the current policy, or is revoked.

  - Fixes #409
2024-11-07 10:48:58 +01:00
Neal H. Walfield
2ae1885971
Finish renaming attestation to approval.
- See 49b7f25cc4.

  - Fixes #417.
2024-11-07 08:41:44 +01:00
Neal H. Walfield
cf09d2f7a2
Make sq key expire's expiration argument required.
- `sq key expire`'s expiration argument was accidentally made
    optional in 4aeee1c266.  Fix it.

  - Fixes #420.
2024-11-06 16:13:23 +01:00
Neal H. Walfield
ff3fff850c
Use key designators for sq key subkey revoke.
- Port `sq key subkey revoke` to the key designator framework.

  - Extend the key designator framework to support only addressing
    subkeys.
2024-11-06 16:12:05 +01:00
Neal H. Walfield
f817cb4a4a
Fix documentation.
- `sq key subkey revoke` can only revoke subkeys; it can't revoke
    primary keys.
2024-11-06 16:10:44 +01:00
Neal H. Walfield
4d5b807f61
Use key designators for sq key subkey {delete,password}.
- Port `sq key subkey delete` and `sq key subkey password` to the
    key designator framework.
2024-11-06 16:08:33 +01:00
Neal H. Walfield
f139b50f24
Change sq key subkey export to require the certificate to export.
- `sq key subkey export` currently takes a list of keys to export.
    This is ambiguous if a key is associated with multiple certificates.

  - Add a new required parameter, `--cert`, which specifies what
    certificate to export.  The specified keys must be attached to that
    certificate under the NULL policy.

  - This change means that `sq key subkey export` can only export a
    single certificate at a time.

  - As the implementations of `sq key export` and `sq key subkey
    export` have diverged, don't try to consolidate them any more.

  - Fixes #386.
2024-11-06 16:08:02 +01:00
Neal H. Walfield
b5b27aa366
Move the bind module.
- The bind module is used by `sq key subkey bind`.  Move it under
    `commands:🔑:subkey`.
2024-11-06 16:07:09 +01:00
Neal H. Walfield
d21d38e6b4
Move the sq key subkey revoke implementation to its own module. 2024-11-06 16:06:12 +01:00
Neal H. Walfield
87cadfe889
Move the sq key subkey expire implementation to its own module. 2024-11-06 16:03:55 +01:00
Neal H. Walfield
4cfea470b8
Move the sq key subkey password implementation to its own module. 2024-11-06 16:03:00 +01:00
Neal H. Walfield
70f7a6f402
Move the sq key subkey delete implementation to its own module. 2024-11-06 16:02:01 +01:00
Neal H. Walfield
c665065821
Move the sq key subkey export implementation to its own module. 2024-11-06 16:00:27 +01:00
Neal H. Walfield
3824be8bbf
Move the sq key subkey add implementation to its own module. 2024-11-06 15:59:29 +01:00
Neal H. Walfield
cbe7eb1402
Move cli parser for sq key subkey bind to its own module. 2024-11-06 15:58:29 +01:00
Neal H. Walfield
909016e3ae
Move cli parser for sq key subkey revoke to its own module. 2024-11-06 15:57:32 +01:00
Neal H. Walfield
0dce5d9693
Move cli parser for sq key subkey expire to its own module. 2024-11-06 15:56:13 +01:00
Neal H. Walfield
ea6db79f7b
Move cli parser for sq key subkey password to its own module. 2024-11-06 15:55:17 +01:00
Neal H. Walfield
215051da86
Move cli parser for sq key subkey delete to its own module. 2024-11-06 15:53:59 +01:00
Neal H. Walfield
79defd3fdf
Move cli parser for sq key subkey export to its own module. 2024-11-06 15:52:18 +01:00
Neal H. Walfield
0dffab8d50
Move cli parser for sq key subkey add to its own module. 2024-11-06 15:51:08 +01:00
Neal H. Walfield
26c14e1a54
Add a new key designator type.
- Add a new designator type, `KeyDesignator`, which is like
    `CertDesignator` and `UserIDDesignator`, but resolves to keys.

  - Move the resolution machinery from the expiry functionality to
    `Sq::resolve_keys`.

  - Switch `sq key subkey expire` to use it.
2024-11-06 15:51:06 +01:00
Neal H. Walfield
ab26585972
Use more qualified names to reduce ambiguity.
- Don't import `ArgumentPrefix`, etc. from the `cert_designator`
    module, import the module and call it
    `cert_designator::ArgumentPrefix`.

  - This will reduce ambiguity when using other designator types.
2024-11-06 15:49:17 +01:00
Neal H. Walfield
26c70cad32
Don't extend the expiration of invalid components.
- If a component is not valid according to the policy, don't extend
    the expiration time.  Suggest using `sq cert lint`, and then error
    out.

  - Fixes #363.
2024-11-04 11:26:02 +01:00
Neal H. Walfield
ed7b1ef806
Change sq key subkey bind to use the expriation type.
- `sq key subkey bind` still instantiated its own expiration
    parameter.  Change it to use `ExpirationArg` instead.
2024-11-03 09:23:41 +01:00
Neal H. Walfield
70e4935e8d
Extend Time to support relative timestamps.
- Move the duration parsing code from `Expiration` to `Time`, which
    `Expiration` already uses for absolute timestamps.

  - Support negative durations, and to be more precise rename the
    `Duration` variant to `Offset`.

  - Fixes #268.
2024-11-03 09:09:21 +01:00
Neal H. Walfield
7154aa1eaf
Move the Time type to its own module. 2024-11-02 10:50:05 +01:00
Neal H. Walfield
27c52d609f
Make it clearer that we don't support ISO 8601 durations.
- ISO 8601 durations are ambiguous, and complicated.

  - Clarify that we don't support them.

  - Fixes #119.
2024-10-31 15:22:37 +01:00
Neal H. Walfield
4aeee1c266
Dry out sq key expire's expiration argument.
- Change `sq key expire`'s CLI definition to use the `ExpirationArg`
    type to reduce repetition.

  - See also 67b022f9fa.
2024-10-31 15:22:20 +01:00
Jens Reimann
4f73627020
Add a global option, --policy-as-of, to select a crypto policy.
- When working with older messages, it may be necessary to use a
    different cryptographic policy.  Add an option, `--policy-as-of`, to
    select the cryptographic policy that was in effect at the specified
    time.

  - Fixes #123.

Co-authored-by: Neal H. Walfield <neal@sequoia-pgp.org>
2024-10-31 15:08:55 +01:00
Neal H. Walfield
0889d18da7
If decryption fails, delete the output file.
- Change `sq decrypt` to delete the output file if decryption fails.

  - Fixes #59.
2024-10-31 12:34:09 +01:00
Neal H. Walfield
fae8f689a2
tests: Generalize Sq::encrypt and Sq::decrypt to work with files.
- `Sq::encrypt` and `Sq::decrypt` only work with in-memory buffers.

  - Introduce `FileOrBytes`, which represents a path or bytes.  Change
    `Sq::encrypt` and `Sq::decrypt` to use them, and thus support
    messages stored in files in addition to inline messages.
2024-10-31 12:30:30 +01:00
Neal H. Walfield
e4c40da649
If signature verification fails, delete the output file.
- Change `sq verify` to delete the output file if it can't
    authenticate the signature.

  - See #59.
2024-10-31 12:30:28 +01:00
Neal H. Walfield
cedd9687d1
Add support for merging bare revocation certificates.
- Extend `sq toolbox keyring merge` to merge bare revocation
    certificates.

  - Fixes #50.
2024-10-31 10:01:45 +01:00
Neal H. Walfield
1376c8b4ee
Dry out the keyring merge function. 2024-10-31 10:01:45 +01:00
Neal H. Walfield
1c96be5f62
Release 0.39.0. 2024-10-30 17:02:34 +01:00
Neal H. Walfield
0bb0960757
Loosen reqwest dependency.
- Allow using newer versions of reqwest.  Don't actually use them,
    as other dependencies still require the older version.
2024-10-30 16:59:30 +01:00
Neal H. Walfield
e724dad138
Loosen subplot dependency.
- Allow using newer versions of subplot (but don't actually use them
    as they have a higher MSRV).
2024-10-30 16:53:57 +01:00
Neal H. Walfield
fa5750cb49
Upgrade terminal_size. 2024-10-30 16:43:48 +01:00
Neal H. Walfield
93549fd108
Upgrade sequoia-policy-config. 2024-10-30 16:36:53 +01:00
Neal H. Walfield
5ee0ff8d01
Update Cargo.lock. 2024-10-30 16:34:21 +01:00