Commit Graph

129 Commits

Author SHA1 Message Date
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
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
6034e03893
Avoid using the system-wide crypto policy in tests.
- Fixes #177.
2024-09-16 12:53:33 +02:00
Justus Winter
cc707466d3
Remove output format and version command line options.
- See #310.

  - Fixes #289.
2024-09-02 14:47:42 +02:00
Justus Winter
9d72502512
Port remaining tests to the common test framework. 2024-09-02 13:23:28 +02:00
Justus Winter
bbfdebfd73
Rename sq encrypt --symmetric to --with-password.
- This is an ugly gpgism.  All encrypted messages are symmetrically
    encrypted.  Not all password-encrypted messages encrypt the
    session key symmetrically.  Use language the user understands.

  - Fixes #331.
2024-09-02 11:47:56 +02:00
Justus Winter
13c7d5a83b
Implement sq encrypt --symmetric-password-file.
- Fixes #271.

  - Fixes #58.
2024-09-02 11:43:48 +02:00
Justus Winter
fc273e89d4
Implement sq key subkey add --new-password-file.
- See #271.
2024-09-02 11:41:04 +02:00
Justus Winter
ca6a68ba8a
Parallelize the subkey password test. 2024-09-02 10:22:21 +02:00
Justus Winter
0cf495bd90
Implement sq key generate --new-password-file.
- See #271.
2024-09-02 10:16:33 +02:00
Justus Winter
dd5ee688fb
tests: Port remaining tests to the test framework. 2024-08-30 14:33:00 +02:00
Justus Winter
945757684c
Fix terminology. 2024-08-29 13:20:03 +02:00
Justus Winter
8f33b87216
Implement sq --batch for non-interactive use.
- Fixes #267.
2024-08-29 13:20:03 +02:00
Justus Winter
8bafdd847f
tests: Remove extra layer of modules. 2024-08-29 13:20:03 +02:00
Justus Winter
4702fe8e36
Improve sq key approvals update.
- Add user ID selectors, allow approving or disapproving by
    certifier fingerprint, and approving using the Web of Trust.

  - Fixes #262.
2024-08-28 09:19:38 +02:00
Neal H. Walfield
bf056997a9
Rename integration tests to match the subcommand being tested.
- Rename the files and the tests to reflect the subcommands actually
    being tested.
2024-08-22 11:30:26 +02:00
Neal H. Walfield
cee60e89df
Make sq cert export more consistent with other commands.
- Unlike other commands, `sq cert export`'s `--cert` argument only
    matches on the certificate's key handle (i.e., the primary key's
    key handle).  It also has a `--key` argument to match on the
    primary key's key handle or a subkey's key handle, which are
    the semantics of the `--cert` argument for other commands.

  - Change the semantics of `--cert` to that of `--key`, i.e., change
    `--cert` to also match on subkey key handles.  Remove the `--key`
    argument since it is now redundant.
2024-08-22 11:13:54 +02:00
Justus Winter
05dc2f85c5
Update description of the assets used in the examples. 2024-08-16 17:49:55 +02:00
Justus Winter
c94fb2249d
Improve the way we make the subplot tests opt-in.
- Promote subplotlib to a proper dependency, as dev-dependencies can
    not be optional.
2024-08-15 14:16:26 +02:00
Justus Winter
9b16970655
Drop the "integration" module from the integration tests. 2024-08-15 14:05:24 +02:00
Justus Winter
a470f5946d
Consolidate all integration tests.
- This way they only have to be compiled once, and can all be run
    concurrently.
2024-08-15 13:38:43 +02:00
Justus Winter
bd6313df7f
Make sq key userid strip operate on the cert store.
- Fixes #6.
2024-08-15 13:02:48 +02:00
Justus Winter
83f81b5765
Add test for sq key userid strip. 2024-08-15 13:02:37 +02:00
Neal H. Walfield
cd8283d851
Prompt for a password by default.
- Change `sq key generate` and `sq key subkey add` to prompt for a
    password by default.

  - Fixes #226.
2024-08-14 18:19:14 +02:00
Neal H. Walfield
93344e71a6
New subcommand sq key subkey export.
- `sq key export` can either export all keys associated with a
    certificate or individual keys.

  - Split the subkey-related functionality out of `sq key export` and
    into the new subcommand `sq key subkey export`

  - Fixes #294.
2024-08-14 15:21:30 +02:00
Justus Winter
20eb29930f
Remove the dot output.
- The dot output does not fit into the output framework: it can only
    describe graphs, and most of what sq emits are not graphs.  Once
    sq gains machine-readable output, the current functionality can be
    implemented by emitting the graph data as machine-readable data,
    then transforming it into dot.

  - Fixes #290.

  - Fixes #137.
2024-08-14 14:29:04 +02:00
Neal H. Walfield
916c110626
Port sq key import / export test to the common test framework.
- Port the `sq key import` / `sq key export` test to the common
    test framework.
