Commit Graph

1497 Commits

Author SHA1 Message Date
flc 0e03c6d5cf add cardmod a minidrivers for windows
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4001 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 13:05:25 +00:00
aj dc6bc0df4a fix pthread include for win32/mingw compilation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4000 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 11:21:31 +00:00
aj f1471e4a0c Fix bebytes2ushort function, reported by Roland Schwarz.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3999 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 06:20:45 +00:00
aj 9406ce2885 Updated piv driver by Douglas E. Engert:
the PIV driver no longer need to set the card max_*_size parameters
   to get around emulating read_binary and write_binary. It can
   now handle partial reads and writes.

   The assumptions for write_binary are that the first chuck will
   have idx = 0, and the last chunk will write the last byte.
   The flags parameter will contain the total length.

   The only write_binary operations are done when initializing
   a card, and this is only done from piv-tool.c which was modified
   to pass in the length and other flags.

   Piv-tool continues to be a primative test tool for inializing test
   cards. But it has been expanded to be able to write other objects
   on test cards.

   The serial number of a PIV  card is obtained from the CHUID object
   if present which has a FASC-N which is an ID number created by the
   issuer. Normally PIV cards are issued the U.S. Federal government
   But there are ways to use the same cards with a non government CA.
   This is then be referred to as PIV Compatible. In this case,
   the FASC-N should start with an agency code = 9999 and an RFC 4122
   GUID should be present in the CHUID. If this is the case, the GUID
   is used as the serial number.

   Windows 7 comes with a PIV card card driver, but to get it use one of
   these card the CHUID is required. (piv-tool can now write one.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3998 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 06:16:37 +00:00
aj 119c7751c7 Improved chaining for large APDU commands,
by Mats Andersson and Douglas E. Engert.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3997 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 06:14:19 +00:00
aj 91da321c46 remove log output coloring.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3993 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 06:22:50 +00:00
aj b113b90000 remove ui code from library.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3992 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 06:19:52 +00:00
martin 314a31f867 [PC/SC / MacOSX] Try to connect to the card twice.
On OS X, when you insert a card, securityd sequentially starts all found Tokend-s to see if a card can be handled with one.
If a non-tokend application waits for a card insertion with sc_wait_for_event and tries to connect to the card right after the system sees it, it will fail with "The reader is in use by another application" 95% of the time.
With this hack connecting to the card succeeds 95% of the time with the probable penalty of an extra second on initialization for non-tokend clients.

This should only affect applications that wait for card insertion events.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3991 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-03 15:46:44 +00:00
martin 36992b4001 [PC/SC] detect other events besides card insertion/removal
* remove whitespace.
 * don't use SC_MAX_READERS and allocate memory dynamically.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3987 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-03 09:54:02 +00:00
alonbl a6f9f023a0 [WINDOWS] Remove tool specific file description support resource file
The implementation was based on the previous MSC build, each tool had its own
description in version resource.

This change sets a single version resource to all files, and produces much
simpler build.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3980 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 14:50:42 +00:00
viktor.tarasov 596b8c3c03 oberthur: clean 'global' PIN reference flag when getting byte from ACL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3979 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 14:31:37 +00:00
martin ff4c2c6aa2 Include simclist.h to opensc includes to be able to build OpenSC.tokend
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3978 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 12:53:44 +00:00
martin 92debb4b5e PC/SC: Do not try to watch 0 readers on OS X
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3977 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 12:01:36 +00:00
viktor.tarasov bf471eaf74 pkcs15init: migrate MyEID to the New API
Migrated without testing, but normally should work -- the pkcs15init part of MyEID and SetCOS are sufficiently close.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3976 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 09:46:03 +00:00
viktor.tarasov 840053f6ba pkcs15init: migrate MyEID to the New API
Migrated without testing, but normally should work -- the pkcs15init part of MyEID and SetCOS are sufficiently close.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3975 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 09:44:46 +00:00
aj ac9f672189 update windows makefiles: only create one dll.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3973 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:22:28 +00:00
aj 4b2fe63ac2 build only one shared library instead of many.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3971 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:12:53 +00:00
viktor.tarasov 5e805ecf2d libopensc: in iso7816 process_fci() decode Life Cycle Status byte (ISO 7816-4 2005, 5.3.3, tag '8A')
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3961 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 10:54:51 +00:00
martin c23f07764d Add more event type defines, add declaration of sc_ctx_get_reader_by_id().
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3958 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 14:29:30 +00:00
viktor.tarasov f2d3618ff6 oberthur: finalize migration to the NEW API
no more 'init_app'.

- Oberthur unblock style is the only one (local SOPIN is used as PUK);
- user PIN and PUK should be everywhere defined as local;
- SOPIN is always global.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3950 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 18:07:14 +00:00
viktor.tarasov 7f0abe80bb libopensc pkcs15: path is optional for PinAttributes of PinObject
- for 'global' PINs path in not encoded into the AODF;
- when selecting pin_reference, start from value defined in profile.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3946 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:03:04 +00:00
viktor.tarasov 5cd5728c0e libopensc: search pkcs15 objects: accept NULL value for the output argument
So that, the dummy object for the 'search pkcs15 object' calls is not neccessary. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3942 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-26 12:59:08 +00:00
s 2ec8932c93 fix:
reader-openct.c: In function 'openct_reader_connect':
reader-openct.c:204: error: 'reder' undeclared (first use in this function)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3941 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-26 10:40:47 +00:00
viktor.tarasov 986309db79 libopensc: new operations for access control
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3939 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 16:10:54 +00:00
viktor.tarasov 97d5b3e6e7 sorry, commit by error; reverting back to r3935
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3937 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 15:30:33 +00:00
viktor.tarasov 6e9c7e5619 pkcs15-init tool: when importing bunch of certificate, break after the first errorsrc/tools/pkcs15-init.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3936 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 15:11:35 +00:00
martin d006b1845e libopensc:
- Remove slot abstraction from internal API and all reader drivers. CT-API (from where it all comes from) readers with multiple slots (if still found) can be presented as separate readers, OpenCT should remove the slot abstraction, PC/SC never knew about it. None of the tools knew how to use slots.
 - Add sc_cancel (translates to SCardCancel)
 - Re-implement sc_wait_for_event; support a blocking call.
 - Replace the "int reader" API with "* sc_reader_t" style; add "Get reader by name" functionality.
 - Remove "action" parameter from sc_disconnect_card() (was not used)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3931 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:25:08 +00:00
martin 0c7d6587be Use a constant buffer instead of malloc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3930 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:14:55 +00:00
martin cbfa2dd939 Missing piece from r3912
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3928 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 12:50:37 +00:00
martin cd9e666926 SC_ERROR_MEMORY_FAILURE signals EEPROM failures on card. Failures to allocate memory on host result in SC_ERROR_OUT_OF_MEMORY.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3927 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 12:38:34 +00:00
martin 612d66655d Introduce SC_ERROR_NOT_ENOUGH_MEMORY <=> CKR_DEVICE_MEMORY.
When trying to import a too large keyfile as a data object, TrueCrypt received a CKR_GENERAL_ERROR before this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3926 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-23 19:12:52 +00:00
martin f48ec9528e OpenSSL 1.0.0-beta series crash when assembler implementations underflow with 0 byte length call to OPENSSL_cleanse() and overwrite memory.
Avoid it by nut trying to eraze zero memory.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3925 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-23 06:28:35 +00:00
martin 7d935df1bc Fix #193: cryptoflex driver did not set minimum PIN length.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3922 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-21 19:58:49 +00:00
viktor.tarasov 6fc954cbc6 pkcs15init: new profile type BSO
at the profile level the difference between EF and BSO is:
- BSO path is always the path of the host DF and do not indexated when template is instanciated;
- EF path is always ending with file-id that is always indexated  when template is instanciated.

New non-static 'sc_profile_get_file_instance' procedure to instanciate non-template entries.
In profile.c get_uint() accepts hexadecimals.
In CardOS profile (I venture to) increase the xDF sizes 
	and change ACL to permit the key re-importing.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3919 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-21 09:41:40 +00:00
martin d5200b3bbe Add GemSafeXpresso 32K ATR.
The card is available from http://www.smartcardfocus.com/shop/ilp/id~246/p/index.shtml



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3918 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-19 13:11:21 +00:00
martin 29d93a07b1 Add comments about unused errors and add an error for locked readers.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3912 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 09:45:11 +00:00
viktor.tarasov c6a0e54f9a oberthur: accept token 'OCS ID-One Cosmo Card'; ignore warning status 'end of file reached ...'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3907 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-13 16:39:37 +00:00
aj 4942760d06 Xiaoshuo Wu:
removes the assert line and some unused code, solves a problem with ePass3000.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3906 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-13 12:27:05 +00:00
martin 7ce6c1d05e PC/SC: Add SCardCancel to please mingw
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3903 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-10 18:44:02 +00:00
aj f0484968a9 merge changes 0.11.11 -> 0.11.12
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3899 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-18 13:33:03 +00:00
viktor.tarasov 193ca76980 pkcs15-tool: change PIN with pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3883 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 12:51:12 +00:00
viktor.tarasov 6ff96b8c66 pinpad support of PIN changing and unlocking
Oberthur and opensc-explorer


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3880 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 11:11:04 +00:00
viktor.tarasov 490e02b349 after Martin's suggestion: for pcsc do not use '0' protocol when detecting readers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3879 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 10:47:51 +00:00
aj df4bdaf6f7 Update westcos emulation by François Leblanc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3878 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 07:18:19 +00:00
martin 0756990c44 Patch by João Poupino for Portugese eID card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3866 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-24 13:43:32 +00:00
s 56dd3ec0ea Modification Rutoken S binary interfaces by Aktiv Co. (OpenSC+Rutoken S driver for Windows works now)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3865 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 16:38:02 +00:00
viktor.tarasov 505406c3b0 Oberthur: verify PIN with pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3864 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 13:40:05 +00:00
s b372290e72 correct SEC_ATTR_SIZE name (add prefix)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3863 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 11:41:23 +00:00
s 7cbe5e5470 use generic iso7816_select_file code, remove duplicate code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3861 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-20 13:15:00 +00:00
s 052775325a remove dead code (in compliance with http://www.opensc-project.org/opensc/changeset/3839#file8)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3860 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-20 12:26:04 +00:00