Commit Graph

4210 Commits

Author SHA1 Message Date
martin 5f1b3a2288 Fix [4911]
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4929 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-08 08:56:12 +00:00
andre 559e4f3dc4 framework-pkcs15 [pkcs15_logout]: Better propagation of errors
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4928 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-08 03:31:07 +00:00
andre 5b69b39c33 sc_pkcs15_pincache_revalidate: Avoid compiler warning 'discards qualifiers from pointer target type'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4927 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 18:59:49 +00:00
andre de6021d6f2 compat_strlcat: Avoid compiler warning 'no newline at end of file'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4926 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 18:51:23 +00:00
martin f5e21e0ba0 Complete change, SIMCLIST_DUMPRESTORE is by default off.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4925 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 18:35:43 +00:00
andre ea4ddf8f17 pkcs15-pin: If the usage counter of a cached PIN is expired, then free that cached PIN instead of freeing the objects content that is protected by the PIN.
If re-validation of a cached PIN fails, then free that cached PIN to ensure that it isn't used again for re-validation.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4924 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 18:33:17 +00:00
andre 3b270b8d27 pkcs15.c: use int instead of bool as type of configuration option pin_cache_counter
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4923 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 18:15:12 +00:00
andre 548630971e pkcs11-tool: replaced OPENSSL_NO_EDSA with OPENSSL_NO_ECDSA
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4922 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 16:28:26 +00:00
vtarasov d775407327 win32: when cleaning delete also manifest files
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4921 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 15:49:49 +00:00
vtarasov 04c5cb955b win32: control from Make.rules.mak the including of 'cardmod'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4920 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 15:47:03 +00:00
vtarasov e353c1bf2f win32: 'netkey' and 'westcos' tools are OpenSSL dependents
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4919 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 15:20:19 +00:00
martin b5f329ba7c tools: EC(DSA) requires OpenSSL >= 0.9.8.
This fixes building for OS X 10.5.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4918 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 14:41:15 +00:00
martin 4c2cbeec13 card-piv: remove unused variables.
card-piv.c: In function ‘piv_get_data’:
card-piv.c:879: warning: unused variable ‘filename’
card-piv.c:878: warning: unused variable ‘dataenvname’
card-piv.c:877: warning: unused variable ‘keyenvname’

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4917 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 14:18:42 +00:00
martin 98d2d6db39 PIV: amend [4908], Apple has /usr/include/malloc/malloc.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4916 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 14:18:35 +00:00
martin eb5871645b entersafe: don't list supported exponents in the dirver.
Native keys are generated with exponent 65537, imported keys can now have any (?) exponent.
Tested with openssl genrsa -3/-f4 keys.

Improves r4910 and closes #297

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4915 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 12:52:27 +00:00
martin a92f3a80d5 EstonianEid: limit authentication key usage bits.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4914 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 12:52:20 +00:00
martin 9fe86d16fe libopensc: protect for possible buffer overflows from rogue cards.
Reported by Rafael Dominguez Vega

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4913 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 12:52:14 +00:00
martin 37944007aa libopensc: move MIN/MAX macros from muscle.c to internal.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4912 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 12:52:07 +00:00
martin cd996245b9 EstonianEid: correctly free the used OpenSSL structures.
Thanks to Raul Metsma for the patch.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4911 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 12:51:59 +00:00
ludovic.rousseau 5a736c0ac6 entersafe_init(): add support of RSA exponent 35
Closes: Ticket #297


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4910 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 09:37:23 +00:00
vtarasov 31a33d0b1e win32: _PATH_MAX not defined when compiling with VS ...
use instead the standard FILENAME_MAX


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4909 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 08:31:59 +00:00
vtarasov 0bf12aa1f4 card-piv: avoid warning 'differs in levels of indirection from' ...
when compiling with VS


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4908 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 08:30:00 +00:00
dengert 3cfcb5cdc6 Minor corrections to r4906
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4907 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-03 15:44:29 +00:00
dengert b7f4537031 Test for OPENSSL_NO_EC as some systems build OPENSSL without EC.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4906 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-03 15:15:29 +00:00
martin 471e43c7cb simclist: build with mingw32, Visual Studio and gcc on Linux. By default dumprestore is OFF.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4905 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-02 08:59:26 +00:00
dengert c2fe4609a9 Modifications to support EC and ECDSA for
emulated cards. True PKCS#15 cards with EC 
will need additional changes. 

Main changes are in framework-pkcs15.c, mechanism.c,
padding.c, pkcs15-algo.c and pkcs15-sec.c 
where switch statements for key type, and testing
of flags was modified to make it easier to add 
additional key types in the future. 

The code was tested using RSA and ECDSA using a PIV card 
from pkcs11-tool, OpenSSL and Thunderbird with 
modifications to NSS-3.12.7 to get ECDSA to sign e-mail. 

Only named curves are supported for ECDSA, ECDH is still 
needed. pkcs11-tool has only minimal changes need to work 
with the -O option to list EC keys. 

One additional line was added to pkcs15-sec.c which 
should get GOSTR sign to work. 

libp11 and engine do not yet have EC support. 

 --This line, and those below, will be ignored--

