Commit Graph

7599 Commits

Author SHA1 Message Date
Frank Morgner 65a86b8331 travis: fixed PATH on macOS 2019-05-21 19:36:17 +02:00
Frank Morgner b7b501d0a5 fixed issues reported by clang-analyzer 2019-05-21 19:34:46 +02:00
Frank Morgner 3c83a80b57 fixed printing non primitive tag
fixes undefined bitshift
2019-05-21 19:34:46 +02:00
Frank Morgner 1423c6bb90 CI: integrate clang-tidy (disabled)
files that have warnings are currently excluded
2019-05-21 19:34:46 +02:00
Raul Metsma 1e59643caa Remove process_arr unused file argument and fix clang-tidy warnings
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-05-21 19:34:46 +02:00
Jakub Jelen e501c5ae81 Unbreak build without OpenSSL 2019-05-21 18:44:06 +02:00
Frank Morgner 65d607af66 fixed 325860 Dereference before null check 2019-05-14 14:50:17 +02:00
Frank Morgner 630bcbedd4 fixed 337490 Unchecked return value 2019-05-14 14:50:17 +02:00
Frank Morgner e275b34269 fixed 339157 Unused value 2019-05-14 14:50:17 +02:00
Martin Paljak a5f63fed0c
Merge pull request #1635 from OpenSC/esteid-2018
EstEID 2018+ driver
2019-05-02 12:54:21 +03:00
Martin Paljak 2829c5870f Address review comments
Change-Id: I9aa97c8a9878dddd3e6f1a2baa877d188b9d7fe5
2019-05-02 11:51:02 +03:00
Martin Paljak 5f5d40521e Avoid 6282 reply for a successful operation
Change-Id: I5d4d3103692fc6db51f13fc5338360289c26af9a
2019-05-02 11:51:02 +03:00
Martin Paljak fc8e9bf3f3 Address review comments and further reduce LOC
and make sure the card is always handled emulated card first

Change-Id: I60174c2793bb882fb73716f62a652d84e028382c
2019-05-02 11:51:02 +03:00
Martin Paljak b3d4a0d69a EstEID 2018+ driver
This adds support for a minimalistic, small and fast card profile based on IAS-ECC.

Based on information from https://installer.id.ee/media/id2019/TD-ID1-Chip-App.pdf
and proprietary driver snoops.

Thanks to @metsma and @frankmorgner.

Change-Id: I2e4b4914d8a3b991d9a639728695abf4a2362ca0
2019-05-02 11:47:31 +03:00
Andreas Kemnade c3a9458fa8 egk-tool: fix missed initialisation of card pointer
If util_connect_card_ex() fails, sc_disconnect_card() will use a
random pointer leading to segmentation faults.
2019-05-02 10:09:08 +02:00
Andreas Kemnade 209be72979 eGK: fix path for vd/gvd
path was wrong, the same as for pd
2019-05-02 10:09:08 +02:00
Andreas Kemnade 9ca836975a Starcos: added another ATR for 2nd gen. eGK (TK) 2019-05-02 10:09:08 +02:00
Raul Metsma 63fd71c245 Remove unused sc_pkcs15emu_opt_t structure
Only usage was removed SC_PKCS15EMU_FLAGS_NO_CHECK flag

Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-05-02 10:08:46 +02:00
Frank Morgner f0a6a568f4 fixed Local variable hides global variable 2019-05-02 10:08:28 +02:00
Frank Morgner 0bc95cb6a1 added include guards 2019-05-02 10:08:28 +02:00
Frank Morgner 86ba3ea489 fixed Wrong type of arguments to formatting function 2019-05-02 10:08:28 +02:00
Raul Metsma 5123531e62 Fix EstEID 3.4 signing
opensc master requires now SC_ALGORITHM_RSA_HASH_NONE

Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-05-02 10:06:19 +02:00
Frank Morgner 7449b00768 pkcs11: avoid double initialization of notify 2019-04-26 23:51:37 +02:00
Frank Morgner c671083ee3 fixed missing file 2019-04-25 16:46:07 +02:00
Frank Morgner 7df789ec5d fixed 337490 Unchecked return value 2019-04-25 15:44:11 +02:00
Frank Morgner 8382f243b2 fixed 337891 Out-of-bounds write 2019-04-25 15:44:11 +02:00
Frank Morgner 1a656f2abe use OpenPACE 1.1.0 2019-04-25 15:44:11 +02:00
Raul Metsma bbec50bfdb Remove unused SC_PKCS15EMU_FLAGS_NO_CHECK flag
Fixes #1634

Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-04-25 14:53:25 +02:00
Timo Teräs 3688dfe238 MyEID: simplify key component loading
Encode the component ID to be key type and component ID. This allows
each combination to be unique and direct mapping to card component
ID type in the code by just taking the low byte. This simplifies
the code, and reduces confusion as there is now only one #define
for each component.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
2019-04-25 14:53:10 +02:00
Timo Teräs 3f832ca6da MyEID: implement support for 4K RSA keys (MyEID 4.5+)
MyEID starting version 4.5 supports 4K RSA keys. The card also
now supports proper APDU chainging (for sending large APDUs) and
receiving large responses via GET_RESPONSE splitting.