2024-08-14 13:58:15 +02:00
Neal H. Walfield
8849a8c627
Always summarize sq's result when running it from the test suite.
- When running `sq`, summarize the result even if we don't
    explicitly expect it to succeed or fail.
2024-08-14 13:57:52 +02:00
Justus Winter
75e8339bbe
Implement sq key userid add --name and --email.
- A user ID is an OpenPGP concept.  Most people think in terms of
    names and email addresses.

  - Add and promote --name and --email arguments for sq key userid
    add.

  - Fixes #291.
2024-08-14 11:22:07 +02:00
Justus Winter
099de6d868
Implement sq key generate --name and --email.
- A user ID is an OpenPGP concept.  Most people think in terms of
    names and email addresses.

  - Add and promote --name and --email arguments for sq key generate.

  - See #291.
2024-08-14 11:18:50 +02:00
Justus Winter
658596b0ac
Port test to the common test framework. 2024-08-14 11:18:50 +02:00
Neal H. Walfield
38221a3d7d
tests: Dry out the test framework.
- Replace uses of `sq_key_generate` with `Sq::key_generate`, and
    remove `sq_key_generate`.
2024-08-13 10:08:04 +02:00
Neal H. Walfield
a92ab98f4f
New subcommand sq key subkey password.
- Add a new subcommand, `sq key subkey password`, which changes the
    password protecting the secret key material of a primary key or a
    subkey.

  - Fixes #106.
2024-08-13 10:08:04 +02:00
Justus Winter
49b7f25cc4
Rename key attest-certifications to key approvals update.
- Fixes #295.
2024-08-12 16:21:00 +02:00
Neal H. Walfield
1f0a500fe8
Refactor the sq key password test.
- Add `Sq::key_password` and `Sq::sign` based on the code in the
    `sq key password` test.

  - Implement the `sq key password` test in terms of those functions.
2024-07-18 23:14:08 +02:00
Neal H. Walfield
b8591c480f
Fix the autocrypt test's time.
- When running the autocrypt test, don't use the current time, but
    set it to a fixed time.  This prevents failures due to an expired
    certificate.
2024-07-18 23:14:05 +02:00
Neal H. Walfield
9b991045ca
New subcommand sq key subkey delete to delete secret key material. 2024-07-05 09:50:37 +02:00
Neal H. Walfield
68e5213478
Add tests for sq key delete. 2024-07-05 09:50:37 +02:00
Neal H. Walfield
e85661e8b7
Update code using deprecated functions from sequoia-openpgp.
- Now that we've raised our minimum supported `sequoia-openpgp`
    version, update code using deprecated functions.
2024-07-04 22:51:46 +02:00
Justus Winter
846d819368
Port sq verify's examples to the example framework.
- Port `sq verify`'s examples to the example framework and improve
    them.

  - See #196.
2024-06-20 18:00:47 +02:00
Justus Winter
e78bcf248f
Port sq autocrypt's examples to the example framework.
- Port `sq autocrypt`'s examples to the example framework.

  - See #196.
2024-06-20 15:48:43 +02:00
Justus Winter
815fd5df3b
tests: Port the autocrypt test to the common test framework. 2024-06-20 13:57:44 +02:00
Neal H. Walfield
ae392296f5
Add a top-level --password-file argument to seed the password cache.
- `sq key password`, and `sq sign --symmetric` have local arguments
    to seed the password cache.

  - Many commands could benefit from similar functionality.

  - Add a new top-level argument, `--password-file`, to seed the
    password cache.
2024-06-13 11:39:09 +02:00
Neal H. Walfield
2ed7435b63
Rename sq key password's --clear argument to --clear-password.
- This makes the argument's intent clearer and more closely mirrors
    the other arguments, like `--new-password-file`.
2024-06-13 10:56:10 +02:00
Neal H. Walfield
20d7b8ff68
Add examples for sq key subkey adopt. 2024-06-13 10:47:00 +02:00
Neal H. Walfield
d42da17949
Port sq key password's examples to the example framework.
- Port `sq key password`'s examples to the example framework and
    improve the examples.

  - See #196.
2024-06-13 10:25:00 +02:00
Neal H. Walfield
0e5c58ef05
Use the null policy when creating revocation certificates.
- When creating a revocation certificate using, e.g., `sq key
    revoke`, use the null policy.

  - Even if a certificate is not valid according to the standard
    policy, it can still be useful to revoke it.

  - Fixes #250.
2024-06-12 18:02:22 +02:00
Neal H. Walfield
fa835e234f
Port the sq key revoke tests to the common test framework.
- Add `Sq::key_revoke`, and change the `sq key revoke` integration
    tests to use it.
2024-06-12 16:50:56 +02:00
Neal H. Walfield
1817c305ae
Make helper function more generic.
- Change `compare_notations` from taking a slice containing two
    elements to taking a slice taking any number of elements.
2024-06-12 16:49:26 +02:00