Commit Graph

1275 Commits

Author SHA1 Message Date
Justus Winter
f5eafe9291
Rework generation of shell completions. 2024-01-03 16:42:53 +01:00
Justus Winter
cfc6fdd43a
Fix generation of shell completions and man pages.
- Fixes #163.
2024-01-03 16:06:48 +01:00
Justus Winter
ed5137657b
Fix usage generation.
- Fix escaping of help output.
2024-01-03 15:34:23 +01:00
Justus Winter
6c71e434a8
Factor out the JSON formatting. 2024-01-03 15:02:31 +01:00
Justus Winter
89b8bae767
Remove unused function. 2024-01-03 14:48:51 +01:00
Justus Winter
ee5da79290
Move OutputVersion to cli::output, and use in the cli definition.
- Fixes #13.
2024-01-03 14:28:51 +01:00
Justus Winter
6c040cfcc5
Move OutputFormat to cli::output, derive ValueEnum, and use in cli.
- See #13.
2024-01-03 14:14:33 +01:00
Justus Winter
d69c02a4de
Rename file. 2024-01-03 13:58:17 +01:00
Justus Winter
a80429cfd7
Factor out type conversion. 2023-12-20 16:15:12 +01:00
Justus Winter
e976062186
Sort global options to the bottom in help listings. 2023-12-20 16:15:12 +01:00
Justus Winter
ff9443bf96
Unify handling of encrypt --mode and key generate --can-encrypt.
- See #109.
2023-12-19 16:03:49 +01:00
Justus Winter
fa57bbe66e
Move split and join to commands/packets.rs.
- See #129.
2023-12-19 15:02:00 +01:00
Justus Winter
f04eb709c5
Release 0.32.0. 2023-12-15 22:15:38 +01:00
Justus Winter
d22c812e58
Update all dependencies. 2023-12-15 22:15:38 +01:00
Justus Winter
b8195f09b5
Update NEWS. 2023-12-15 18:29:08 +01:00
Justus Winter
ab59d41a2b
Decrypt the secret key just once. 2023-12-15 17:35:25 +01:00
Justus Winter
a5a7fd09b6
Unify password prompts that don't repeat, and be more polite. 2023-12-15 17:35:25 +01:00
Justus Winter
bf1ac88e1d
Make password prompts more consistent and polite. 2023-12-15 17:35:25 +01:00
Justus Winter
68bf9e91f2
Repeat prompt for passwords when generating artifacts.
- The function common::password::prompt_for_password is intended for
    creating artifacts.  For example, if a new key or subkey is
    generated, or a message should be encrypted using a password.  The
    cost of mistyping is high, so we prompt twice.

  - If the user mistypes, repeating the process allows for graceful
    recovery, which seems to be in the best interest of the user.

  - Make the function repeated the prompts if the user mistypes.
    Rename it to better indicate intent.  Adjust documentation.

  - Fixes #145.
2023-12-15 17:35:25 +01:00
Justus Winter
1346e3013c
Simplify password prompting.
- Use a common prompt text for the repeat, and make the suffix
    implicit.
2023-12-15 17:35:25 +01:00
Justus Winter
5b5f528368
Use crate humantime to format durations. 2023-12-15 13:14:37 +01:00
Justus Winter
4f2a22b604
Improve sq lookup's help output. 2023-12-14 15:32:45 +01:00
Jan Christian Grünhage
e483e5fbd4
Allow passing old and new passwords using files 2023-12-14 10:21:30 +01:00
Jan Christian Grünhage
c317b2bade
refactor: use Password type consistently 2023-12-14 10:21:25 +01:00
Justus Winter
dc24306af1
Emit partial TPKs as revocation certificates.
- When emitting revocation certificates, emit the revocation
    signature with enough context so that it is a well-formed TPK,
    i.e. include the primary key, the component to be revoked (if
    revoking a user ID or subkey), and the revocation signature.

  - Having a partial TPK instead of a bare revocation makes handling
    it much easier, as it can be stored and transported like any
    cert.  It also gives the recipient of the certificate more
    context, and simplifies merging it into a database of certs.

  - Previously, there was a bug in sq where we would emit secret key
    material when emitting revocation certificates.  The reason for
    that was that the certificate was first converted to a packet
    stream, and then each packet serialized.  In contrast, if a
    Cert is serialized, no secrets are emitted unless the
    programmer opts in.  In a way, this is the more comprehensive fix
    for the problem, as it leverages sequoia-openpgp's mechanisms to
    protect secret key material.

  - See #160.
