Commit Graph

1497 Commits

Author SHA1 Message Date
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 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 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 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
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
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
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 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
martin 464a4f6d74 Fix Global Platform PINs with CCID pinpads.
Thanks to François Leblanc for the report:
http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011947.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3664 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-18 10:18:18 +00:00
alonbl cd6adb4e26 Fix Windows PINPAD mingw issue
Thanks to François Leblanc

http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011932.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3662 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-07 21:55:40 +00:00
martin 830ba34b67 Fix native windows build, add iconv support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3643 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-29 11:47:45 +00:00
alonbl 93998e9561 Optionally load SCardControl132 on apple
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3642 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-28 12:43:30 +00:00
martin aadf4ad037 Fix pinpads on OS X
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3641 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-28 12:28:41 +00:00
alonbl 34a75de5d7 Rutoken updates
By Aktiv Co. Aleksey Samsonov

- use PKCS#15 (not builtin PKCS#15 emulator)
- rutoken.profile (add privdata)
- correct using ACL
- correct erase procedure



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3640 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-28 12:10:13 +00:00
alonbl e1d49190c1 Typo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3638 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-23 09:27:30 +00:00
alonbl 98841d1e61 Finally remove eval stuff from autoconf
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3636 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-23 09:00:11 +00:00
alonbl a5f32a99db Move all private factories into private headers, the iso7816 factory is the only one which is actually exposed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3634 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-21 13:19:18 +00:00
alonbl 74f6d41dc6 Add sc_get_iso7816_driver as it is required for external drivers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3633 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-21 13:01:37 +00:00
alonbl 304f227d79 Add SCARD_E_NO_SERVICE to internal-winscard.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3632 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-20 08:45:12 +00:00
alonbl fbd51c705e Revert 3630
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3631 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-20 08:42:47 +00:00
alonbl ce5c5f3ae9 Add SCARD_E_NO_SERVICE to internal-winscard.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3630 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-19 19:43:19 +00:00
martin 4d5c61d90c Correct PC/SC -> OpenSC error code translation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3626 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-19 11:57:20 +00:00
martin 5a7515cd7f Recognize SCARD_E_NO_SERIVCE:
{{{
$ /Library/OpenSC/bin/opensc-tool -a
[opensc-tool] reader-pcsc.c:881:pcsc_detect_readers: SCardEstablishContext failed: 0x8010001d
[opensc-tool] reader-pcsc.c:990:pcsc_detect_readers: returning with: Unknown error
No smart card readers found.
}}}


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3625 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-18 23:16:53 +00:00
alonbl c9c6f9f2b2 Correct iconv support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3621 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-16 17:48:26 +00:00
martin c6f753dc00 Limit virtual OpenCT readers to a sane default of 2 readers/tokens by default.
Most users don't use more than one or two tokens concurrently. This way default configuration (or with no configuration file) works even after you insert a PC/SC reader as OpenCT does not "eat up" all PKCS#11 slots with 5 virtual readers.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3618 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-16 16:12:50 +00:00
martin 6ffec42055 Linux compatible PKCS#11-friendly changes to EstEID PKCS#15 emulation driver to display the name of the cardholder in token label field.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3616 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 23:20:48 +00:00
martin 315c0edc6e PC/SC readers have always only one slot per reader.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3615 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 21:40:44 +00:00
martin 2e2a998f10 Remove some unused/prehistoric defines.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3614 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 21:23:09 +00:00
martin 7e7b94d879 Fix PKCS#15 emulation handling:
* Work as expected without a configuration file
  * "Normalize" the configuration file: show the used default and give examples with opposite values.
 * DWIM:    
  * If there is no config file: try all builtin drivers
  * If there is a configuration file, allow to turn emulation off
  * If there is a configuration file, allow to filter the list of internal drivers                   
 * Introduce a PKCS#15 layer card flag for emulated cards



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3613 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 21:08:30 +00:00
martin c64fd881e9 Mac OS X 10.5.6 fixes the ATR padding bug.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3610 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-15 20:01:09 +00:00
alonbl 8828faeccf Allow delete data objects by specifying application-name and label
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3608 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-28 21:28:53 +00:00
ludovic.rousseau 6e56f8384a #include <wintypes.h> on __APPLE__ to define DWORD, LONG, etc. Windows types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3603 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-11 09:18:09 +00:00
alonbl 5617c9d535 Fix bug #86, thanks to ville.skytta
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3601 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-06 18:49:58 +00:00
martin 1e41d4d267 * Fix issues with pkcs11-tool testing of C_GenerateRandom/C_SeedRandom and OpenSC PKCS#11 implementation of those functions.
Thanks goes to Rickard Bondesson who noticed the issues.

