Commit Graph

5198 Commits

Author SHA1 Message Date
Viktor Tarasov 250364c060 pkcs15init: fix spurious gcc overflow warning,
thanks to Milan Broz (mbroz@redhat.com)
As discussed in pull request #115 (https://github.com/OpenSC/OpenSC/pull/115),
'if' test of impossible condition is removed in 'cardos' and 'incypto34' card drivers.
2013-01-04 19:03:46 +01:00
Viktor Tarasov cc5a171ddc pkcs15: regression in e35febe: compute cert length
parse_x509_cert() reviewed.
Now certificate's DER data are allocated and the DER data length is determined in one place.

https://github.com/OpenSC/OpenSC/pull/114
https://github.com/OpenSC/OpenSC/commit/e35febe
2012-12-25 20:05:45 +01:00
Viktor Tarasov 3aaf95c21b cardOS: compile on Windows
few coding style remarks
2012-12-16 11:50:08 +01:00
mtausig 1d75427f55 cardOS: Use information from AlgorithmInfo
In set_security_env, the algorithmInfo structure (from the TokenInfo file of
PKCS#15) is parsed to see, what algorithm IDs are supported for signature
operations.

Using the information from AlgorithmInfo set in set_security_env when
computing signatures.

Fixed incorrect order of code blocks. If neither a reference to rsa_sig nor to
rsa_pure_sig is found in AlogirthmInfo, boths methods are enabled before (and
not after) trying pure_sig
2012-12-16 11:23:35 +01:00
blumentopf d5c2401e19 pkcs15-gemsafeV1.c: Multiple key containers and ATR-specific PIN policies
pkcs15-gemsafeV1.c: Change PIN data structure to make MSVC compiler happy
pkcs15-gemsafeV1.c: Turn constants into macros to make MSVC compiler happy
2012-12-16 10:09:44 +01:00
Anthony Foiani f7c12574ee pkcs15-tool: initialize 'opt_auth_id' consistently.
All the other option values are initialized to NULL, so do the same to
opt_auth_id.

(Although, as they're all static globals, they should be set to 0 at
runtime anyway, I think...)

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
2012-12-10 00:54:26 -07:00
Viktor Tarasov 98ca66b1a0 release 0.13.0 2012-12-04 14:58:10 +01:00
Viktor Tarasov 8b07b9c5a7 compile on Windows, minor codding style issues 2012-12-03 15:21:22 +01:00
sjoblomt 457426543d MyEID ECDSA support 2012-12-03 14:37:13 +01:00
Viktor Tarasov 9e9b3d0bd8 tool: in 'do_apdu' increase size of send/receive buffers 2012-11-28 11:09:36 +01:00
Viktor Tarasov 60b7e52e06 pkcs15: mandatory 'publicKeyCoefficients' in encode/decode public key procedures
http://www.opensc-project.org/pipermail/opensc-devel/2012-November/018586.html
2012-11-20 22:58:37 +01:00
Ludovic Rousseau 81bbddfc24 card-gemsafeV1: Add a GemSafe V1 ATR
Thanks to Lukas Wunner for the patch
2012-11-20 19:11:23 +01:00
Anthony Foiani 27c677188e pcks11: trivial: fix debug output for CKA_PRIME_1 and CKA_PRIME_2
Without this patch, debugging output issues these as unknown
attributes:

  ... C_CreateObject(): CKA_PRIVATE_EXPONENT = 97F798...
  ... C_CreateObject(): Attribute 0x124 = EFE5AD...
  ... C_CreateObject(): Attribute 0x125 = D4D3F6...
  ... C_CreateObject(): CKA_EXPONENT_1 = 5815FD...

With this patch, we see:

  ... C_CreateObject(): CKA_PRIVATE_EXPONENT = 97F798...
  ... C_CreateObject(): CKA_PRIME_1 = EFE5AD...
  ... C_CreateObject(): CKA_PRIME_2 = D4D3F6...
  ... C_CreateObject(): CKA_EXPONENT_1 = 5815FD...

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
2012-11-20 08:46:27 +01:00
Anthony Foiani f63135afab tools: check return value after each call.
It seems that this suffered some copy and paste damage at some point.
Change so that we check each return value immediately after the API
call.

Signed-Off-By: Anthony Foiani <anthony.foiani@gmail.com>
2012-11-20 08:46:27 +01:00
Andreas Schwier fb8e0cc3b2 sc-hsm: Improved checking in sc-hsm-tool 2012-11-20 08:46:27 +01:00
Andreas Schwier 0adec1bddd sc-hsm: Fixed bug with memory released to early 2012-11-20 08:46:27 +01:00
Andreas Schwier bbbfae4bf0 sc-hsm: Now saving the internal CSR in place of the certificate and decoding the public key at initialization (RSA only) 2012-11-20 08:46:27 +01:00
Viktor Tarasov 6c051f8490 pkcs11: check arguments in get_bignum_bits() procedure
t451: segmentation fault when getting public key bits number
2012-11-12 16:46:25 +01:00
Viktor Tarasov bd86063835 t455: check validity of RSA/DSA public key components
Segmentation fault happened when reading SSH key with the non-initilized public key components.
2012-11-12 10:13:57 +01:00
Viktor Tarasov 68ee0e76e0 t447: return value from init() in reader driver not checked 2012-11-11 22:17:17 +01:00
Viktor Tarasov f7771c9b08 libopensc: check data returned by 'read-public-key'
fix error message
2012-11-11 21:47:10 +01:00
Viktor Tarasov da5934a6ff libopensc iso7816: retry SELECT with FCI if SELECT without FCI fails
t457 (https://www.opensc-project.org/opensc/ticket/457)
For some cards that currently use the common iso-7816 operations
only SELECT with return of FCI/FCP can be applied.

In iso-7816 'select-file' handle, if 'SELECT without FCI' fails with error code 6A86,
then retry 'SELECT with FCI'. Other error code can be added.

Sorry for the 'coding style' noise.
2012-11-11 20:38:30 +01:00
Viktor Tarasov a4ac33f32a build sc-hsm-tool: link with OpenSSL libs 2012-11-11 20:36:57 +01:00
Andreas Schwier 7c714860a2 sc-hsm: Fixed bug decoding CVCs without domain parameter 2012-11-11 12:53:03 +01:00
Andreas Schwier 33da14c459 sc-hsm: Added code to prevent CV certificates being listed as X.509 certificates 2012-11-11 12:53:03 +01:00
Andreas Schwier ffb20e5916 sc-hsm: Added sc-hsm-tool with DKEK support and key wrap / unwrap 2012-11-11 12:53:03 +01:00
Viktor Tarasov 8d35b2cf58 build MSI: add openpgp.profile 2012-11-11 00:57:09 +01:00
Viktor Tarasov 1d1abe4c21 pkcs15-crypt tool: set HASH_NONE crypto flags when the hash do not asked
without this for the cards that have only RAW mechanism
it's not possible to compute signature with PKCS1 padding and without hash.
2012-11-11 00:42:52 +01:00
Viktor Tarasov 7fbca94698 opensc: new card operation 'read-public-key'
In PukDF of PKCS#15 the public key value can be presented by 'direct value', by path or by path and reference.
For the different cards the public key can be stored in EF, internal EF or in card specific SDO (security data objects).
A new card handle allows to read out the public key from the card specific SDOs.
2012-11-09 14:36:14 +01:00
Viktor Tarasov 6819b32e18 pkcs15-tool: for public key show the presence of 'direct' value 2012-11-09 14:34:46 +01:00
Viktor Tarasov 62fd67f6a8 gemsafeV1: set 'auth-method' for the emulated PIN PKCS#15 object 2012-11-09 14:33:23 +01:00
Viktor Tarasov 0166321835 libopensc: increase maximum number of card drivers
http://www.opensc-project.org/pipermail/opensc-devel/2012-October/018552.html
Default driver is disabled on 0.13 because there are more drivers listed in ctx.c. (leonardo.schenkel@gmail.com)

SC_MAX_CARD_DRIVERS is increases from 32 to 48. It's not the best solution, but the most rapid.
Will be waiting for the better proposals.
2012-11-04 16:44:34 +01:00
Viktor Tarasov e35febed5b pkcs15: use whe available the pkcs15 object content
when reading certificate, try to get the pkcs15 object's content
before reading the certificate file.
2012-10-21 16:30:06 +02:00
Viktor Tarasov 4cf3a3b204 move CK_VERSION data from 'pkcs15' to 'sc-card'
CK_VERSION is included into PKCS#11 data but is not specified by PKCS#15.

CK_VERSION can be provided by card's pkcs15 emulator or by the card's driver,
including the cards with the native support of pkcs#15 (and thus without pkcs15 emulator).

That's why the more general solution is to have these data included into 'sc-card' data type.
2012-10-21 16:24:11 +02:00
Andreas Schwier aaedef70b5 sc-hsm: Added ability to initialize SmartCard-HSM using C_Initialize and C_InitPIN on PKCS#11 interface 2012-10-21 15:51:55 +02:00
Andreas Schwier fba298c6f4 pksc11: Added ability to indicate hardware and firmware version information at PKCS#11 interface 2012-10-21 15:51:55 +02:00
Viktor Tarasov 6b7d8af08e build: release candidate 0.13.0 RC1 2012-10-03 16:24:47 +02:00
Viktor Tarasov 40ff0e4ede pkcs11: Fixed SIGV when deleting public key objects via PKCS#11
Thanks to Andreas Schwier.
2012-10-02 09:26:35 +02:00
riham c91f0e84cb entersafe: Disable RSA:512bits that modified in entersafe_generate_key and entersafe_store_key function
1.Added a prompt while initializing ePass2003 \n 2.Modify code to disable 512bit key
2012-10-01 18:52:19 +02:00
Viktor Tarasov 4b9e82d392 MSI: illegal caracters in component ID
OpenSC.wxs(168) : error CNDL0014 : The Component/@Id attribute's value, 'sc-hsm.profile', is not a legal identifier.  Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.).  Every identifier must begin with either a letter or an underscore.
2012-10-01 13:30:35 +02:00
Andreas Schwier 72786abe1f sc-hsm: Added write support for RSA and ECC keys, certificates and data objects 2012-10-01 13:09:02 +02:00
Andreas Schwier a9393aa983 framework-pkcs15: Fixed a SIGV when key generation returned ERROR_NOT_SUPPORTED 2012-10-01 13:04:02 +02:00
Andreas Schwier 1619a42375 ecc: Adding more curves 2012-10-01 13:04:02 +02:00
Andreas Schwier db3f5f5f17 framework-pkcs15: Fixed issued with uninitialized variable keysize 2012-10-01 13:04:02 +02:00
Andreas Schwier f508b21253 pkcs15: Add support to encode EC private key description 2012-10-01 13:04:02 +02:00
Andreas Schwier 7b943b934b pkcs15: Fixed typo 2012-10-01 13:04:01 +02:00
Andreas Schwier 02fe6d474b pkcs11-tool: Fixed issue with ID increment failing on constant data 2012-10-01 13:04:01 +02:00
Viktor Tarasov 249b769a4b pkcs11: unlink 'pubkey' FW object when deleting related certificate
Thanks to Andreas Schwier.
http://www.opensc-project.org/pipermail/opensc-devel/2012-September/018455.html

In PKCS#11 FW, the 'certificate' FW object is used to create corresponding 'public'key' FW object
or to get some of its attributes.
Seg.fault occured when, in the same session, the related certificate was destroyed and after that
there was the attempt to get such public key attributes.
2012-10-01 10:47:52 +02:00
Viktor Tarasov df9a4d0b2c pkcs15: for 'sc_pkcs15_cer's data use the 'der' object type
To hold the raw certificate blob in 'sc_pkcs15_cert' data use the 'sc_pkcs15_der' data type.
also:
; in 'pkcs15-cert.c' use short call of the debug messages;
; in 'destroy-object' pkcs15 framework handler take into account the multi-application cards:
-- when binding card use the application info;
-- when finalizing profile use the application ID.
2012-09-30 22:54:52 +02:00
Ludovic Rousseau ea40e7fe24 Use AM_CPPFLAGS instead of INCLUDES
Fix autoreconf warnings:

$ autoreconf -vis -Wall
[...]
src/common/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/libopensc/Makefile.am:19: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/minidriver/Makefile.am:15: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/pkcs11/Makefile.am:10: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/pkcs15init/Makefile.am:36: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/scconf/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/sm/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/tests/Makefile.am:9: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/tools/Makefile.am:15: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2012-09-25 23:03:38 +02:00