Heiko Schaefer
6d52835efa
Adjust paths for move to gitlab group 'openpgp-card'.
2022-06-11 21:46:32 +02:00
Heiko Schaefer
658d50eeb6
Bump version to 0.2.1 (logging changes only)
2022-03-22 16:56:59 +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
0b4a18b136
Fix clippy lints
2022-03-06 16:15:13 +01:00
Heiko Schaefer
a8637f48b1
Bump versions
2022-02-24 21:25:47 +01:00
Heiko Schaefer
56d03ffca6
Drop use of "anyhow".
2022-02-24 21:25:47 +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
16b1b5136c
Use pcsc symbols in fully qualified syntax, for clarity
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
1496da6dd5
Rename pcsc::PcscCard -> pcsc::PcscBackend, pcsc::TxClient -> pcsc::PcscTransaction
2022-02-18 15:58:12 +01:00
Heiko Schaefer
e01c79e857
Tweak ergonomics of openpgp-card-pcsc usage and simplify client code.
2022-02-18 15:06:31 +01:00
Heiko Schaefer
635fa0e6ac
Remove gratuitous fn from public API
2022-02-18 15:06:31 +01:00
Heiko Schaefer
c23f23c619
Introduce the new CardBackend trait.
...
A CardBackend represents a card without an open transaction (a CardTransaction implementation can be acquired from a CardBackend).
2022-02-18 15:06:31 +01:00
Heiko Schaefer
5133051626
Rename CardClient -> CardTransaction.
2022-02-18 15:06:31 +01:00
Heiko Schaefer
a276c1fcd0
Clean up log output.
2022-02-16 18:09:21 +01:00
Heiko Schaefer
f1f4533332
Remove TxClient::tx() from API; clean up uses.
2022-02-16 17:46:26 +01:00
Heiko Schaefer
80af7000e0
Use newly published pcsc 2.7 (instead of git)
2022-02-15 15:34:52 +01:00
Heiko Schaefer
0e94871189
Implement PcscCard::transaction() to replace the transaction!() macro.
...
(This currently requires unreleased pcsc from git)
2022-02-15 15:34:52 +01:00
Heiko Schaefer
50d8b89fd2
Break from macro
2022-02-15 10:53:46 +01:00
Heiko Schaefer
87788e8912
rename get_txc!() -> transaction!()
2022-02-15 10:53:46 +01:00
Heiko Schaefer
bdde317a2d
Simplify optional $reselect parameter in get_txc!()
2022-02-15 10:53:46 +01:00
Heiko Schaefer
c53cf33137
more debug output
2022-02-15 10:53:46 +01:00
Heiko Schaefer
7573361836
Make ShareMode an optional parameter when opening cards via pcsc.
2022-02-15 10:53:46 +01:00
Heiko Schaefer
36b9fb2770
get_txc!() now assumes the OpenPGP application should be re-selected, by default
2022-02-15 10:49:55 +01:00
Heiko Schaefer
1b1f6bc2df
Adjust documentation
2022-02-14 17:50:42 +01:00
Heiko Schaefer
53f637e0a1
Change transaction-starting macro to consume a PcscCard and produce a TxClient.
...
Rename: start_tx!->get_txc!.
2022-02-14 17:50:42 +01:00
Heiko Schaefer
53c8609f05
Remove unused imports
2022-02-14 17:46:16 +01:00
Heiko Schaefer
30341d6c4b
Rename: PcscClient->PcscCard,PcscTxClient->TxClient
2022-02-14 17:46:16 +01:00
Heiko Schaefer
431da53b28
Don't implement CardClient for PcscClient (users should always use transactions)
2022-02-14 17:46:16 +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
405a2a1fc1
Don't fail when a card errors on "get DO ARD", we could still find the card we're looking for
2022-02-14 17:46:16 +01:00
Heiko Schaefer
e9ecfea4cf
Debug print card "status" before reading ARD
2022-02-14 17:46:16 +01:00
Heiko Schaefer
c43b53d210
Add $reselect parameter to start_tx! that specifies if the card should be re-selected if it was reset
2022-02-14 17:43:07 +01:00
Heiko Schaefer
f4eaca229d
Copy card_caps information from PcscClient to PcscTxClient, if any
2022-02-14 17:43:07 +01:00
Heiko Schaefer
b6b2957580
Naming; cleanup; logging for pcsc::initialize_card()
2022-02-14 17:43:07 +01:00
Heiko Schaefer
514d055c90
Run each test in a PCSC Transaction.
...
(Disabled scdc support in the tests, for now)
2022-02-14 17:43:07 +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
b367043a12
Implement a macro "start_tx!" for DRY transaction starting
2022-02-14 17:43:07 +01:00
Heiko Schaefer
748c334403
Implement TxClient to use pcsc with transactions (transaction opening code is duplicated)
2022-02-14 17:43:07 +01:00
Heiko Schaefer
0baf36df67
Restructure cards() and open_by_ident(); Add debug logging
2022-02-14 16:37:20 +01:00
Heiko Schaefer
28e4200090
Make pcsc usage less platform specific.
2021-12-30 17:37:44 +01:00
Heiko Schaefer
953ee58120
Don't fail to open the card when GET_FEATURE_REQUEST returns with an error (this is a problem when running on jcardsim).
2021-12-10 17:51:21 +01:00
Heiko Schaefer
413e8b7d2a
Bump versions for releases.
2021-12-02 18:45:46 +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
a7fb5b2b2c
Don't fail while enumerating readers, when a reader returns an error (just log).
...
This is useful with hubs that can power down individual ports: when a port is powered down, the reader is still visible to pcsc, but connecting to it returns an error.
2021-11-29 21:26:30 +01:00
Heiko Schaefer
9e9cddc225
Implement setting of 'identity' for NitroKey Start.
2021-11-29 18:33:23 +01:00