http://www.opensc-project.org/pipermail/opensc-devel/2008-November/011436.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3595 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 22:06:27 +00:00
martin 36112bf6e0 typos
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3594 c6295689-39f2-0310-b995-f0e70906c6a9
2008-11-24 21:55:28 +00:00
alonbl d7941bf850 Re-add pcsc-lite compile-time dependency
Win64 changed the SCARDCONTEXT from LONG to ULONG_PTR,
pcsc-lite did not follow this on 64bit platforms.
This breaks the pcsc module.

To solve this we use installed winscard.h in order to get proper
declerations.

As mingw32 does not have winscard.h we keep current types. mingw64 and
pcsc-lite system have winscard.h.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3590 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-27 19:16:28 +00:00
alonbl 4ad85b3d91 Add some more debug information to pcsc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3589 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-26 19:13:14 +00:00
alonbl d771870d5c Resolve some conflict with win64
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3588 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-26 14:48:47 +00:00
ludovic.rousseau d2f428590b use 0x%08lx instead of 0x08%lx
Thanks to Alon Bar-Lev for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3587 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 15:04:29 +00:00
ludovic.rousseau 4a1e1192a6 display PC/SC error codes as 0x08%lx instead of %lx to make it explicit
they are hex values


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3586 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 07:46:24 +00:00
ludovic.rousseau b4c5c8d539 use SCARD_S_SUCCESS instead of 0
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3585 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 07:27:41 +00:00
alonbl ff4d6dd101 Fix for two apparent C code bugs
By Stanislav Brabec

entersafe_init_pin_info() was declared as int, but defined and used as
void, resulting in a function returning an unused pseudo-random value.

card-gemsafeV1.c uses comparison 'type == "DF"', which is always false,
as it compares pointer to a string with pointer to the string "DF" in
the code.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3563 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-10 12:44:40 +00:00
aj 9468d989cf Douglas E. Engert:
The pkcs15-gemsafeV1.c code assumes that the key_ref is always 3. But that is
not always the case. In our case it is 4. The patch tries to determine the
key_ref by looking at what appears to be a table of allocated keys, and picking
the first allocated key. 