M    src/tools/piv-tool.c
M    src/tools/pkcs11-tool.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-object.c
M    src/libopensc/pkcs15-prkey.c
M    src/libopensc/card-piv.c
M    src/libopensc/padding.c
M    src/libopensc/cardctl.h
M    src/libopensc/pkcs15-algo.c
M    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-sec.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4904 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-01 20:08:42 +00:00
dengert e2bd16ecd0 Additional EC routines _sc_card_add_ec_alg and sc_card_find_ec_alg
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4903 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 19:30:03 +00:00
dengert c34caeb662 Support for ECC keys (part 1) header files and
support routines. Add definitions for EC keys,
parameters and extensions to structures. 
Add the sc_card_find_ec_alg, sc_pkcs15_decode_pubkey_ec,
sc_pkcs15_encode_pubkey_ec, sc_pkcs15emu_add_ec_prkey,
sc_pkcs15emu_add_ec_pubkey routines. 
Only EC named curves are currently supported. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4902 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 19:13:48 +00:00
dengert 137a7282ad Allow emulation routine to setup an emulated object
to be used instead of trying to read a file.
This will be used  with the ECC code. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4901 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 15:57:01 +00:00
dengert e642436fc6 SPY does not process CKA_ALWAYS_AUTHENTICATE
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4900 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 15:32:58 +00:00
martin c16179f75a EstonianEid: Don't leak 1024bit key to 2048b card properties
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4899 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 12:33:24 +00:00
martin 185d46f3c9 simclist: Visual studio does not have unistd.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4898 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 12:33:04 +00:00
martin 424ef32dfc libopensc: fix building new simclist with mingw
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4897 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 11:22:38 +00:00
martin 7ab591a684 libopensc: make sc_reset() take an additional parameter "do_cold_reset" which will unpower the card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4896 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 11:22:31 +00:00
martin 5d9c02b197 ISO 7816: if decrypting with 2048 keys, non-extended APDU cards require command chaining (Lc would be 257, which is 2 bytes over 255 limit)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4895 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 14:22:15 +00:00
martin b33a44fdf0 pkcs11: clean up mechanism registration
* check for out of memory conditions
 * register SHA256 as well
 * key generation depends on onboard key generation capabilities, not OpenSSL

Further adjustments are needed.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4894 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 14:22:09 +00:00
martin 113dfda494 EstEID: add support for v 3.0 cards with 2048b keys
* Detect different cards based on ATR-s and on card objects
 * Set the card name from the ATR table
 * Conditionally add support for 2048b keys
 * Add workarounds for broken MULTOS and JavaCard cards.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4893 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 14:22:01 +00:00
martin 5c32c15b60 Revert a protocol forcing change from [4873] which was a mistake.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4892 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 13:56:27 +00:00
martin c1c3aa1d55 PC/SC: make (dis)connect actions configurable, SCardDisconnect, SCardEndTransaction and SCardReconnect
actions can now be configured via opensc.conf in better detail.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4891 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 13:56:19 +00:00
martin 77c8cfc37d pcsc: a change in ATR will not always mean a changed card, rely on PC/SC layer for card change information.
One of the few cards that has two different ATR-s is the EstonianEid card. The changing ATR (especially if
it has different protocol information and historical bytes) can cause confusion in many places, like
Microsoft BaseCSP or certain versions of pcsc-lite.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4890 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 13:35:06 +00:00
martin 6fc7e62f20 conf: correct comments about OpenSC.tokend score meaning and default value.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4889 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 13:34:54 +00:00
martin acb54b965f typo: remove double semicolon which prevents compilation with Visual Studio.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4888 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 08:51:25 +00:00
martin c4a9ab6732 WindowsInstaller: overwrite files with same version to allow nightly builds; replace and delete blocked files on a reboot.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4887 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 08:51:17 +00:00
andre 636b0c1d27 framework-pkcs15: Do not populate the unwrap capability, because the corresponding function C_UnwrapKey isn't implemented.
http://www.opensc-project.org/opensc/browser/trunk/src/pkcs11/pkcs11-object.c?rev=4885#L969

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4886 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 00:58:12 +00:00
andre fd11c909bd pkcs11-tool: Completing the output of "Mechanism Information Flags".
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4885 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-28 23:46:12 +00:00
andre 146041fcee pkcs11-tool: Correcting the behaviour in the case where C_SignUpdate fails. Quotation from PKCS#11:
"A call to C_SignUpdate which results in an error terminates the current signature operation."

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4884 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-28 22:16:50 +00:00
andre b63a601666 pkcs11-tool: Use attributes MODULUS and PUBLIC_EXPONENT instead of VALUE to retrieve RSA-Public-Key. The first two attributes are valid whereas the latter is not.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4883 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-28 18:09:30 +00:00
ludovic.rousseau cf92133cef Update from SimCList version 1.5
http://mij.oltrelinux.com/devel/simclist/


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4882 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-26 12:57:53 +00:00
andre 0eb404b2e6 pkcs11-display.c: more detailed less verbose output of CK_ATTRIBUTE lists
http://www.opensc-project.org/pipermail/opensc-devel/2010-November/015321.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4881 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-25 00:20:21 +00:00
dengert 09131a4e9f Fix support for CKU_ALWAYS_AUTHENTICATE and CKU_CONTEXT_SPECIFIC
spy segfaulted if CKU_CONTEXT_SPECIFIC was used,
pkcs11-session was reseting the userType before calling 
framework.  Framework will now see CKU_CONTEXT_SPECIFIC
and use slot->login_user to determine which PIN was used
to create the original session, and will send the PIN
to the card. It does not treats CKU_CONTEXT_SPECIFIC 
as a full login, only a reassertion of the PIN. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4880 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-24 20:28:30 +00:00