This updates the following:
* detection code properly announces 3K and 4K RSA support
  when available
* APDU chaining is used when possible
* use ISO GET_RESPONSE handling for large responses
* max_recv_size is set to 256 which it always was supposed to be
  as the old cards respond with that large responses too
* use the 2K signing kludge only on cards that need it
* unwrap and decipher code paths unified to the extent possible

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
2019-04-25 14:53:10 +02:00
Timo Teräs 0e25c1d2a6 MyEID: detect card from ATR historical data instead of full ATR
This will simplify the matching code, and match prototype cards.

Signed-off-by: Timo Teräs <timo.teras@iki.fi>
2019-04-25 14:53:10 +02:00
Raul Metsma 3d22d04113 No need link to libssl
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-04-25 14:52:43 +02:00
Ludovic Rousseau ffaaf1c0d3 pkcs11-spy: parse CKM_AES_GCM for C_EncryptInit() 2019-04-25 14:52:20 +02:00
Ludovic Rousseau 69727c79ad pkcs11.h: add CK_GCM_PARAMS structure 2019-04-25 14:52:20 +02:00
Ludovic Rousseau 98ec27e768 pkcs11-spy: log pParameter buffer for C_EncryptInit & C_DecryptInit 2019-04-25 14:52:20 +02:00
Frank Morgner bfa94dc90d
Merge pull request #1600 from AlexandreGonzalo/trustonic_pkcs11 2019-04-25 14:51:54 +02:00
Frank Morgner b06398c1af macOS: install man, doc, completion to /usr/local 2019-04-25 14:49:40 +02:00
alegon01 e21cb5712c Fix in encrypt_decrypt(), initialize the mgf 2019-04-24 14:03:35 +02:00
Jakub Jelen 13429baed0 cac: Avoid signed/unsigned casting reported by coverity
src/libopensc/card-cac.c:1707: negative_returns: "val_len" is passed to a parameter that cannot be negative.
2019-04-23 14:49:45 +02:00
Frank Morgner abc6cfbe68 Added more CI card testing 2019-04-18 02:03:28 +02:00
Frank Morgner 8f2b4c7923 macos: use hierarchical layout for installer 2019-04-18 01:42:58 +02:00
Dmitriy Fortinskiy 8cf1e6f769 pkcs11-tool: List supported GOST mechanisms 2019-04-17 16:42:12 +02:00
Dmitriy Fortinskiy a5382d32fd pkcs11-tool: Show GOSTR3410-2012 keys 2019-04-17 16:42:12 +02:00
Dmitriy Fortinskiy 0e12b1dc71 pkcs11-tool: Generate GOSTR3410-2012 keys 2019-04-17 16:42:12 +02:00
Dmitriy Fortinskiy 4614beb87e pkcs11-tool: Add keys access flags 2019-04-17 16:40:41 +02:00
Dmitriy Fortinskiy 2600f1ae43 win32: Add Rutoken ECP ATRs to the minidriver 2019-04-17 16:38:49 +02:00
Dmitriy Fortinskiy aff2059ec1 card-rtecp: Fix SELECT FILE 2019-04-17 16:38:49 +02:00
Dmitriy Fortinskiy fe4dae4d31 card-rtecp: Add Rutoken ECP SC ATR 2019-04-17 16:38:49 +02:00
Raul Metsma 91a1dd9af4 Option to delete object by index
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-04-17 14:38:40 +02:00
Raul Metsma 3935d501bf Implement Secret Key write object
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-04-17 14:37:49 +02:00