Commit Graph

3293 Commits

Author SHA1 Message Date
aj e31d2ff966 New westcos driver by François Leblanc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3718 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-11 09:48:51 +00:00
aj 886fa8931f trunk is now post release.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3716 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-29 07:03:59 +00:00
aj a495162259 Prepare for new release
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3714 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-29 07:02:37 +00:00
aj 5f185e3079 Weitao Sun: no one can create more than 15 files
under 5015 df. I increase it from 15 to 48, and all are OK.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3713 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-23 08:56:41 +00:00
aj 61b8f0a35d Latest version from scute svn with this change:
Stef Walter: Make all constants UL that should be.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3712 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-23 08:30:43 +00:00
aj 0c2fe83c3b Aktiv Co./Aleksey Samsonov:
fix a bug in rutoken driver.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3711 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-22 12:24:33 +00:00
aj 16f045bf0c Douglas E. Engert: major update for the PIV smartcard.
The major issue is with getting the length of an object or the cert
contained in an object. The PIV card does not have a directory on the card,
So the previous version tried to put off as long as possible the reading
of objects for performance so as to avoid having to read objects that would
not be used. The first standard, NIST 800-73, set maximum sizes for objects.
800-73-2 removed this for certificates.

A certificate object can contain a certificate which might be compressed.
The only way to get the length of the compressed certificate is to decompress
it. Thus the decompressed certificate could be larger then the container object,
so even if the PIV card had a directory, one would still need to decompress
the certificate to find its length.

OpenSC sc_read_binary will use the length obtained by using
sc_select_file(...,&file_out), and thus the lengths must be determined
in sc_select_file.

Change are to card-piv.c and pkcs15-piv.c and include:
  * The old cache code which was not working was removed.
  * New cache code was added which caches all object read from the card
  * If an object has a cert, the cert is decompressed and also cached.
  * As part of reading an object the first 8 bytes are read
    and this is then used to allocate a large buffer to read in the
    object.
  * If pkcs15 or pkcs11 asks about a certificate, the cert object
    will be read, and the cert decompressed, to get the actual length.
  * If piv_select_file is called with the file_out != NULL the object
    will be read to get the length If called with NULL it will not be read.
  * The enumeration of the objects now starts with 0.
  * sc_ctx_suppress_errors_on and off are used to avoid file not found
    messages which are are a by product of not having a directory.
  * "Unsigned Card Holder Unique Identifier" object in card-piv and pkcs15-piv.c
     had conflicting paths, as NIST 800-72-1 had two tables with different
     paths. The enumtag for it in card-piv.c was also wrong.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3710 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-22 10:09:21 +00:00
aj d9cd831b4f Douglas E. Engert: The pkcs15-gemsafeV1.c does not detect of the
card present is in fact a gemsafeV1 card, and thus it can end up
issuing commands to the wrong cards.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3709 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-22 10:06:32 +00:00
jps 8529b7ba3e Add support for JCOP31 v2.4.1 with the modified muscle applet[1].
This add support for 2048bit key and extended APDU.

[1] http://www.opensc-project.org/pipermail/opensc-user/2009-June/003147.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3708 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-02 13:59:38 +00:00
aj e8b1f540bd Kalev Lember: fix onepin-opensc-pkcs11.dll manifest embedding
with Microsoft compilers.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3707 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 10:08:17 +00:00
aj a3b0d6ae84 Aktiv Co. / Aleksey Samsonov:
use generic code instead of identical funciton
(now that the generic code was fixed).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3706 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:26:55 +00:00
aj a2032f5e83 Aktiv Co. / Aleksey Samsonov:
use generic set_security_env code, remove duplicate code.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3705 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:25:47 +00:00
aj 3cf4707b1a Aktiv Co. / Aleksey Samsonov:
Remove dead code.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3704 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:23:16 +00:00
aj 2a0b63e0ad Aktiv Co. / Aleksey Samsonov:
Add assert() calls to check constant buffer size.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3703 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:22:24 +00:00
aj 25ab286fed Aktiv Co. / Aleksey Samsonov:
Check buffer length (*outlen)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3702 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:20:37 +00:00
aj 7d282a9e0e Aktiv Co. / Aleksey Samsonov:
Fix for the case when "apdu.resplen < 2" and checked buffer length.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3701 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:19:38 +00:00
aj 265eb5923b Aktiv Co. / Aleksey Samsonov: fix case depending on length.
also no need to null resplen or le (done by sc_format_apdu).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3700 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:17:19 +00:00
aj be526c840f Move emv driver to the end.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3699 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-28 07:11:16 +00:00
ludovic.rousseau c44b7cbbeb iso7816_set_security_env(): correctly set P1 parameter in case of
SC_SEC_OPERATION_DECIPHER

