Commit graph

847 commits

Author SHA1 Message Date
Heiko Schaefer
87a9f4f216
bump backend versions
card-backend to 0.2.0,
pcsc and scdc to 0.5.0
2023-09-06 01:16:32 +02:00
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
e476103e6d
In select_data(): fold yk_workaround parameter into the openpgp-card business logic 2023-09-06 01:16:32 +02:00
Heiko Schaefer
536bcf788b
openpgp-card: ExtendedCapabilities, add getters for capabilities 2023-09-06 01:16:32 +02:00
Heiko Schaefer
465847ea79
openpgp-card: ExtendedCapabilities, make v2 command length getters private.
Command length negotiation is handled in this library, this information should never be useful to callers.
2023-09-06 01:16:32 +02:00
Heiko Schaefer
724be38e4f
openpgp-card: in private_use_do accessors, don't panic, but return error for illegal num.
Fix: set_private_use_do() doesn't return data.
2023-09-06 01:16:32 +02:00
Heiko Schaefer
8ee389ca7a
openpgp-card: attestation_key_generation_time() only needs &self 2023-09-06 01:16:32 +02:00
Heiko Schaefer
4d5d9e7ee1
openpgp-card: allow additional status in factory reset
The opcard-rs implementation may return StatusBytes::ExecutionErrorNonVolatileMemoryUnchanged in some circumstances.

Also see https://gitlab.com/openpgp-card/openpgp-card/-/issues/70

