Commit Graph

1037 Commits

Author SHA1 Message Date
Neal H. Walfield
60892e6cee
Remove redundant long_about.
- If `long_about` is not set, `about` is used.  Since they are the
    same, remove `long_about`.
2024-09-26 16:00:29 +02:00
Neal H. Walfield
1348398e27
Fix hint. 2024-09-26 16:00:29 +02:00
Neal H. Walfield
0cb7f36162
Fix long about strings so that they line wrap.
- Line wrapping works on a line-by-line basis, not a paragraph
    basis.  As such, we need to escape newlines in order for line
    wrapping to work.
2024-09-26 16:00:29 +02:00
Neal H. Walfield
ed440f33f4
Escape newlines in help text to enable automatic line wrapping. 2024-09-26 16:00:29 +02:00
Neal H. Walfield
cc0598078c
Fix spelling. 2024-09-26 16:00:28 +02:00
Justus Winter
db4986e7df
Don't dump bad signatures by default, add CLI switch for that.
- Fixes #244.
2024-09-26 15:41:17 +02:00
Justus Winter
8b391314e3
Dump bad signatures. 2024-09-26 15:41:17 +02:00
Justus Winter
61f790c12c
Rework indentation in the inspect module. 2024-09-26 15:41:17 +02:00
Justus Winter
d02541558a
Refactor signature dumping. 2024-09-26 15:41:17 +02:00
Justus Winter
c3a7546120
Refactor key dumping. 2024-09-26 15:41:17 +02:00
Neal H. Walfield
99689fd405
When adopting a key, if the creation time is unset, set it.
- When adopting a bare key, the creation time is the Unix epoch.
    If the user doesn't manually override this using
    `--creation-time`, use the current time (while respecting
    `--time`).
2024-09-26 13:07:28 +02:00
Neal H. Walfield
6451e0416f
Add the --creation-time argument to sq key adopt.
- Add an argument to `sq key adopt`, `--creation_time`, to allow the
    user to override the key's creation time.
2024-09-26 13:06:34 +02:00
Neal H. Walfield
33dc4a1b41
When adopting a key, error out if the key's key flags is empty.
- When adopting a key using `sq key adopt`, error out if the key's
    key flags are empty.
2024-09-26 13:05:36 +02:00
Neal H. Walfield
5ec89e8abe
Allow modifying the key flags when adopting a key.
- Add `--can-sign`, `--cannot-sign`, `--can-authenticate`,
    `--cannot-authenticate`, `--can-encrypt`, `--cannot-encrypt` to `sq
    key adopt`, which modify the key flags of the adopted key.
2024-09-26 13:05:36 +02:00
Neal H. Walfield
331da9d600
Don't require a key being adopted to have a binding signature.
- Change `sq key adopt` to not require the key that is being adopted
    to have a binding signature.

  - This allows adopting "bare keys," i.e., a certificate consisting
    of just a primary key.  Bare keys are useful when working with raw
    keys, e.g., keys generated on an OpenPGP card, a TPM device, etc.
    To add them to a certificate, they just need to be wrapped in a
    minimal amount of OpenPGP framing; no signatures are required.

  - Fixes #25.
2024-09-26 13:05:36 +02:00
Neal H. Walfield
726dedc553
Make the test helper function Sq::key_adopt more consistent.
- Make `Sq::key_adopt` more consistent with other functions by
    providing an `Sq::key_adopt_maybe` version, which panics on failure.
2024-09-26 09:43:44 +02:00
Neal H. Walfield
ce59c45165
Simplify how tests call sq key adopt.
- Remove rarely used arguments from `Sq::key_adopt`.  They can be
    provided via the `extra_args` argument when needed.
2024-09-26 09:34:35 +02:00
Neal H. Walfield
c610ba19fa
Allow tests to pass addition arguments to sq key adopt.
- Add an argument to `Sq::key_adopt`, `extra_args`, to allow tests
    to pass additional, arbitrary arguments to `sq key adopt`.
2024-09-26 09:20:50 +02:00
Neal H. Walfield
048be9c08c
Tighten the sq encrypt tests.
- When designating a certificate multiple times, the certificate
    should only be used once.  Assert that this is the case in the `sq
    encrypt` tests by checking that the PKESKs are not redundant.

  - Note: this was fixed by 437ae24.
2024-09-25 13:16:27 +02:00
Neal H. Walfield
437ae24917
Switch sq encrypt to the certificate designator abstraction.
- Use `CertDesignators` to expose `sq encrypt`'s certificate
    designator arguments.
2024-09-25 13:15:57 +02:00
Neal H. Walfield
d8ad8dcd42
Switch sq cert export to the certificate designator abstraction.
- Use `CertDesignators` to expose `sq cert export`'s certificate
    designator arguments.
2024-09-25 13:15:57 +02:00
Neal H. Walfield
9a46a12a79
Fix sq cert export test vector.
- A `sq cert export` test vector specified `--email
    carol@example.org`, which doesn't match any certificates.  The error
    was hidden, because we were not strict about ensuring that all
    certificate designators actually match at least one certificate.

  - Fix the test vector.