In case this is not always true, the patch will also allow for the the
opensc.conf card flag = n to specify the key_ref as the low order 4 bits of the
flag.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3557 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-20 15:17:59 +00:00
aj 27d00f9265 Add new entersafe driver for ePass 3000 tokens.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3556 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-20 05:41:20 +00:00
aj 07247596d6 Apply security fix.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3552 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 13:25:16 +00:00
aj e243e7f322 make the sign_with_decrypt hack configureable.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3546 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 12:17:29 +00:00
aj 29d78fde39 move checks to pkcs15_bind, where we can look at the config.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3545 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 12:13:15 +00:00
cg2v 973bf9a791 export a GET DATA operation for cardos so opensc-explorer's do_get works
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3540 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-27 15:50:01 +00:00
alonbl 4fc6c498ed Make PC/SC work on Windows again
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3535 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-02 09:55:32 +00:00
alonbl 7534621a89 Revert pic changeset
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3533 c6295689-39f2-0310-b995-f0e70906c6a9
2008-06-09 08:32:42 +00:00
alonbl c18dbe5669 More aclocal->m4
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3532 c6295689-39f2-0310-b995-f0e70906c6a9
2008-06-09 08:31:38 +00:00
ludovic.rousseau 96064e195c add missing prototype for sc_pkcs15emu_rutoken_init_ex()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3523 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:30:37 +00:00
ludovic.rousseau bdaf49b0c8 add missing prototype for sc_pkcs15emu_tcos_init_ex()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3522 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:30:16 +00:00
ludovic.rousseau 82314eaa56 do not use system as a variable name. system() is also a function
card-akis.c:400: warning: declaration of 'system' shadows a global declaration
/usr/include/stdlib.h:730: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3521 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:26:08 +00:00
ludovic.rousseau 99a16c66db remove two unused variables
reader-pcsc.c:739: warning: unused variable 'rv'
reader-pcsc.c:862: warning: unused variable 'again'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3520 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:23:25 +00:00
ludovic.rousseau ca2da1bd67 Avoid variable name space collision
reader-pcsc.c:396: warning: declaration of 'priv' shadows a previous local
reader-pcsc.c:367: warning: shadowed declaration is here
reader-pcsc.c:909: warning: declaration of 'reader' shadows a previous local
reader-pcsc.c:901: warning: shadowed declaration is here 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3519 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:22:23 +00:00
alonbl e14cf57ad1 Better handle openct reader replug, revert last change in pkcs11-pin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3512 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-10 09:55:01 +00:00
alonbl a40cf036bb Fix sc_pkcs15_verify_pin() to handle OpenCT hotplug correctly
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3511 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-09 22:22:41 +00:00
ludovic.rousseau 91177e51ec Use size_t instead of int when needed, plus some other minor changes
Patch bug.1 included in Ticket #176


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3510 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-05 13:00:01 +00:00
alonbl 96b0f4a670 Verify PIN support Plug&Play
If card was reset or reader reconnected, verify can restart
transaction, as upper level will not cache PIN in this case.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3508 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-02 17:56:52 +00:00
alonbl e237574742 Plug&Play support
This is not the best solution, but focus on smallest code change.

Changes:

1. Add detect_readers() to reader opts, this adds new readers to the end
   of the readers list until list is full.

2. Add sc_ctx_detect_readers() that calls readers' detect_readers().

3. Fixup pcsc_lock() so that it reconnect to the card and report proper
   error so caller may be notified if session was lost.

4. Allow context to be created without readers.

5. Call sc_ctx_detect_readers() from PKCS#11 C_GetSlotList with NULL_PTR.

6. Allow no reader at detect_card, as reader my be removed.

7. Since I broke ABI, I updated the external module version requirement
   to match OpenSC version. In the future a separate version should be
   maintained for each interface, this should be unrelated to the package
   version.

Alon

---

svn merge -r 3480:3505 https://www.opensc-project.org/svn/opensc/branches/alonbl/pnp

M    src/tools/opensc-tool.c
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/slot.c
M    src/libopensc/reader-pcsc.c
M    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
M    src/libopensc/reader-ctapi.c
M    src/libopensc/libopensc.exports
M    src/libopensc/reader-openct.c
M    src/libopensc/opensc.h


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3506 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 17:01:19 +00:00
alonbl c862f88ce7 SIGSEGV print_tags_recursive - fix
Patch opensc-0.11.4.trunk-r3502-fix-segv_print_tags_asn1.diff (for trunk
trunk revision 3502) is draft.


Example 1 (SIGSEGV):

OpenSC Explorer version 0.11.4-svn
OpenSC [3F00]> cd ff00
OpenSC [3F00/FF00]> asn1 0001
Printing tags for buffer of length 512
[Switching to Thread -1211906368 (LWP 25131)]