Thanks to Aleksey Samsonov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-June/012263.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3698 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-25 08:45:05 +00:00
aj b3e9ce36a4 add a NEWS entry too.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3697 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-24 15:29:59 +00:00
aj 7931ded481 Add new rutoken_ecp driver by Aktiv Co. / Aleksey Samsonov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3696 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-24 15:26:37 +00:00
ludovic.rousseau 490d1b84aa print_file(): inverse "write" and "erase"
Thanks to Aleksey Samsonov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-June/012212.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3695 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-16 09:17:53 +00:00
ludovic.rousseau 8b4a1f673b cardos_sm4h(): fix memory leaks. Thanks to cppckeck(1)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3694 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-12 14:35:49 +00:00
ludovic.rousseau dab3723c95 sc_pkcs15emu_add_object(): fix a memory leak. thanks to cppcheck(1)
[pkcs15-gemsafeV1.c:419]: (error) Memory leak: obj


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3693 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-12 14:29:30 +00:00
ludovic.rousseau bb900ff9b8 do not cast calloc() return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3692 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-12 14:27:39 +00:00
aj 0db85da76a prep next release.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3689 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-07 13:09:03 +00:00
aj 3fa5747e33 Fix security issue.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3688 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-07 10:57:07 +00:00
ludovic.rousseau dd9a40ad0e avoid a compilation failure with --disable-openssl
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3687 c6295689-39f2-0310-b995-f0e70906c6a9
2009-05-06 16:25:50 +00:00
alonbl f0e03ec4f6 Fix --disable-man install from svn checkout, by Ludovic Rousseau
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3686 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-23 18:02:38 +00:00
alonbl 33a13139c5 Fix --disable-man install from svn checkout, by Ludovic Rousseau
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3685 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-23 18:00:42 +00:00
alonbl 23e247cafe Fix GNU libiconv detection
By Kalev Lember

The attached patch fixes GNU libiconv detection by adding an additional
libiconv symbol check to autoconf -liconv link test. Right now some
iconv implementations have only iconv* symbols (GNU libc), some have
only libiconv* (GNU libiconv), and some have both defined (Mac OS X's
iconv), so it's necessary to check for both variants.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3684 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-21 16:43:00 +00:00
martin 09a442adb4 Fix SCardDisconnect reset parameter.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3683 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-17 07:19:03 +00:00
martin 07fce14a6b Move sc_check_sw to opensc.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3682 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-15 07:52:04 +00:00
martin 86b4d65c4c Export sc_check_sw, required by external drivers and utilities.
Thanks to Marc Rios Vallès.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3681 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-15 06:18:49 +00:00
aj b2f8effbf5 Update news file too.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3680 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-14 15:21:53 +00:00
martin 6041595895 * Correctly set offsets for PINs for PIN modification operations with pinpads. Thanks to Robert Konklewski.
* Only set messages if the reader has display capabilities.
 * Detect rejected pinpad commands
 * Whitespace fixes


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3679 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-08 10:31:18 +00:00
martin 16baddcc74 Engine API is not used.
Thanks to Robert Konklewski for noticing this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3678 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-08 09:40:21 +00:00
alonbl bfc69348f7 Actually print SCardControl result, thanks to martin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3677 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-03 19:54:42 +00:00
alonbl ef4b1e1410 reader-pcsc - minor cleanups in reader features
1. Indent fix.
2. Reorder conditions.
3. Do not print error if SCardControl fails.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3676 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-03 19:17:15 +00:00
aj 0f050d9cec Document latest change.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3675 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-02 10:33:16 +00:00
aj 4670238556 Entersafe changes by Weitao Sun:
1.Card type FTCOS/PK-01C added. (new)
2.Limit pin length in range [4,16). (bug fix)
3.Can not unblock PIN. (bug fix)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3674 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-02 10:32:02 +00:00
ludovic.rousseau 117d790aea Do not use msc_crypt_process (OP_PROCESS). This operation is used to do
multipart encryption when, for example, the data is too big to fit in
one APDU. It basically calls the Cipher.update() method until all data
has been processed. However, the Java Card API documentation advises
against using update():

