Commit Graph

819 Commits

Author SHA1 Message Date
Nguyễn Hồng Quân 70890a8f61 Merge branch 'master' into gnuk
Conflicts:
	src/libopensc/card-openpgp.c
	src/tools/openpgp-tool.c
2015-08-31 21:55:14 +08:00
Viktor Tarasov e0aec3764a pkcs15init: 'store-or-update' certificate option 2015-05-10 14:35:41 +02:00
Viktor Tarasov 3cf56d8fb7 pkcs15init: fix non-unique-ID control 2015-05-10 14:35:41 +02:00
Frank Morgner 01e573b987 profile: fixed resource leak 2015-05-08 09:11:54 +02:00
Frank Morgner 6cb99be821 pkcs15-setcos: fixed resource leak 2015-05-08 09:11:54 +02:00
Frank Morgner 44253c63d0 pkcs15-rtecp: fixed resource leak 2015-05-08 09:11:54 +02:00
Viktor Tarasov d636338eaf pkcs15-oberthur: fix memory leakage 2015-05-08 09:11:54 +02:00
Viktor Tarasov ac84d282b1 myeid: fixed resource leak
pkcs15-myeid: fix memory leakage
myeid: fix memory leakage
2015-05-08 09:11:40 +02:00
Viktor Tarasov 475ce71453 iasecc: fixed resource leak
pkcs15-iasecc: fix memory leakage
iasecc: fix memory leakage
2015-05-08 09:11:20 +02:00
Frank Morgner 68becc8fc4 pkcs15-gpk: fixed resource leak 2015-05-08 09:11:19 +02:00
Frank Morgner d4fd135e20 pkcs15-cflex: fixed resource leak 2015-05-08 09:11:19 +02:00
Frank Morgner 4af4308d19 authentic: fixed resource leak
pkcs15-authentic: fixed resource leak
card-authentic: fixed resource leak
2015-05-08 09:10:48 +02:00
viktorTarasov c754e3f197 Merge pull request #444 from frankmorgner/pkcs11-error-handling
Improved error handling for PKCS#11 module
2015-04-25 13:04:07 +02:00
Doug Engert ee23d28654 EC field_length changes for non-multiple of 8 bits curves
In OpenSC the EC field_length is the number of bits in the field.
Most curves have a field_length which is a multiple of 8 bits
but there are many that are not.

The X and Y points and privateD are stored in octetstrings
so there may need to be an extra byte in the octetstring.

An OpenSSL BIGNUM will drop leading zero bytes, so its size can not be used
to determine the field_length.

fix #440
fix #433
2015-04-25 12:21:39 +02:00
Frank Morgner c8a7c8bc7a fixed typo 2015-04-21 01:04:18 +02:00
Thomas Calderon 117f3a74be iasecc: Fix key usage when provisioning card
* Avoids overriding key_usage when creating objects on the card.
2015-03-31 18:25:54 +02:00
Philip Wendland e258cec13e IsoApplet: Add nistp224, secp192k1 and secp256k1 curves
secp*k1 curves are only supported applet version >= 0.6.0 because of an issue
with encoding ECC public keys with small parameters.
2015-03-29 13:34:58 +02:00
Philip Wendland bba6e17aa9 isoApplet: Fix indentation of isoApplet.profile 2015-03-29 13:34:58 +02:00
Hannu Honkanen 2fffbce65c myeid: update EC support for MyEID-v4 card 2015-03-14 17:47:44 +01:00
viktorTarasov 595be37fee Merge pull request #305 from philipWendland/master
Add support for the IsoApplet Java Card applet
2015-03-07 23:36:25 +01:00
Viktor Tarasov 31124ac4f9 pkcs15init: allocate EC parameters 2015-03-04 19:46:21 +01:00
Philip Wendland 74aeb8c923
IsoApplet: register supported EC curve *per curve* 2015-02-22 23:08:18 +01:00
Philip Wendland 59eeacb74b
IsoApplet: react to removal of sc_pkcs15_ec_parameters in fa923831f8 2015-02-20 22:07:49 +01:00
Philip Wendland da05fa2a47
IsoApplet: try to fix EC parameters when importing private keys from file 2015-02-20 21:55:35 +01:00
Philip Wendland 44d724b012
IsoApplet: fix more (comment) alignment issues with tabstop=8 2015-02-20 21:55:35 +01:00
Philip Wendland 5628a06353
IsoApplet: Align comments with spaces instead of tabs
Better view with tabstop=8.
2015-02-20 21:55:35 +01:00
Philip Wendland e3cc851b72
IsoApplet: EC key-gen rework and refactorings
Rework the EC key generation mechanism to send the curve parameters to
the card. In earlier versions, the applet had a copy of the curve
parameters and there was a different algorithm reference for every
curve. This is unfeasible when trying to support a larger number of
curves because of size limitations of the applet.
This commit additionally includes some refactorings that should not
change the functionality.
2015-02-20 21:55:33 +01:00
Philip Wendland 48bd6b0964
Add support for the IsoApplet (Java Card applet)
The IsoApplet can be found here:
https://github.com/philipWendland/IsoApplet
Add read/write support for this applet, including RSA and
ECC support.
2015-02-20 21:55:26 +01:00
Pedro Martelletto ced77ae6c7 cardos: overwrite content of deleted private key
when deleting a private key object, overwrite its contents so the key can no longer be used.