2023-12-11 15:48:06 +01:00
Justus Winter
56dba759fd
Scan emitted data for inadvertent leaks of secret key material.
- In debug builds, scan all emitted data for secret key material,
    and panic if we find something.  Manually goodlist all the places
    where we expect to emit secret key material.
2023-12-11 15:40:31 +01:00
Justus Winter
8e1ae6e0a3
Use public accessors. 2023-12-11 15:40:31 +01:00
Justus Winter
8216857de2
Strip secret key material from emitted revocation certificates.
- When doing a userid, subkey, or third-party certificate
    revocation, with the cert given to --certificate-file containing
    secret key material, we previously emitted a revocation
    certificate containing secret key material.

  - This patch changes that in a straight-forward way that is easy to
    backport to prior versions.  A more comprehensive fix will follow.

  - Fixes #160.
2023-12-11 15:40:31 +01:00
Justus Winter
4ed3d371e5
Replace once_cell with types from the standard library. 2023-12-06 17:42:48 +01:00
Justus Winter
3a885d8dbf
Remove outdated comments. 2023-12-06 17:37:09 +01:00
Justus Winter
1bad4fff20
Port to sequoia-cert-store 0.4.0. 2023-12-06 17:27:20 +01:00
Justus Winter
f6b936d889
Fix warning. 2023-11-30 14:42:12 +01:00
Justus Winter
b8f9670497
Improve pluralization: make it convenient and prevent word-wrapping. 2023-11-30 14:42:11 +01:00
Justus Winter
e028f90fdb
Improve network lookup UX; return an error if no cert was found.
- If the default set of keyservers is used, do not emit error
    messages unless --verbose is given or the search returned no cert
    at all.

  - If no cert was located, signal an error.

  - See #156.
2023-11-30 11:10:19 +01:00
Justus Winter
101309c88a
Improve the interactive-use test with the new IsTerminal. 2023-11-30 10:22:15 +01:00
Justus Winter
4d40c983a5
Fix unstable cli warning.
- The heuristic got broken because newer versions of
    terminal_size::terminal_size consider the PTY, not
    necessarily stdout.

  - Fixes ab8df96e5b.
2023-11-29 17:54:40 +01:00
Justus Winter
64d9012a5d
Replace custom reimplementation of std::sync::Once. 2023-11-29 17:38:12 +01:00
Justus Winter
5244b8d49a
Add --verbose. 2023-11-29 17:15:28 +01:00
Justus Winter
decbc5143a
Special-case the read-only Proton keyserver when sending. 2023-11-29 17:11:41 +01:00
Justus Winter
8d00aff2a2
Make sq keyserver get --server ... work.
- Mark sq keyserver --server argument as global so that it can be
    used in all keyserver subcommands.
2023-11-29 16:50:11 +01:00
Justus Winter
2ab3bd5efd
Word-wrap lines in human-readable messages.
- Replace every eprintln by wprintln, which prints to stderr as
    well, but word-wraps the messages.
2023-11-29 16:41:40 +01:00
Justus Winter
0400ae88eb
Rework signature status formatting. 2023-11-29 16:13:23 +01:00
Justus Winter
50c5c1ac86
Bump all dependencies. 2023-11-29 14:06:20 +01:00
Justus Winter
14b1a69eb4
Update subplot. 2023-11-29 14:06:20 +01:00
Justus Winter
ab8df96e5b
Update terminal_size. 2023-11-29 14:06:20 +01:00
Justus Winter
a19f4ecd25
Update predicates. 2023-11-29 14:06:20 +01:00
Justus Winter
f4f5f20e6e
Avoid deprecated function. 2023-11-29 14:06:20 +01:00
Justus Winter
544075bd86
Set our MSRV to 1.70. 2023-11-29 14:06:20 +01:00
Justus Winter
f8e32f2f16
Update itertools. 2023-11-29 13:33:27 +01:00
Justus Winter
537433d790
Update openssl to 0.10.60.
- Fixes https://rustsec.org/advisories/RUSTSEC-2023-0072
2023-11-29 11:57:11 +01:00