Commit Graph

3996 Commits

Author SHA1 Message Date
martin 27ed902ce0 Add a FIXME for keys>2048b
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4667 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 11:46:37 +00:00
martin b04a1ef9f0 EstEID: small fixes for working with a modified max_send/recv_size
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4666 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 11:46:31 +00:00
martin befff1b0d4 libopensc: PIN usage counter is decreased every time it is sent to the card, no matter what the card replies (should probably reply with success)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4665 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 06:23:43 +00:00
martin 5e3f7b10d0 Whitespace fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4664 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 06:23:37 +00:00
martin 15b6f29013 Whitespace fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4663 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 06:23:32 +00:00
martin 8c9666d631 pkcs11: C_SeedRandom is not implemented by OpenSC nor most smart cards, nor does it fit well into PKCS#15 concept.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4662 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 06:23:26 +00:00
martin 12a1e9d49b pkcs15: don't override TokenInfo PRNG flag. pkcs11: announce CKF_RNG if the card driver supports it, bypassing PKCS#15.
GET CHALLENGE and RNG don't match 1:1 anyway.

Thanks to Andre Zepezauer for noticing this.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4661 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 06:23:17 +00:00
martin fc4dff1d12 Debian #451155: Document pkcs15-init --update-certificate/-U in man page.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4660 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-31 01:24:53 +00:00
martin 8d3a1bcd1f libopensc: remove the "etoken" alias for "cardos" cards.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4659 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-31 01:24:53 +00:00
viktor.tarasov 0285264af5 #73: pkcs15-tool: when changing PIN, print message if no PIN value supplied
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4658 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-30 16:37:15 +00:00
martin 1bd7e5d2f5 MacInstaller: Add .bundle generation capability from SCA. Thanks to Jean-Pierre Szikora for the reminder.
Adobe Acrobat is one program that requires the .bundle format.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4657 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-27 09:39:24 +00:00
martin b4f9ac456a pkcs15-init: fix leftover from [4646]
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4656 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-27 09:28:42 +00:00
martin a7191a9540 Revert CardOS change from Italian CNS patch [4627].
Limiting Le for CNS should be done in pkcs15-itacns.c

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4655 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-27 08:24:39 +00:00
s ed589feda7 add ATR for Rutoken ECP (DS)
Thanks to Aktiv Co. Kirill Mescheryakov for the patch.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4654 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 19:24:23 +00:00
martin c5d18635ef build: add installer files and a small script to build a win32 installer from build project binaries.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4653 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 12:57:47 +00:00
martin cd01ad0936 pkcs15init: On Windows, get the profile directory from registry instead of configuration file.
This allows the installation directory for non-dll files to be anywhere on the system.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4652 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 12:51:55 +00:00
martin 543f2faf2b Update NEWS for 0.12.0
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4651 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 09:09:28 +00:00
martin 4cbe69413b Add build script for Mac OS X. Uses github copies of SVN for source.
Includes:
Add static engine_pkcs11.so to the 10.6 installer (#246)
Patch from Mart Randala: add a nice background image and readme file and license file.
Patch from João Poupas: fix a typo and also work with docbook-xsl from macports.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4650 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 08:44:32 +00:00
martin 5f518a96be Update OpenSC.tokend related default config file entries.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4649 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 08:40:54 +00:00
martin a3d02dd63c CT-API, PC/SC: truncating atr_len makes no sense.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4648 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 08:32:42 +00:00
martin 4f03502b60 pkcs11: check PKCS#11 function parameters for obvious errors and return CKR_ARGUMENTS_BAD early without locking the module.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4647 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 14:47:14 +00:00
martin 9a63e03e9a pkcs11/pkcs15-init: remove automagic software key generation. Remove software based secret key handling from PKCS#11.
Support for importing cleartext keys is left untouched, but all transparent key generation by either opensc-pkcs11.so or pkcs15-init is removed, to make the operation with cleartext keys visible to the user and his explicit wish.
OpenSC is a PKCS#11 library for accessing keys protected by a smart card. Key material in software is not protected by smart cards and can leave a false sense of security to the user.

http://www.opensc-project.org/pipermail/opensc-devel/2010-April/013877.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4646 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 14:47:07 +00:00
martin 1f73d32e40 libopensc: Remove unused internal SC_ERROR_EXTRACTABLE_KEY and correct relevant comments (native != extractable)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4645 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 10:32:26 +00:00
martin 98255b109a libopensc: Fix SC_ERROR defines and messages: remove unused error defines, fix the internal value of some PKCS#15 related errors.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4644 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 10:32:21 +00:00
martin 2b1a8b5828 build: don't check for unused functions and headers.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4643 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 10:32:17 +00:00
martin c235f93cff EstEID: sc_format_path sets SC_PATH_TYPE_PATH by default
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4642 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 09:34:30 +00:00
ep 6474853217 Support reading record files by SFI
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4641 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-21 20:12:59 +00:00
ep cba47b33bf Only free current_file if it is set
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4640 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-21 20:12:56 +00:00
ep 5990d26f80 If a FCI features tag 84h, then the file is a DF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4639 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-21 20:12:53 +00:00
ep fd396a0546 Refactored the "select the file referenced by current_path; die on error" idiom in opensc-explorer.
This version, additionally, skips this step entirely if there is no current_path; this is useful when starting with --mf "".

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4638 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-20 22:51:42 +00:00
ep 4e726bd09b Fix and document opensc-explorer's new -m, --mf option
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4637 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-20 22:51:39 +00:00
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

malloc returns a void pointer (void *), which indicates that it is a
pointer to a region of unknown data type. One may "cast" (see type
conversion) this pointer to a specific type, as in

int *ptr = (int*)malloc(10 * sizeof (int));

When using C, this is considered bad practice; it is redundant under the
C standard. Moreover, putting in a cast may mask failure to include the
header stdlib.h, in which the prototype for malloc is found. In the
absence of a prototype for malloc, the C compiler will assume that
malloc returns an int, and will issue a warning in a context such as the
above, provided the error is not masked by a cast. On certain
architectures and data models (such as LP64 on 64 bit systems, where
long and pointers are 64 bit and int is 32 bit), this error can actually
result in undefined behavior, as the implicitly declared malloc returns
a 32 bit value whereas the actually defined function returns a 64 bit
value. Depending on calling conventions and memory layout, this may
result in stack smashing.

The returned pointer need not be explicitly cast to a more specific
pointer type, since ANSI C defines an implicit conversion between the
void pointer type and other pointers to objects. An explicit cast of
malloc's return value is sometimes performed because malloc originally
returned a char *, but this cast is unnecessary in standard C
code.[4][5] Omitting the cast, however, creates an incompatibility with
C++, which does require it.

The lack of a specific pointer type returned from malloc is type-unsafe
behaviour: malloc allocates based on byte count but not on type. This
distinguishes it from the C++ new operator that returns a pointer whose
type relies on the operand. (see C Type Safety). "

See also
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014586.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +00:00
ep d37dd91b63 Use strlcpy(3), strlcat(3) in pkcs15-itacns.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4635 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 13:42:30 +00:00
ep b279287701 strlcat(3) implementation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4634 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 13:42:26 +00:00
ep 96df880730 Prevent card-incrypto34.c from catching the Italian CNS card's ATR
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4633 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 13:42:21 +00:00
ep acd062e0dd Avert potential buffer overflows in pkcs15-itacns.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4632 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 13:42:16 +00:00
ludovic.rousseau 31d1a552d3 Use (SCARD_READERSTATE *) instead of LPSCARD_READERSTATE since
LPSCARD_READERSTATE is not define in old pcsc-lite (< 1.6.3) nor Mac OS X


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4631 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 09:33:56 +00:00
martin b1ff1abb1b Fix and change ignored readers feature introducsed in r4626 for Windows. strcasestr is GNU specific extension.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4630 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 08:59:14 +00:00
martin bb8b2d5f4b itacns: add itacns.h to distribution targzip, fix card driver ordering.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4629 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 08:59:09 +00:00
martin 484d484c21 PC/SC: Fix building on OS X and mingw32 after r4626
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4628 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 08:59:05 +00:00
ep 71cdef0ed2 New card driver: Italian CNS/CIE (eID)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4627 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 00:56:27 +00:00
ludovic.rousseau 947c3291db Use SCARD_READERSTATE instead of SCARD_READERSTATE_A
SCARD_READERSTATE_A is not used by Microsoft API and is no more
defined/used by pcsc-lite >= 1.6.2

Thanks to Josef Windorfer for the bug report
http://www.opensc-project.org/pipermail/opensc-user/2010-August/004235.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4626 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-15 14:57:34 +00:00
martin fde87a8c6e pkcs11: remove outdated config entry parsing.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4625 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-15 09:34:13 +00:00
martin a938d3b67f Implement simple reader ignoring, to exclude readers from OpenSC PKCS#11 module.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4624 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-15 09:33:18 +00:00
martin 409284ed60 opensc-tool: Fix ACL reporting for EF-s. Patch by Emanuele Pucciarelli.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4623 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-14 12:18:27 +00:00
martin 9f639f48c4 Add back MAX_ATR_SIZE which was erroneously removed in r4611. Fixes mingw32 build.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4622 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-13 09:27:38 +00:00
ludovic.rousseau 7ac66ae4cf Correctly use pin2 when needed.
Patch from OpenSUSE.

Closes ticket #249.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4621 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-12 21:49:14 +00:00
ludovic.rousseau c7a99c2e03 Use || instead of | in a #if check
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4619 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-30 07:09:15 +00:00
martin a8c438fde1 configure: Add possible docbook paths on OS X (Fink, MacPorts)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4612 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-27 08:05:31 +00:00
martin 5c2c12bb78 Trac #244: Fix structure packing on Apple and SUN. Fix display detection by updating structure definitions.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4611 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-26 13:16:37 +00:00