By Aktiv Co. Aleksey Samsonov



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3504 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 06:11:34 +00:00
alonbl 6c740b907e More MSVC fixups by Douglas E. Engert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3503 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 06:09:00 +00:00
ludovic.rousseau e928d5565c convert C++ in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3502 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:57:03 +00:00
ludovic.rousseau c1311c8c6a card.c:756: warning: unused variable 'j'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3496 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:24:57 +00:00
ludovic.rousseau ab99cc50bd convert C++ comment in C comment (ISO C90)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3495 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:23:03 +00:00
alonbl 104ff0ed66 rutoken: Some MSVC fixups, by Aktiv Co. Aleksey Samsonov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3490 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-24 16:34:08 +00:00
alonbl 8d7bce4de2 ruToken fixups
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011057.html

By Aktiv Co. Aleksey Samsonov



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3478 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-18 14:08:23 +00:00
alonbl 5d218007c3 Fix last reference to VERSION and not PACKAGE_VERSION
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3475 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-16 04:32:56 +00:00
alonbl 865f6e9c70 More fixups to maintainer-clean
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3471 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-11 12:52:46 +00:00
alonbl d84077749b Distribute autoconf generated files for MSVC build
Construct resource files and winconfig.h using autoconf
substitutions.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3468 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-08 18:36:42 +00:00
alonbl 54c1c735f3 Attached are the latest mode to OpenSC svn 3462 to use the Makefile.mak
files to build on Windows.

I got rutoken to compile, and took out the #ifdef's I had in last week.
The rutoken programmer declared some variables in the middle of a block
rather then having all the declare statements at the beginning of a block
as is normally done in C. The Microsoft compile treats this as an error.
(Actual many errors.)

The makedef.pl is no longer needed, as the exports files can be used.
Note that in the original Makefile.mak files only opensc.def and
pkcs15init.def were created.

winconfig.h has a number of changes. As discussed last week this could
be created by autoconf. I also noted that the Active State Perl that
was required for the makedef.pl has a psed command that could be used
like sed to update winconfig.h.  I did not attempt to do this.



  win32/Make.rules.mak - Use ENABLE_OPENSSL and ENABLE_ZLIB

  src/tools/Makefile.mak - add the rutoken.tool.exe

  src/tools/eidenv.c - use PACKAGE_VERSION

  src/pkcs11/Makefile.mak - reorder the objest to match the list in the
           Makefile.am. Makes it easier to read.

  src/include/winconfig.h - The windows version of the config.h
           Changes based on discussions on the list last week.

  src/common/Makefile.mak - renamed modules.

  src/pkcs15init/Makefile.mak - reordered, and added back the rutoken modules
           replaced the use of makdef.pl to sue the exports file.

  src/scconf/Makefile.mak - reordered objects.

  src/libopensc/card-rutoken.c -
           error. Moved the declares to the beginning of blocks.

  src/libopensc/Makefile.mak - reorder names, and add rutoken.
           Use the libopensc.exports file.

  src/libopensc/pkcs15-prkey-rutoken.c - more moving of declare statements.

By Douglas E. Engert

http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011011.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3464 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 19:42:43 +00:00
alonbl 66d819a3a6 ruToken C fixups
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011011.html

By Douglas E. Engert



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3463 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 19:25:21 +00:00
alonbl 6e65efb257 Some more build cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3462 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 20:38:20 +00:00
alonbl 6f22611438 Fix some duplicate symbols with Windows header files.
Thanks to Douglas E. Engert.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3460 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 16:46:50 +00:00
alonbl ac0c291f9c Fixup WINAPI location
By: Douglas E. Engert

 (2) Change the typdefs for the SC_*_t routines.
  The WINAPI had to be moved. For example from:
    typedef PCSC_API LONG (*SCardEstablishContext_t)...
  to:
    typedef LONG (PCSC_API *SCardEstablishContext_t)...



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3458 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 06:05:38 +00:00
alonbl 317ad765c5 Solve some Windows conflicts
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3457 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 05:39:34 +00:00
alonbl 0e2c664d34 Rename PC/SC library into PC/SC provider.
Sync symbols between configuration and source.
Put default provider in opensc.conf, opensc-tool.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3455 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-02 05:44:12 +00:00
alonbl 87db3c96c2 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3450 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 19:04:33 +00:00
alonbl 39abe22798 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3449 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 17:08:17 +00:00
ludovic.rousseau 7e30721378 use $(srcdir) when needed to be able to build in separate build
directories using: cd foobar ; ../configure srcdir=..

Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010959.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3445 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 12:43:26 +00:00
ludovic.rousseau 9ffe2e159d use "pkcs15.h" instead of <opensc/pkcs15.h> (and similar)
Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010959.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3444 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 12:35:08 +00:00
alonbl 80a16f686d ruToken cleanups
Move constants out of standard files.
Create ruToken specific interface.
Update symbols.