Fixes #70
2023-09-06 01:16:32 +02:00
Heiko Schaefer
82662e6d46
openpgp-card: Remove algorithm setting from key generation
Also entirely remove set_algorithm_attributes_simple.
Callers should use AlgoSimple::matching_algorithm_attributes to determine the appropriate AlgorithmAttributes.
2023-09-06 01:16:32 +02:00
Heiko Schaefer
a54b057e00
openpgp-card: Add matching_algorithm_attributes() in AlgoSimple
Gets matching AlgorithmAttributes for the current card.
2023-09-06 01:16:32 +02:00
Heiko Schaefer
0067fe1d48
openpgp-card: don't PUT algorithm_attributes if feature is unsupported
And improve rustdocs.
2023-09-06 01:16:32 +02:00
Heiko Schaefer
b1c4b46b22
openpgp-card: Rework key import functions 2023-09-06 01:16:32 +02:00
Heiko Schaefer
32095298aa
openpgp-card: Minor cleanup 2023-09-06 01:16:32 +02:00
Heiko Schaefer
86ba745ea6
openpgp-card: use cache for immutable card settings 2023-09-06 01:16:32 +02:00
Heiko Schaefer
925d5c6f9c
openpgp-card: Cache immutable card information from ApplicationRelatedData in Card::new 2023-09-06 01:16:32 +02:00
Heiko Schaefer
0e0da24918
openpgp-card: clean up visibilities 2023-09-06 01:16:32 +02:00
Heiko Schaefer
5440fdeb1e
openpgp-card: move commands out of the apdu module 2023-09-06 01:16:32 +02:00
Heiko Schaefer
2b0111b923
openpgp-card: rustdoc 2023-09-06 01:16:32 +02:00
Heiko Schaefer
ff1afee7c5
openpgp-card: rename RsaAttrs->RsaAttributes, EccAttrs->EccAttributes 2023-09-06 01:16:32 +02:00
Heiko Schaefer
423c9d23ee
openpgp-card: add Curve::Unknown variant 2023-09-06 01:16:32 +02:00
Heiko Schaefer
da776bc4cf
openpgp-card: rename AlgorithmInformation::filter_by_keytype -> for_keytype 2023-09-06 01:16:32 +02:00
Heiko Schaefer
f7f7a1dd3c
openpgp-card: rename AlgoInfo->AlgorithmInformation 2023-09-06 01:16:32 +02:00
Heiko Schaefer
32c59a15b1
openpgp-card: move setting of AlgorithmAttributes out of gen_key_with_metadata() 2023-09-06 01:16:32 +02:00
Heiko Schaefer
11ce179c00
openpgp-card: lint fix (replace deprecated chrono call) 2023-09-06 01:16:32 +02:00
Heiko Schaefer
9761e0e664
openpgp-card: internal API cleanup, continued 2023-09-06 01:16:32 +02:00
Heiko Schaefer
315aa7a94c
openpgp-card: Transaction::card_caps doesn't need to be mut 2023-09-06 01:16:32 +02:00
Heiko Schaefer
f659a623d2
openpgp-card: handle backend capability hints in Card::new 2023-09-06 01:16:32 +02:00
Heiko Schaefer
b88caa2471
openpgp-card: rename UIF -> UserInteractionFlag 2023-09-06 01:16:32 +02:00
Heiko Schaefer
58facac819
openpgp-card: fix rustdoc markup 2023-09-06 01:16:32 +02:00
Heiko Schaefer
2d1bf919d4
openpgp-card: rename Openpgp and OpenpgpTransaction, restructure modules 2023-09-06 01:16:32 +02:00
Heiko Schaefer
01ef1ec4d1
openpgp-card: internal API tweaks
Reduce unnecessary use of ApplicationRelatedData.
2023-09-06 01:16:32 +02:00
Heiko Schaefer
e6658713cb
openpgp-card: rename Algo -> AlgorithmAttributes 2023-09-06 01:16:32 +02:00
Heiko Schaefer
8e4ee08802
openpgp-card: minor cleanup 2023-09-06 01:16:32 +02:00
Heiko Schaefer
308bd804ae
openpgp-card-sequoia: rustdoc 2023-09-06 01:16:32 +02:00
Heiko Schaefer
d3e30d5c4c
openpgp-card-sequoia: re-export Fingerprint 2023-09-06 01:16:32 +02:00
Heiko Schaefer
566fd6f9a0
card-functionality: Perform the full set of tests in a single Card<Transaction> 2023-09-06 01:16:32 +02:00
Heiko Schaefer
746f2f647d
card-functionality: adjust to backend and openpgp-card-sequoia API changes 2023-09-06 01:16:32 +02:00
Heiko Schaefer
ccf605f086
openpgp-card-sequoia: make Card<Transaction>::new private 2023-09-06 01:16:31 +02:00
Heiko Schaefer
dcf98c512c
openpgp-card-sequoia: add Card<Admin>::set_pw_status_bytes 2023-09-06 01:16:31 +02:00
Heiko Schaefer
2601e58fe3
openpgp-card-sequoia: rename Card<Admin>::as_open to ::as_transaction 2023-09-06 01:16:31 +02:00
Heiko Schaefer
212e7f335f
openpgp-card-sequoia: Transaction::to_*_card() methods
Allow more ergonomic switching to User/Sign/Admin states by directly providing a PIN, while also allowing a `None` parameter if verification has already happened.
2023-09-06 01:16:31 +02:00
Heiko Schaefer
8d5b1c0563
openpgp-card-example: adjust to card-backend refactor 2023-09-06 01:16:31 +02:00
Heiko Schaefer
7de74d702e
openpgp-card-sequoia: adjust example 2023-09-05 19:08:37 +02:00
Heiko Schaefer
15646bc50b
openpgp-card-sequoia: adjust to card-backend refactor
Note that a `open_by_ident` fn was added here: the backend now doesn't have knowledge of applications (like OpenPGP) anymore, so it can't select a card by OpenPGP card ident anymore.
2023-09-05 19:08:34 +02:00
Heiko Schaefer
4fda5d800a
scdc: remove redundant log output 2023-08-31 13:26:23 +02:00
Heiko Schaefer
0c07021043
pcsc: store reader name internally
The reader name could later be used as a source of information to signal reader limitations to callers (via CardCaps, e.g. readers that don't support extended length commands)
2023-08-29 09:56:50 +02:00
Heiko Schaefer
625df59c86
pcsc: Don't return an error if no reader is found
Fixes #68
2023-08-28 17:28:22 +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
84ee2a64f1
openpgp-card: explicitly limit command chunk size to 255 if extended length is unsupported 2023-08-28 12:00:52 +02:00
Heiko Schaefer
61175dd646
openpgp-card: add terminate_df(), activate_file() to OpenPgpTransaction 2023-08-27 22:30:59 +02:00