Commit Graph

6876 Commits

Author SHA1 Message Date
Frank Morgner a97fc86cc9 starcos: reverted deactivation of pin cmd for 2.X
It simply uses the implementation of iso7816. Fixes regression from
19bbfc76f5
2018-03-09 14:36:55 +01:00
Frank Morgner 6f58a97906 md: added STARCOS 3.5 ATRs 2018-03-09 14:36:55 +01:00
Frank Morgner 01810fcb66 STARCOS: Added support for 3.5
ATR and differences between 3.4/3.5 are based on
https://github.com/CardContact/sc-hsm-embedded
Actually, 3.5 is untested, but 3.4 is almost identical, so we hope that
for 3.5 everything is fine.
2018-03-09 14:36:55 +01:00
Frank Morgner 196c838957 fixed use after free
ICCSN and CHN pointed into EF.GDO's content, which was freed
preemptively. Regression of 0502a839c6
2018-03-09 14:36:55 +01:00
Frank Morgner b403934718 PKCS#15: prevent use of empty serial number in TokenInfo
... and initialize the serial number with the card's serial number if
nothing useful is in EF.TokenInfo
2018-03-09 14:36:55 +01:00
Frank Morgner e8e8153cda md: prevent endless loop for card without sn 2018-03-09 14:36:55 +01:00
Frank Morgner d29bdf9da0 md: register starcos cards 2018-03-09 14:36:55 +01:00
Frank Morgner c3ffdecd0b rename SC_SEC_ENV_KEY_REF_ASYMMETRIC to SC_SEC_ENV_KEY_REF_SYMMETRIC
This reflects the actual use of the identifier by the card drivers.
2018-03-09 14:36:55 +01:00
Frank Morgner e2ba2f8192 Starcos 3.4: implemented PSO:DEC 2018-03-09 14:36:55 +01:00
Frank Morgner b05273b01e starcos: fixed key reference for "local" key id 2018-03-09 14:36:55 +01:00
Frank Morgner 1d4f59ea51 compiler fix 2018-02-20 22:16:51 +01:00
Frank Morgner 86350d3f72 fixed compilation proble 2018-02-20 22:16:51 +01:00
Frank Morgner 905e95eb37 compiler fix 2018-02-20 22:16:51 +01:00
Frank Morgner f862060614 EAC: Clearify naming of functions and data
Use names that are specific to EAC, not the German ID card (nPA),
because Protocol and Commands are defined by BSI TR-03110 and ICAO.
Functions that are nPA specific are moved to card-npa.h.
2018-02-20 22:16:51 +01:00
Mardalemer 6843ab4190 pkcs15init: Fix rutokenS FCP parsing (#1259)
RutokenS returns data with little endian byte order, due to this
fact token wouldn't work with standard function. So function for
parsing fcp from little endian data was inplemented.
2018-02-13 13:24:28 +01:00
Frank Morgner 8ee2c61932 Return SC_SUCCESS in openpgp_card_reader_lock_obtained
prevents locking the card forever in case of a problem
2018-02-12 09:45:36 +01:00
Frank Morgner 50a35c1bae OpenPGP: Workaround for change in Extended Capabilities
The maximum length for sending and receiving data can now be found in DO
7F66. For now, we just use the default values for short/extended length
capabiliites.
2018-02-12 09:45:36 +01:00
Frank Morgner 36894c87cf
sc-hsm: fixed accessing version info (#1252)
fixes https://github.com/OpenSC/OpenSC/issues/1244
2018-02-07 12:00:09 +01:00
Frank Morgner 88175e35d3 PIV: use better long name 2018-02-07 11:57:48 +01:00
Frank Morgner 87cdfcb08c OpenPGP: Implemented "keep alive" command 2018-02-07 11:57:48 +01:00
Frank Morgner d719977d14 Reselect PKI-Applets after card reset
PKI-Applets may not be active if the card has been reset or unpowered.
The SELECT command used to activate the applet, is identical to the one
used during card matching or initialization.
2018-02-07 11:57:48 +01:00
Jakub Jelen e46193499b Use only 'filename' for file arguments replacements 2018-02-07 11:13:09 +01:00
Jakub Jelen 391ad1db01 Use filename replacement to allow completion 2018-02-07 11:13:09 +01:00
Jakub Jelen 5cb0484ea6 Correctly autocomplete --write-object option 2018-02-07 11:13:09 +01:00
Jakub Jelen 1d49e8e0db docs/tools: Improve bash-completion template and generation
This allows us to generate templates also for arguments expecting
files (input, output) or PKCS#11 modules. The general ideal was
already implemented, but never completed.
2018-02-07 11:13:09 +01:00
Jakub Jelen ccfd4b4c35 cac: Try to read the ACA file
Some "unfriendly" cards return SW 90 00 to any instruction including
the ACA file selection and therefore they are identified as CAC card.
To avoid this, we will try to read the assumed ACA file and we will
mark the card as matched only if we will read something from that file.
We do not parse the content yet.
2018-02-07 11:13:09 +01:00
Jakub Jelen e7deb3410d cac: Fail if the read instruction does not return anything
To avoid infinite loop on "unfriendly" cards, we assume that
read data instruction always returns some data. It it does not,
we can safely assume the file is not there or it is not the card
we are looking for.
2018-02-07 11:13:09 +01:00
Jakub Jelen ed0cfbd808 libopensc: Log what configuration file is used
This simplifies debugging
2018-02-07 11:13:09 +01:00
edgarholleis a7b066cc83 Fix memleak (#1255) 2018-01-29 10:30:03 +01:00
Frank Morgner e5699ef04b
DNIe: card also supports 1920 bits (#1247)
fixes https://github.com/OpenSC/OpenSC/issues/1246
2018-01-28 21:25:42 +01:00
Frank Morgner a0b562a7c8 documented usage of SM_MODE_ACL
fixes https://github.com/OpenSC/OpenSC/issues/971
2018-01-24 11:05:31 +01:00
Frank Morgner f24b55db4a IAS/ECC: fixed applet selection
fixes https://github.com/OpenSC/OpenSC/issues/1240
2018-01-24 10:45:16 +01:00
Frank Morgner 74553a5a8f PC/SC: don't reset the card on disconnection
Windows/macOS (minidriver/tokend) handle the authentication status and
perform an explicit logout on shutdown. PKCS#11 standard requires a
session for logging into the card; when closing the session we perform
an explicit logout. Hence, the authentication status should be reset
even if not performing a reset on disconnect.
2018-01-22 15:27:18 +01:00
Frank Morgner 490e825a65 OpenPGP: implemented GET CHALLENGE 2018-01-22 15:26:44 +01:00
Frank Morgner 449f6c2b94 OpenPGP: Added support for PIN logout and status 2018-01-22 15:26:44 +01:00
Frank Morgner 995845b002 openpgp: factory reset is possible if LCS is supported 2018-01-22 15:26:44 +01:00
Frank Morgner ddeb01ddc1 ISO7816: allow nested CP DOs 2018-01-22 15:26:44 +01:00
Frank Morgner fccc42295d OpenPGP: Added basic support for OpenPGP card V3
partially implements https://github.com/OpenSC/OpenSC/issues/1215

Refactored OpenPGP code so that future versions of the card will be
accessed using the logic for OpenPGP V2. We hope that backward
compatibility of the standard will keep the new versions functional.
2018-01-22 15:26:44 +01:00
Frank Morgner 16354f11af OpenPGP: fixed selecting Applet
fixes https://github.com/OpenSC/OpenSC/issues/1230
2018-01-22 15:26:44 +01:00
Frank Morgner 44447b7801 fixed warnings about uninitialized data 2018-01-17 00:28:42 +01:00
Jakub Jelen 9b2023c7ae SimpleTLV: Skip correctly two bytes after reading 2b size (#1231) 2018-01-17 00:28:05 +01:00
Frank Morgner 74e7200c31 macOS: fixed detection of OpenPACE package 2017-12-19 12:52:50 +01:00
Frank Morgner b2cca65237 sc-hsm: check integrity of SM channel
cope with multiple processes that may reset the SM channel when
accessing the card at the same time
2017-12-13 12:22:27 +01:00
Frank Morgner 47993116da macOS High Sierra: fixed dmg creation
fixes https://github.com/OpenSC/OpenSC/issues/1198
2017-12-05 08:27:55 +01:00
Frank Morgner bb4bdc8a2c CardOS: Try forcing max_send_size for PSO:DEC
Fixes https://github.com/OpenSC/OpenSC/issues/1208
Fixes https://github.com/OpenSC/OpenSC/issues/1118
Fixes https://github.com/OpenSC/OpenSC/issues/1005
Fixes https://github.com/OpenSC/OpenSC/issues/802
2017-12-04 21:09:46 +01:00
Frank Morgner 3e7f7e632c SC-HSM: Don't block generic contactless ATR 2017-12-04 21:09:26 +01:00
Frank Morgner 804ac2b7f2 fixed compiler warning 2017-12-04 21:09:26 +01:00
Frank Morgner 5ca99febe3 ISO 7816-4 doesn't force a maximum for GET CHALLENGE 2017-12-04 21:09:26 +01:00
Frank Morgner 6f37229303 opensc-explorer/opensc-tool: Allow extended APDUs 2017-12-04 21:09:26 +01:00
Frank Morgner d0d9b974a7 md: protect MD entry points with CriticalSection
CardDeleteContext may be called at any time, interrupting any ongoing
operation with the same PCARD_DATA. This leads to a race condition when
CardDeleteContext deletes, for example, the sc_context_t which the
interrupted call still wants to access. We have seen and fixed this
problem in https://github.com/OpenSC/OpenSC/issues/973 specifically for
the PIN entry process, however, it also applies to all other calls to
the md.

The new implementation removes the need for global data in the md.
2017-11-30 11:30:31 +01:00