Heiko Schaefer
31eee9e738
backend: add CardBackend::limit_card_caps
...
This mechanism allows the pcsc backend to signal to openpgp-card that a reader doesn't support "extended length".
2023-09-06 01:16:32 +02:00
Heiko Schaefer
4fda5d800a
scdc: remove redundant log output
2023-08-31 13:26:23 +02:00
Heiko Schaefer
f4cc72c37b
card-backend: Add CardTransaction::was_reset()
...
This can signal to consumers that state on the card may have been reset (e.g. PIN verification state)
2023-08-28 17:19:59 +02:00
Heiko Schaefer
0e89c4baa6
Move backend traits to new card-backend crate
...
- Move CardBackend, CardTransation traits to card-backend
- Break SmartcardErrors out from openpgp-card to card-backend
- CardCaps are (mostly) openpgp-card specific, move them (mostly) to openpgp-card
- Rename pcsc and scdc backend crates: card-backend-pcsc, card-backend-scdc
2023-08-27 22:24:16 +02:00
Heiko Schaefer
822b7f3b55
clippy lint fix
2023-08-04 15:09:38 +02:00
Wiktor Kwapisiewicz
4510c34cdc
Fix clippy lints: directly use variables in format! strings
...
The source has been reformatted using `cargo +nightly fmt`.
2023-02-02 09:09:47 +01:00
Heiko Schaefer
27697cb2c5
add rustfmt.toml and set group_imports = "StdExternalCrate"
2022-11-03 14:32:00 +01:00
Heiko Schaefer
2f6626ed5a
Upgrade to newer tokio and sequoia-ipc versions, bump crate version to 0.2.1.
2022-03-22 16:49:39 +01:00
Heiko Schaefer
93baf42b84
Re-organize log levels.
...
- card operations are logged at "info" level
- APDU command/response are logged at "debug"
- other log output is at "trace"
2022-03-22 12:47:42 +01:00
Heiko Schaefer
8d09289d48
Document that scdc doesn't implement transaction guarantees.
2022-02-25 11:14:08 +01:00
Heiko Schaefer
986094fac8
Update/improve crate level documentation.
2022-02-24 21:25:47 +01:00
Heiko Schaefer
8ab3a43d6e
Use Error::InternalError less, introduce additional specific error variants.
2022-02-24 21:25:47 +01:00
Heiko Schaefer
636813279b
Reformatted to conform to vanilla rustfmt.
2022-02-24 21:25:47 +01:00
Neal H. Walfield
ff1dac427c
Don't implement From<T> for Box<dyn T>.
...
- This is usually unnecessary.
2022-02-18 17:44:07 +01:00
Heiko Schaefer
0c86fcb84a
Implement CardBackend/CardTransaction for scdc backend
2022-02-18 16:23:37 +01:00
Heiko Schaefer
5133051626
Rename CardClient -> CardTransaction.
2022-02-18 15:06:31 +01:00
Heiko Schaefer
2480745088
Move implementation of low-level OpenPGP functionality from CardApp to CardClient.
2022-02-14 17:46:16 +01:00
Heiko Schaefer
5e7fcd079b
Change CardApp API: take &mut CardClient parameter for all calls (instead of owning a CardClientBox).
...
This way, clients can exert control over the state of the CardClient, e.g. to combine CardApp operations in a PCSC transaction.
2022-02-14 17:43:07 +01:00
Heiko Schaefer
1dc178a7b2
Documentation edits.
2021-12-02 18:35:53 +01:00
Heiko Schaefer
ecd862e23f
Remove "get_" prefix from getter function names (to better conform with Rust API Guidelines https://rust-lang.github.io/api-guidelines ).
2021-12-01 19:11:22 +01:00
Heiko Schaefer
2709b4ad39
Implement pinpad feature detection and pinpad support for verify/modify (of pw1 and pw3) in pcsc backend.
...
Extend CardCaps to contain pw1_max_len and pw3_max_len (and initialize these values from ARD).
Add pinpad_verify(), pinpad_modify(), feature_verify()/feature_modify() to CardClient API.
Expose in card_app (and openpgp-card-sequoia card API).
Adjust opgpcard, opgpcard-pin to ue pinpad reader when available.
2021-11-30 22:51:18 +01:00
Heiko Schaefer
9e9cddc225
Implement setting of 'identity' for NitroKey Start.
2021-11-29 18:33:23 +01:00
Heiko Schaefer
f5eaa591cb
Add comment to clarify unwrap
2021-11-22 19:11:22 +01:00
Heiko Schaefer
994e10c2d7
Minor restructuring, add some comments.
2021-11-12 19:02:35 +01:00
Heiko Schaefer
c84561d5e8
Clarify SCD command size limitation comment and naming.
2021-11-12 18:53:13 +01:00
Heiko Schaefer
90ae9398ed
Adjust the backend API and interaction with openpgp-card some more.
2021-11-12 18:47:56 +01:00
Heiko Schaefer
d55985807c
Change the API for interactions between openpgp-card and backends.
...
The goal of this change is a cleaner structure, and in particular to make it the default for client-code to obtain a CardApp with pre-initialized "capabilities" (that is, init_caps() gets called implicitely).
2021-11-11 16:40:08 +01:00
Heiko Schaefer
c73a4fa2f8
Adjust card name to the shop's naming.
2021-09-22 16:42:43 +02:00
Heiko Schaefer
316ca7eb3a
Rename error types and re-export them at the crate top level.
2021-09-01 23:59:56 +02:00
Heiko Schaefer
f28c9c2204
Adjust visibility and add accessors to CardCaps.
2021-08-21 19:02:04 +02:00
Heiko Schaefer
f67501d0f9
Lints
2021-08-05 15:16:16 +02:00
Heiko Schaefer
897847cb46
Add a shutdown_scd() function, to explore managing scdaemon.
2021-08-03 23:17:06 +02:00
Heiko Schaefer
f46d94f989
Communicate with scdaemon via gpg-agent (this removes the need for a "socket" parameter)
2021-08-03 17:46:13 +02:00
Heiko Schaefer
c9e7f1b0aa
Some cleanup/documentation.
...
ScdClient now produces the lower level CardClientBox objects (instead of CardBase)
2021-08-03 15:31:40 +02:00
Heiko Schaefer
ff65d200ec
Improve scdaemon client backend:
...
- Use "--exlen" SCD parameter for extended length commands.
- Deal with Assuan line length limitations.
- Add a CardCaps to ScdClient.
2021-07-29 18:35:25 +02:00
Heiko Schaefer
97d4880118
Signing
2021-07-18 12:00:00 +02:00
Heiko Schaefer
f59a8a948c
Remove unused imports; Lints.
2021-07-16 18:44:59 +02:00
Heiko Schaefer
01126aabdf
Support scdaemon as an alternative backend for interaction with OpenPGP cards.
2021-07-16 16:30:56 +02:00