Thread at:
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010917.html

Cleanup of:
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3439 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-26 06:24:37 +00:00
alonbl a88a543940 Fixup compile under cygwin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3431 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-19 20:30:36 +00:00
ludovic.rousseau 8436f089c5 pkcs15-gemsafeV1.c:478: warning: 'sc_pkcs15emu_add_pubkey' defined but
not used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3430 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-17 15:17:56 +00:00
ludovic.rousseau 4f53d06c17 change type from int to unsigned int to avoid 2 compiler warnings:
pkcs15-gemsafeV1.c:150: warning: comparison between signed and unsigned
pkcs15-gemsafeV1.c:331: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3429 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-17 15:09:16 +00:00
ludovic.rousseau 2800607c4a rename index -> index_local to avoid a compiler warning
pkcs15-gemsafeV1.c:126: warning: declaration of 'index' shadows a global declaration
/usr/include/string.h:304: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3428 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-17 15:09:16 +00:00
ludovic.rousseau 875d99e46a use sc_debug/sc_error instead of fprintf(stderr, ...)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3427 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-17 15:09:16 +00:00
ludovic.rousseau a05564447a add ATR for the GemSafeXpresso 16k R3.2
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3426 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-17 15:03:51 +00:00
alonbl f49f765ac6 Fix libtool versioning issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3421 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-15 11:05:26 +00:00
alonbl 8ac87f1b1e Remove useless comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3414 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-09 21:24:24 +00:00
alonbl 440ea331db Windows DLL suffix is actually delta
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3410 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-09 12:01:22 +00:00
alonbl 0a809dd5cb Complete rewrite of OpenSC build system.
1.  Build system now supports MinGW (Windows) compilation using msys and cross compilation.
2.  Ability to explicitly disable and enable dependencies of the package.
3.  openct, pcsc and nsplugins features are disabled by default.
4.  Modified pcsc driver to use pcsc dynamically, no compile time dependency is required.
5.  --enable-pcsc-lite configuration option renamed to --enable-pcsc.
6.  Install opensc.conf file (as opensc.conf.new if opensc.conf exists).
7.  Add--enable-doc configuration option, allow installing documentation into target.
8.  Add --disable-man configuration option, allow msys mingw32 users to
    build from svn without extra dependencies.
9.  Add export files to each library in order to export only required symbols.
    Windows native build may use these files instead of scanning objects' symbols.
10. Add opensc-tool --info to display some general information about the build.
11. Create compatibility library to be linked against library instread of recompiling the
    same source files in different places.
12. Add different win32 version resource to each class of outputs.
13. Make xsl-stylesheets location selectable.
14. Some win32 fixups.
15. Some warning fixups.
16. Many other autoconf/automake cleanups.

Alon Bar-Lev

svn diff -r 3315:3399 https://www.opensc-project.org/svn/opensc/branches/alonbl/mingw