"This method requires temporary storage of intermediate results. In
addition, if the input data length is not block aligned (multiple of
block size) then additional internal storage may be allocated at this
time to store a partial input data block. This may result in additional
resource consumption and/or slow performance.  This method should only
be used if all the input data required for the cipher is not available
in one byte array. If all the input data required for the cipher is
located in a single byte array, use of the doFinal() method to process
all of the input data is recommended."

As the card's JVM was returning an internal exception when using
OP_PROCESS, it was decided to implement an msc_crypt_final_object()
function in OpenSC that uses the msc_object_*() functions to read/write
all the data from the card. This way, it is possible to transmit/receive
"arbitrarily" large data chunks to/from the card and use doFinal(). This
is the fallback method when, for example, using 2048 bit keys and the
card doesn't support extended APDUs.

Thanks to Joao Poupino for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011978.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3673 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-25 14:31:21 +00:00
ludovic.rousseau 7f0476ab2a pcsc_internal_transmit(): do not limit the size of the reception buffer
to 258. This check is no more needed now that pcsc-lite can handle
extended APDU.

Thanks to Joao Poupino for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011978.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3672 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-25 14:22:34 +00:00
ludovic.rousseau 04a5c99f77 Detect the eToken 72K and activate RSA 2048 and extended APDU for it.
Thanks to Joao Poupino for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011978.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3671 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-25 13:55:25 +00:00
ludovic.rousseau e0f3545157 Change MSC_MAX_APDU to make some buffers larger to support extended
APDUs. The change was only from 256 to 512 bytes since it is more than
enough for 2048 bit keys;

Thanks to Joao Poupino for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011978.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3670 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-25 13:50:41 +00:00
ludovic.rousseau 7b07db6b59 msc_get_challenge(): return SC_SUCCESS instead of dataLength in case of
success

Thanks to Joao Poupino for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011978.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3669 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-25 13:47:46 +00:00
ludovic.rousseau 89b2ac778f msc_get_challenge(): use 0x62 instead of 0x72 for GET CHALLENGE as it is
the value used by the Muscle applet (INS_GET_CHALLENGE)

Thanks to João Poupino for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011978.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3668 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-25 13:42:13 +00:00
martin 9862d431e8 Fix typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3667 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-21 11:17:14 +00:00
martin 9668f0aa33 Add support for LCD detection on pinpad devices.
* Update IOCTL definitions to PC/SC part 10 v2.02.05 
 * Return SC_SUCCESS instead of 0 if returning SC_ codes.
 * Detect the presence of a display with FEATURE_IFD_PIN_PROPERTIES

Tested with patched CCID driver on OS X, with SPR532 (no display) and OK3821 (with display)

Known CCID reader with a display:

ATMEL_AT91SO.txt:  wLcdLayout: 0x0210
CardMan3821.txt:  wLcdLayout: 0x0210
Kobil_EMV_CAP.txt:  wLcdLayout: 0x0210
Xiring_XI-SIGN.txt:  wLcdLayout: 0x020C
Xiring_XI-SIGN_6000.txt:  wLcdLayout: 0x020C




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3666 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-21 11:09:12 +00:00
martin 3b0faecbb1 * Display the default CCID message for PIN verification if the reader has a display
* Part 10 -> PC/SC v2


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3665 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-19 17:54:45 +00:00