2024-09-25 13:15:57 +02:00
Neal H. Walfield
16aaab33b9
Add a certificate designator abstraction.
- Add a new type, `CertDesignators`, which can be flattened into a
    clap subcommand, and exposes one or more certificate designator
    arguments (`--file`, `--cert`, `--userid`, `--userid`, `--domain`,
    and `--grep`) with an optional prefix (e.g., it transforms `--file`
    into `--cert-file`).

  - See #207.
2024-09-25 13:15:57 +02:00
Neal H. Walfield
0592a4041b
Add a test for sq encrypt for revoked subkeys.
- Add a test for `sq encrypt` that checks that an attempt to use
    a revoked subkey results in an error.
2024-09-25 13:15:57 +02:00
Neal H. Walfield
b8d02f2216
Add a test for sq encrypt for expired subkeys.
- Add a test for `sq encrypt` that checks that an attempt to use
    an expired subkeys results in an error unless
    `--use-expired-subkey` is provided.
2024-09-25 13:15:46 +02:00
Neal H. Walfield
5bc7a81045
Add a test for sq encrypt for non-encryption-capable certifications.
- Add a test for `sq encrypt` that checks that an attempt to use
    a certificate that is not encryption-capable results in an error.
2024-09-25 13:15:32 +02:00
Neal H. Walfield
3965167ac0
Add a test for sq encrypt's certificate designators.
- Add a test for `sq encrypt` that checks that the different ways of
    designating a certificate work including making sure that only
    authenticated names can be used to designate a certificate.
2024-09-25 13:09:58 +02:00
Neal H. Walfield
42f43f656e
Port sq_encrypt.rs to the common test framework. 2024-09-25 12:18:44 +02:00
Justus Winter
f88b433d8b
Move implementation, add NEWS entry.
- Fixes e2d5bc1de4.
2024-09-24 15:10:29 +02:00
Justus Winter
e2d5bc1de4
Move sq key userid strip to sq toolbox strip-userid.
- Fixes #306.
2024-09-16 16:16:32 +02:00
Neal H. Walfield
9cfc2e9a16
Make sq key expire more robust.
- When updating a component's expiration, we collect the new self
    signatures in a vector, append them to the certificate using
    `Cert::insert_packets`, and rely on canonicalize to reorder them.

  - To make reordering simpler and more robust (see issue #1125 in
    sequoia-openpgp), precede the new self signature by a copy of the
    component.

    https://gitlab.com/sequoia-pgp/sequoia/-/issues/1125
2024-09-16 15:35:54 +02:00
Neal H. Walfield
292b32fc65
Improve debugging output. 2024-09-16 15:35:54 +02:00
Neal H. Walfield
910edc96f6
Add a convenience function to preserve a test's state.
- Add `Sq::preserve` to prevent the files created by an `Sq`
    instance from being deleted when the `Sq` instance is dropped.

  - Preserving the state makes it easier to debug a test that is
    failing.
2024-09-16 15:35:47 +02:00
Justus Winter
7d6040b5ad
Improve comments of revocation certificates. 2024-09-16 15:22:08 +02:00
Justus Winter
b1f8e5e38a
Wrap comment lines in revocation certificates. 2024-09-16 15:02:28 +02:00
Justus Winter
2c4ecbb41e
Align sq key subkey expire and sq key subkey revoke.
- Make the latter take a named --key argument that can be given
    multiple times.

  - Fixes #329.
2024-09-16 15:01:24 +02:00
Justus Winter
719f282544
Move the sq key subkey CLI parser to its own module. 2024-09-16 14:14:32 +02:00
Justus Winter
d31eea691e
Move the sq key revoke CLI parser to its own module. 2024-09-16 14:04:07 +02:00
Justus Winter
6034e03893
Avoid using the system-wide crypto policy in tests.
- Fixes #177.
2024-09-16 12:53:33 +02:00
Justus Winter
5b1336c4e1
Implement sq --quiet.
- Also, go over the commands and change some prints to be disabled
    when --quiet is given, use the hint framework.

  - Fixes #314.
2024-09-11 17:20:57 +02:00
Justus Winter
65af1e6ef8
Remove debugging remnant. 2024-09-11 17:11:53 +02:00
Devan Carpenter
759c568c0e
ci: remove pre-common-ci vestiges 2024-09-03 14:23:29 -05:00
Justus Winter
dfaba32a7a
Release 0.38.0. 2024-09-03 17:23:42 +02:00
Justus Winter
749a8e770c
Require exact --name and --email matches.
- See #309.
2024-09-03 17:23:42 +02:00
Justus Winter
9861598940
Drop dependency itertools. 2024-09-03 17:23:41 +02:00
Justus Winter
1f6e079947
Link to the new user documentation. 2024-09-03 17:16:31 +02:00
Justus Winter
0bf2adac9e
Fix cleartext, message signing with --signer-cert. 2024-09-03 17:16:30 +02:00
Justus Winter
2bffbc9ade
Improve wording. 2024-09-02 14:47:55 +02:00
Justus Winter
5c68890fb2
Update sequoia-keystore. 2024-09-02 14:47:55 +02:00
Justus Winter
578f6cb690
Update sequoia-openpgp. 2024-09-02 14:47:55 +02:00