_M   .
D    configure.in
_M   src
_M   src/openssh
M    src/openssh/Makefile.am
_M   src/tools
M    src/tools/rutoken-tool.c
M    src/tools/opensc-tool.c
M    src/tools/cardos-info.c
M    src/tools/pkcs15-crypt.c
M    src/tools/pkcs15-init.c
M    src/tools/piv-tool.c
M    src/tools/netkey-tool.c
M    src/tools/eidenv.c
M    src/tools/cryptoflex-tool.c
M    src/tools/util.c
M    src/tools/pkcs11-tool.c
M    src/tools/pkcs15-tool.c
M    src/tools/util.h
M    src/tools/opensc-explorer.c
M    src/tools/Makefile.am
_M   src/pkcs11
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-display.c
M    src/pkcs11/pkcs11-object.c
A    src/pkcs11/opensc-pkcs11.exports
M    src/pkcs11/sc-pkcs11.h
M    src/pkcs11/pkcs11-spy.c
M    src/pkcs11/openssl.c
M    src/pkcs11/Makefile.am
A    src/pkcs11/pkcs11-spy.exports
_M   src/tests
_M   src/tests/regression
M    src/tests/regression/Makefile.am
M    src/tests/sc-test.c
M    src/tests/pintest.c
M    src/tests/Makefile.am
_M   src/include
_M   src/include/opensc
M    src/include/opensc/Makefile.am
A    src/include/opensc/svnignore
M    src/include/Makefile.am
_M   src/signer
_M   src/signer/npinclude
M    src/signer/npinclude/Makefile.am
M    src/signer/Makefile.am
A    src/signer/signer.exports
_M   src/common
A    src/common/compat_dummy.c
D    src/common/getopt.txt
D    src/common/strlcpy.c
D    src/common/LICENSE
A    src/common/compat_getopt.txt
A    src/common/compat_strlcpy.c
A    src/common/LICENSE.compat_getopt
A    src/common/compat_getopt.c
D    src/common/strlcpy.h
D    src/common/ChangeLog
D    src/common/getpass.c
D    src/common/my_getopt.c
A    src/common/compat_strlcpy.h
A    src/common/compat_getpass.c
A    src/common/compat_getopt.h
A    src/common/ChangeLog.compat_getopt
D    src/common/README.strlcpy
D    src/common/my_getopt.h
A    src/common/compat_getpass.h
A    src/common/README.compat_strlcpy
D    src/common/strlcpy.3
A    src/common/README.compat_getopt
D    src/common/getopt.3
D    src/common/README.my_getopt
A    src/common/compat_strlcpy.3
A    src/common/compat_getopt.3
M    src/common/Makefile.am
M    src/Makefile.am
_M   src/pkcs15init
M    src/pkcs15init/pkcs15-oberthur.c
M    src/pkcs15init/profile.c
M    src/pkcs15init/pkcs15-lib.c
M    src/pkcs15init/pkcs15-rutoken.c
A    src/pkcs15init/pkcs15init.exports
M    src/pkcs15init/pkcs15-gpk.c
M    src/pkcs15init/Makefile.am
_M   src/scconf
M    src/scconf/Makefile.am
M    src/scconf/parse.c
A    src/scconf/scconf.exports
_M   src/libopensc
M    src/libopensc/card-rutoken.c
M    src/libopensc/compression.c
M    src/libopensc/sc.c
M    src/libopensc/card-piv.c
M    src/libopensc/pkcs15-openpgp.c
M    src/libopensc/pkcs15-postecert.c
M    src/libopensc/pkcs15-tcos.c
M    src/libopensc/opensc-config.in
M    src/libopensc/reader-pcsc.c
A    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
A    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-infocamere.c
M    src/libopensc/internal.h
M    src/libopensc/pkcs15-actalis.c
M    src/libopensc/pkcs15-starcert.c
M    src/libopensc/card-oberthur.c
M    src/libopensc/pkcs15-atrust-acos.c
M    src/libopensc/p15card-helper.c
D    src/libopensc/part10.h
M    src/libopensc/ui.c
M    src/libopensc/card-gpk.c
M    src/libopensc/pkcs15-wrap.c
M    src/libopensc/pkcs15-gemsafeGPK.c
M    src/libopensc/log.c
M    src/libopensc/pkcs15-esteid.c
M    src/libopensc/pkcs15-prkey-rutoken.c
M    src/libopensc/log.h
M    src/libopensc/Makefile.am
M    src/libopensc/reader-openct.c
_M   aclocal
M    aclocal/Makefile.am
_M   win32
M    win32/Makefile.am
A    win32/versioninfo.rc.in
A    win32/ltrc.inc
A    configure.ac
_M   doc
_M   doc/tools
M    doc/tools/pkcs15-profile.xml
D    doc/changelog.sh
D    doc/export-wiki.xsl
_M   doc/api
_M   doc/api/file
M    doc/api/man.xsl
_M   doc/api/asn1
_M   doc/api/apps
_M   doc/api/init
_M   doc/api/types
_M   doc/api/card
M    doc/api/html.xsl
_M   doc/api/misc
_M   doc/api/util
M    doc/Makefile.am
D    doc/export-wiki.sh
AM   doc/nonpersistent
A    doc/nonpersistent/export-wiki.xsl
A    doc/nonpersistent/Makefile.am
A    doc/nonpersistent/export-wiki.sh
A    doc/nonpersistent/svn2cl.xsl
D    doc/generate-man.sh
D    doc/svn2cl.xsl
M    Makefile.am
A    svnignore
_M   etc
M    etc/opensc.conf.in
M    etc/Makefile.am
D    man
_M   solaris
M    solaris/Makefile



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00
ludovic.rousseau 9740726f16 sc_asn1_decode_integer/asn1_encode_integer: correctly manage negative
numbers and some positive numbers like 128


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3401 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-29 15:37:46 +00:00
martin 69742ed3a9 circumvent the 'padded with zeros' ATR bug on Mac OS X <=10.5.2
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3388 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-14 17:02:02 +00:00
martin 8db7c8c124 * Fix protocol forcing. Whenever connecting, use whatever protocol is available / currently set on card and only force the protocol with a cold reset when different
This fixes pcsc_lock->pcsc_reconnect->protocol mismatch error escaping from reader-pcsc.c if some other application has set the card to a different protocol.
 * pcsc_reconnect uses PC/SC return values, pcsc_reset uses OpenSC; 0 -> SC_SUCCESS
 * CCID driver with OmniKey 1021 returns SCARD_W_UNPOWERED_CARD when a card is inserted upside-down. Translate the currently unknown error into 'Unresponsive card'.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3386 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-10 16:13:55 +00:00
