Commit graph

44 commits

Author SHA1 Message Date
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
Heiko Schaefer
0089c211ae
In open_by_ident(), call to_ascii_uppercase() on user-provided ident (for case insensitive comparison). 2021-11-16 17:46:14 +01:00
Heiko Schaefer
4c264a59b4
Minor restructuring. 2021-11-12 19:07:15 +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
bc08ca68ed Releases 2021-10-29 22:51:23 +02:00
Heiko Schaefer
fe06db3510 Release pcsc and -sequoia 2021-09-11 13:02:54 +02:00
Heiko Schaefer
936f04663c Rename list_cards() -> cards().
Remove open_yolo() from the openpgp-card-pcsc API (it's easy enough to approximate by using cards())
2021-09-11 12:42:01 +02:00
Heiko Schaefer
0302387bea Releases 2021-09-09 00:48:25 +02:00
Heiko Schaefer
8b5894e961 Rename get_app_data() to get_application_related_data() to correspond with naming in spec. 2021-09-02 22:09:46 +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
f8d998b3a6 Implement From<CardClientBox>, Into<CardClientBox> for CardApp and adjust client code. 2021-09-01 22:26:25 +02:00
Heiko Schaefer
935c77f59a Rename ApplicationRelatedData::get_aid() to get_application_id() 2021-08-28 19:58:34 +02:00
Heiko Schaefer
fadd327e7c Release pcsc, scdc. 2021-08-26 15:05:40 +02:00
Heiko Schaefer
9f3ebe8972 Release openpgp-card. 2021-08-26 15:01:59 +02:00
Heiko Schaefer
c872e46e80 Refactor: move accessor fn for "Application Related Data" into the struct ApplicationRelatedData. 2021-08-20 22:19:39 +02:00
Heiko Schaefer
8aae0a357e Split the Response type into an internal RawResponse type which also contains the status bytes, and an external Response type that can only be generated from a RawResponse with status "ok".
This removes the need for external users of openpgp-card to check the status or operations.
That is, openpgp-card now always returns an `Err` if the status of a command is not ok.
2021-08-20 13:25:58 +02:00
Heiko Schaefer
b8e3fc4816 Set version numbers for crates.io releases 2021-08-18 19:57:54 +02:00
Heiko Schaefer
bf8ab84668 Documentation. 2021-08-18 15:01:38 +02:00
Heiko Schaefer
0b0e9c48fc Refactor:
- Move high-level API from openpgp-card to openpgp-card-sequoia
- Move the pcsc backend into the separate crate openpgp-card-pcsc
2021-08-18 14:03:54 +02:00