Commit Graph

6964 Commits

Author SHA1 Message Date
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
Frank Morgner 9583d3b650 md: fixed memory leak
may be related to https://github.com/OpenSC/OpenSC/issues/1106
2017-11-30 11:30:31 +01:00
Frank Morgner 654ca69c47 initialize notifications in PKCS#11 and tools
... and don't panic when they are not initialized
2017-11-21 13:01:12 +01:00
Frank Morgner 3f0d5ce336 opensc-notify: register a desktop menu entry
- fixes showing notifications in gnome-shell via gio2
- removes gdbus interface for notifications
- fixes https://github.com/OpenSC/OpenSC/issues/1186
2017-11-21 13:01:12 +01:00
Frank Morgner 4444d24f59 win32: generate PDB files for releases
https://msdn.microsoft.com/fsk896zz.aspx

fixes https://github.com/OpenSC/OpenSC/issues/1191
2017-11-21 10:54:48 +01:00
Frank Morgner ddc9baed25 added missing opensc-asn1.1
fixes https://github.com/OpenSC/OpenSC/issues/1206
2017-11-21 10:42:58 +01:00
Jakub Jelen 09af8714ad Avoid GCC 7 warnings with -Werror (#1196)
* Avoid GCC 7 warnings with -Werror

-Werror=implicit-fallthrough=
	libopensc/card-incrypto34.c
		not sure if this is a bug or intention
	libopensc/card-rutoken.c
		most probably intention
	libopensc/card-westcos.c
		remove bogus if so the compile is not confused
		I will fill a separate bug to gcc probably
	pkcs15init/pkcs15-iasecc.c
		Simplify the log and avoid compiler confusion
	sm/sm-common.c
		explicit fallthrough
	tools/pkcs11-tool.c
		use explicit fallthrough comment
	tools/pkcs15-init.c
		The fallthrough is obvious here

-Werror=format-truncation=
	libopensc/pkcs15-itacns.c
		use explicit string lengths
	pkcs11/framework-pkcs15.c
		calculate the truncation
	tests/pintest.c
		avoid sprintf
	tools/pkcs15-crypt.c
		avoid sprintf
	tools/pkcs15-init.c
		calculate the truncation
2017-11-17 10:47:53 +01:00
Raul Metsma 514f898671 Fix reading EstEID certificates with T=0 (#1193) 2017-11-17 10:46:34 +01:00
Raul Metsma f1aa2a61c9 Cleanup expired EstEID card ATR-s
Signed-off-by: Raul Metsma <raul@metsma.ee>
2017-11-17 10:05:25 +01:00
Frank Morgner 0211f638c3 only set MACOSX_DEPLOYMENT_TARGET
which is equivalent to use -mmacosx-version-min
2017-11-17 10:04:46 +01:00
Frank Morgner 9a2a62e641 fixed codesigning of opensc tools 2017-11-17 10:04:46 +01:00
Frank Morgner c35eb1c9bc macOS: Disable notifications by default
fixes https://github.com/OpenSC/OpenSC/issues/1174
2017-11-17 10:04:46 +01:00
Frank Morgner 027205cc4d use MACOSX_DEPLOYMENT_TARGET 2017-11-17 10:04:46 +01:00