ludovic.rousseau a4bad4452e Add support for the Austrian A-Trust ACOS card
Thanks to Franz Brandl for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-February/010675.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3318 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-01 14:31:02 +00:00
ludovic.rousseau 156f368f9d add two missing files for ruToken support
Thanks to Ian Young for the bug report


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3312 c6295689-39f2-0310-b995-f0e70906c6a9
2008-01-04 08:57:12 +00:00
ludovic.rousseau bf9d6beaac new patch for ruToken support
Thanks to Andrew V. Stepanov
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010631.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3310 c6295689-39f2-0310-b995-f0e70906c6a9
2008-01-03 08:59:14 +00:00
pk 513a3dde0a support for TCOS3
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3309 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-28 18:18:57 +00:00
martin 1667798217 Remove unused code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3308 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-21 16:40:27 +00:00
jps 27257f2278 support for Siemens CardOS V4.2C
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3306 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-19 09:58:29 +00:00
ludovic.rousseau 0ecc294ed8 add support of ruToken
Thanks to Andrew V. Stepanov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3304 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-17 13:39:20 +00:00
ludovic.rousseau 4d098d9650 do not add a signature prefix for D-Trust cards
Thanks to Simon Eisenmann for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010609.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3303 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-07 09:46:21 +00:00
ludovic.rousseau d2bec293d2 gemsafe_init(): the applet supports also SC_ALGORITHM_RSA_HASH_NONE
thanks to Douglas E. Engert for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3302 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-15 15:52:46 +00:00
ludovic.rousseau 44b2d51385 gemsafe_flags2algref(): return 0x12 instead of 0x13 for
SC_ALGORITHM_RSA_PAD_PKCS1

