Commit graph

140 commits

Author SHA1 Message Date
Heiko Schaefer
27697cb2c5
add rustfmt.toml and set group_imports = "StdExternalCrate" 2022-11-03 14:32:00 +01:00
Heiko Schaefer
87a80a4797
opgpcard: rename "key_status" to "additional_key_status".
This field will only contain data in rare cases (I don't know of a card where it will) when a card has key information for unusual key types (also see OpenPGP card spec 3.4.1 pg.43)
2022-11-03 11:57:20 +01:00
Heiko Schaefer
bfaff6b9bf
opgpcard: handle "key status" information for attestation key. 2022-11-03 11:57:20 +01:00
Heiko Schaefer
7fe693ab98
opgpcard: re-add newlines in text output for 'ssh' 2022-10-31 15:50:03 +01:00
Heiko Schaefer
001bbd4412
opgpcard: tweak 'info' text output; add FIXME to re-work the form of algorithm information output 2022-10-31 15:50:03 +01:00
Heiko Schaefer
ae25e6b608
opgpcard: move creation time up in text output for 'status', and adjust printed field name 2022-10-31 15:50:03 +01:00
Heiko Schaefer
3a9d40454f
opgpcard: in 'status', handle 'pkm' parameter analogously to 'verbose' 2022-10-31 15:50:03 +01:00
Heiko Schaefer
5f715647c9
opgpcard: rename/reorder 'status' fields to reflect common terminology and logical structure of the fields.
Temporarily remove key_statuses and ca_fingerprints from machine-readable output. These fields should be stabilized before adding them to JSON.
2022-10-31 15:50:03 +01:00
Heiko Schaefer
fd441dbd14
adjust to changed openpgp-card-sequoia API 2022-10-28 18:55:42 +02:00
Nora Widdecke
3169855e5c
opgpcard: Add error handling for PIN file
- If a PIN file could not be read, there is no error and the program
    proceeds as if no PIN file argument was given.

  - Add error handling for read errors of the PIN file.

  Fixes #43
2022-10-28 13:58:19 +02:00
Heiko Schaefer
f98ea9d0aa
opgpcard: only the SIG slot has configurable validity mechanism for PIN verification 2022-10-28 12:46:44 +02:00
Heiko Schaefer
fe885a4b1c
opgpcard: Move attestation key metadata to its own KeySlotInfo 2022-10-28 10:17:45 +02:00
Nora Widdecke
b489c7da4d
opgpcard: Allow sign and decrypt to write to file
- Sometimes, it is more convenient to give the target filename as an
    argument, instead of using pipes.

  - Add an optional argument -o/--output to opgpcard sign and opgpcard
    decrypt.
2022-10-27 22:02:14 +02:00
Heiko Schaefer
92a3f76dd0
Cardholder name format handling belongs in openpgp-card-sequoia 2022-10-27 18:26:18 +02:00
Nora Widdecke
f0c9fcc842
opgpcard: Add and improve help texts 2022-10-27 17:44:00 +02:00
Nora Widdecke
e656946335
opgpcard: Unify on aut-fp not auth-fp 2022-10-27 17:42:21 +02:00
Nora Widdecke
eebe3f0fc2
opgpcard: Use the name cv25519 2022-10-27 17:42:21 +02:00
Nora Widdecke
4c5a166d2b
opgpcard: Remove ident line from output.
- The certificate generated by admin generate is written to a file,
    prefixed with a line containing the card identifier. That means the
    file is not immediately usable as a pgp certificate.

  - Remove the identifier line.
2022-10-27 15:48:55 +02:00
Nora Widdecke
71f6c98ed5
opgpcard: Prevent losing the generated cert.
- opgpcard admin generate by default prints the corresponding
    certificate to stdout, where it's easy for a careless user to lose
    it.

  - Make the --output argument mandatory, so the certificate is always
    stored in a file.
2022-10-27 15:10:28 +02:00
Heiko Schaefer
538fc645c5
opgpcard: use new Card<State> interface 2022-10-27 13:41:24 +02:00
Nora Widdecke
cc6ce53364
make rustfmt happy 2022-10-26 19:41:07 +02:00
Nora Widdecke
77ed66bde7
opgpcard: Add Lars to license header 2022-10-26 19:07:24 +02:00
Nora Widdecke
00d40e940b
opgpcard: refactor admin generate 2022-10-26 19:07:24 +02:00
Nora Widdecke
72f8a1994b
opgpcard: Extract admin command into module 2022-10-26 18:58:31 +02:00
Nora Widdecke
1be21cfc7f
opgpcard: Extract attestation command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
25ae73711d
opgpcard: Read pinpad_modify only when needed 2022-10-26 18:58:30 +02:00
Nora Widdecke
56d70e3218
opgpcard: Clean up returns 2022-10-26 18:58:30 +02:00
Nora Widdecke
1ecaf396c7
opgpcard: Reorganize pin 2022-10-26 18:58:30 +02:00
Nora Widdecke
b6dfa08d52
opgpcard: Extract pin command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
9b7e614772
opgpcard: Extract set_identity command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
d0ad41c9f5
opgpcard: Extract factory_reset command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
3615087065
opgpcard: Extract sign command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
9e5e30cea4
opgpcard: Extract decrypt command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
3ff4127fff
opgpcard: Extract pubkey command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
660ba2d3bb
opgpcard: Extract ssh command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
d05feec605
opgpcard: Extract info command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
f0ab24b040
opgpcard: Extract status command into module 2022-10-26 18:58:30 +02:00
Nora Widdecke
4e575685a1
opgpcard: Make default output values type safe 2022-10-26 12:02:53 +02:00
Heiko Schaefer
6df7e2d56f
opgpcard: tighten/clarify output 2022-10-26 01:12:51 +02:00
Heiko Schaefer
bb577647c4
opgpcard: clarify/add comment 2022-10-26 01:00:29 +02:00
Heiko Schaefer
4674b95557
opgpcard: properly error out of sign/decrypt, if the relevant key slot is empty 2022-10-25 19:03:53 +02:00
Nora Widdecke
23b4c05c3d
opgpcard: Make algo selection type safe 2022-10-25 14:55:39 +02:00
Nora Widdecke
1834762879
opgpcard: Remove negative logic 2022-10-25 14:53:05 +02:00
Nora Widdecke
e81ebd21a0
opgpcard: Restrict values of id of set-identity 2022-10-25 14:53:05 +02:00
Nora Widdecke
a7731ec467
opgpcard: Add Nora to license headers 2022-10-25 14:53:05 +02:00
Nora Widdecke
e9787dcbd3
opgpcard: Make TouchPolicy type safe 2022-10-25 14:53:05 +02:00
Nora Widdecke
9dd4f3ab56
opgpcard: Make the KeySlots type safe 2022-10-25 14:44:44 +02:00
Heiko Schaefer
708a8b2707
opgpcard: remove dependencies on lower level openpgp-card (use only the openpgp-card-sequoia API) 2022-10-25 12:53:37 +02:00
Heiko Schaefer
fff5b18310
opgpcard: adjust handling of card_service_data 2022-10-25 10:37:37 +02:00
Lars Wirzenius
dd02a29497 add integration/acceptance test with Subplot
These need to be run with the virtual smartcard emulation in the
Docker container specified in .gitlab-ci.yml for tests.

The tests are a little simplistic, as it turned out that making
changes to the smart card results in flaky tests. Thus only parts of
opgpcard that don't change the card are tested.

Sponsored-by: NLnet Foundation; NGI Assure
2022-10-24 20:30:14 +03:00