Commit Graph

1343 Commits

Author SHA1 Message Date
Justus Winter
ec933036dd
Buffer certs and use the correct armor label in sq keyring.
- See #14.
2024-01-04 17:16:26 +01:00
Justus Winter
55321a2769
Don't suggest to omit a mandatory option.
- Provide two distinct default help texts for our CLI types: for
    optional and required arguments.
2024-01-04 16:21:45 +01:00
Justus Winter
5a809f77d6
Improve ergonomics of sq key userid add.
- Make the input and one user id argument mandatory.

  - Fixes #104.
2024-01-04 16:02:25 +01:00
Justus Winter
70eb478987
Dump certs if we see a bad signature in the sq-certify tests.
- See #9.
2024-01-04 15:01:19 +01:00
Justus Winter
4db9d09dac
Constrain to valid messages when merging signatures.
- Fixes #65.
2024-01-04 14:05:18 +01:00
Justus Winter
b79ff91ddf
Fix joining of packets that contain secrets.
- Fixes 56dba759fd.
2024-01-04 13:34:08 +01:00
Justus Winter
2acae1311c
Fix detection of inline-signed messages. 2024-01-04 13:34:08 +01:00
Justus Winter
bd4e645bfc
Make label detection more robust, use packet tag instead of kind.
- For packet joining, we don't need to be able to parse the packet.
    Hence, it is enough to look at the tag, which will cover e.g
    packets with unsupported versions.
2024-01-04 13:34:08 +01:00
Justus Winter
e0fab7a234
Take the path from the packet parser instead of computing it. 2024-01-04 13:34:07 +01:00
Justus Winter
8314b47c51
Refactor dispatching logic. 2024-01-04 12:03:55 +01:00
Justus Winter
3e3980b161
Identify bare revocation certificates as such. 2024-01-04 11:17:19 +01:00
Justus Winter
1dfbe5cc70
Identify compound revocation certificates as such. 2024-01-04 10:57:16 +01:00
Justus Winter
c6b29ec13f
Include public key in revocation cert, adjust Armor label.
- Fixes #53.
2024-01-04 10:45:28 +01:00
Justus Winter
b24b9b898e
Merge certificates used to verify signatures.
- Fixes #79.
2024-01-04 10:33:13 +01:00
Justus Winter
012f4500ac
Validate the Autocrypt header against the From header. 2024-01-03 17:47:12 +01:00
Justus Winter
86f599542c
Remove the Autocrypt feature, making it mandatory.
- We once made the Autocrypt feature optional in order to squeeze a
    sq update into a freeze without requiring new dependencies.
    However, having features has a cost too (see e.g. #137), and we
    generally try to keep the number of exposed features down.  And,
    the sequoia-autocrypt is one of the least demanding crates to
    package.
2024-01-03 17:14:46 +01:00
Justus Winter
1ebdd0c904
Rework generation of documentation. 2024-01-03 16:54:44 +01:00
Justus Winter
c55070e269
Rework generation of man pages. 2024-01-03 16:50:08 +01:00
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