thanks to Douglas E. Engert for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3301 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-15 14:07:13 +00:00
ludovic.rousseau 82253cd635 sc_pkcs15emu_gemsafeV1_init(): remove addition of
SC_ALGORITHM_RSA_PAD_PKCS1 algorithm since it is already done in
card-gemsafeV1.c:gemsafe_init()

Thanks to Douglas E. Engert for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3299 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-13 09:13:17 +00:00
ludovic.rousseau 83cef7bfc0 remove spaces and tabs at end of lines
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3298 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-13 07:52:43 +00:00
ludovic.rousseau acda677fd0 sc_pkcs15emu_add_pin(): do not devide pin length by 2 in BCD case since
it is already done in sec.c line 262

Thanks to Douglas E. Engert for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3297 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-13 07:48:08 +00:00
ludovic.rousseau 07e6b23a26 add initial support of Gemsafe applet V1 cards
Thanks to David Mattes for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-November/010558.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3296 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-12 10:18:54 +00:00
ludovic.rousseau 1eb6fba882 rename sc_pkcs15emu_gemsafe_init_ex() in
sc_pkcs15emu_gemsafeGPK_init_ex() and sc_pkcs15emu_gemsafe_init() in
sc_pkcs15emu_gemsafeGPK_init()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3295 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-12 10:16:31 +00:00
ludovic.rousseau f3a3fd6081 rename pkcs15-gemsafe.c in pkcs15-gemsafeGPK.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3294 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-12 10:09:57 +00:00
ludovic.rousseau 88ee3980e3 rename gemsafe in gemsafeGPK so we can also have gemsafeV1, gemsafeV2,
etc.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3293 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-12 09:59:57 +00:00
ludovic.rousseau ca92ec661f patch from Douglas E. Engert for bug #165
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3292 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-09 08:35:23 +00:00
ludovic.rousseau caf4207090 setcos_match_card(): replace sc_error() by sc_debug() since some cards
are not SetCOS bug respond to the APDU: 00 CA DF 30 05


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3291 c6295689-39f2-0310-b995-f0e70906c6a9
2007-11-09 08:29:15 +00:00
gurer f947614418 This should be limited too.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3278 c6295689-39f2-0310-b995-f0e70906c6a9
2007-10-06 12:03:47 +00:00
nils 57f7f6e6e5 ignore paths with a AID in it
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3277 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-29 07:43:25 +00:00
gurer 4dd4d52921 AKIS can handle bigger data blocks, but that causes GET_RESPONSE calls.
So for a 300 byte file, this saves one transaction (244 + 56) instead of
(244 + 11 + 45).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3273 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-23 10:19:43 +00:00
gurer 780b4afe8a On a third thought, it is better to not introduce any confusion at all :)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3272 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-22 20:47:04 +00:00
gurer eada3a7e1c On a second thought, it is better to stay compatible with released
0.11.4 code, and still use ISO7814 pin_cmd.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3271 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-22 20:34:53 +00:00
gurer 3b47022051 * instead of using a custom PIN VERIFY command, pin_reference is
reported back, and used for verifying.

* PIN CHANGE command is implemented (that is really different
from ISO7816)

* max_pin_len is set to 16 in akis_init



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3270 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-17 11:41:28 +00:00
aj af9199b059 Appy patch by magog to build a static opensc_a.lib on windows.
Also removes *.lib on "make clean".


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3265 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-10 06:22:36 +00:00
aj 6882b13287 fix typo found by Gürer Özen.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3264 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-04 05:39:15 +00:00
nils 4d1871d74c properly check return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3263 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-29 19:54:10 +00:00
nils c2ee37e6c7 bugfix: select DF before setting sec. attributes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3262 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-29 19:32:23 +00:00
aj c25e4f765c akis update by Gürer Özen: implement logout code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3261 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-28 20:35:27 +00:00
aj 43b7391a94 fix typo, found by Gürer Özen.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3260 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-28 20:35:06 +00:00