(VTA: original commit touched to use LOG macros and add debug logs)
2015-02-20 18:03:37 +01:00
Viktor Tarasov fa923831f8 introduce EC curve OID into algorithm info data
needed to store information about EC curve supported by card.
Primary usage is when importing/generating key to get know if particular curve is supported by card.
2015-02-20 13:49:18 +01:00
Viktor Tarasov 96265e6d08 pkcs15init: superpluous 'ec-params' in init data
Pkcs15init data, used to import/generate key objects, includes twice the same EC parameters data:
 - explicit 'params' data
 - part of sc_pkcs15_pubkey/sc_pkcs15_prkey
Explicit 'ec-params' data is removed.
2015-02-07 20:00:41 +01:00
Viktor Tarasov 08eb700b97 revert or partially revert some of recent commits
b94c163 - invalid, non-tested
11881a6 -- src/libopensc/card-iasecc.c -- return from select has to be ignored,
3a92bf7 -- src/pkcs11/slot.c -- SEGFAULT issue #373
3a92bf7 -- src/tools/piv-tool.c -- confirmed by author
6759c04 -- src/pkcs15init/pkcs15-lib.c -- file instantiation error has to be ignored
2015-02-07 19:31:17 +01:00
Frank Morgner 3a92bf7af5 fixed resource leaks 2015-02-05 01:38:41 +01:00
Frank Morgner 11881a61b8 removed/fixed dead code 2015-02-05 01:38:41 +01:00
Frank Morgner a3fc62f79f fixed NULL dereference (or warning thereof) 2015-02-05 01:38:40 +01:00
Frank Morgner 8d902d1ed3 fixed out of bounds read/write/access 2015-02-04 09:24:50 +01:00
Frank Morgner ed9572422f check return values 2015-02-05 01:37:53 +01:00
Frank Morgner 5e3d54186a removed useless check for non-null array 2015-02-05 01:37:53 +01:00
Frank Morgner 6759c04b26 don't ignore errors 2015-01-28 04:45:08 +01:00
Frank Morgner 2e04fa99c1 fixed pointless array comparisons 2015-01-28 07:39:35 +01:00
Frank Morgner 7fb495ac31 fixed self assignment 2015-01-28 07:10:57 +01:00
Frank Morgner 87b2403673 fixed out of bounds access/write 2015-01-28 07:00:02 +01:00
Frank Morgner b1b99ce7e5 fixed integer underflow 2015-01-28 06:03:52 +01:00
Frank Morgner 77752f442d fixed unused value 2015-01-28 05:47:20 +01:00
Frank Morgner fdd38f6e04 fixed copy into fixed size buffer 2015-01-28 04:30:40 +01:00
Frank Morgner 7a34c204c1 fixed dereference before null check
silence warnings reported by coverity-scan
2015-01-22 20:29:33 +01:00
Thomas Calderon bbedd4ef00 IAS-ECC: improve PKCS#11 compliance Issue #336
* Ensure CKA_ALWAYS_SENSITIVE and CKA_NEVER_EXTRACTABLE are only set when
  generating the key on board, not reason to set them when importing a private
  key.
2015-01-05 13:59:37 +01:00
Nguyễn Hồng Quân 7f08983240 Merge branch 'master' into gnuk
Conflicts:
	src/tools/openpgp-tool.c
2014-12-09 02:40:33 +08:00
Andreas Schwier d014056f1d sc-hsm: Add support for Koblitz curves secp192k1 and secp256k1 (Bitcoin) 2014-11-04 17:11:34 +01:00
Philip Wendland 955a339148 Merge PR#288 from philipWendland:upstream-ecc-fix
add the possibility to store public ECC keys encoded according to SPKI
EC pubkey storing: Check if params are available before copying.
pkcs15-lib.c / sc_pkcs15init_store_public_key may be called with keyargs->key.u.ec.params.value == NULL. In this case, allocating and copying the parameters will fail. Add a check to prevent this.
2014-10-01 15:27:26 +02:00