Commit Graph

1533 Commits

Author SHA1 Message Date
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +00:00
viktor.tarasov 0bb56af014 pkcs15init: no more need for static keycache
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4079 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 17:03:44 +00:00
viktor.tarasov 02c35be138 asepcos: 'trasport PIN' (global PIN with reference '0') is presented as 'AUT' key
; no more need of athena dedicated PIN flag 'TRANSPORT KEY';



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4078 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 16:22:33 +00:00
viktor.tarasov de6649fed5 pkcs15init asepcos: fixup initialisation with protected profile
; new, athena dedicated, PIN pkcs15 flag 'TRANSPORT_KEY': 
in the Athena initialization procedure the 'trasport' SOPIN object is used. This object references to the pre-existing global SOPIN and is different from the final SOPIN of the card. This object should be ignored when fixing up the ACLs of the newly created file;

; the pkcs15 refereces of the new private keys are derived from the file-id;

; remove duplicated code;

; some log messages in  pkcs15-lib.c;




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4077 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-02 09:50:07 +00:00
flc 7a48d4a6f2 add support for westcos card with crypto component and minor renames to westcos-tool
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4072 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-25 15:16:23 +00:00
martin 6f887e5b62 #185: drop opensc-config. If required, pkg-config and libopensc.pc can be used instead.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4070 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 12:20:59 +00:00
martin 1ef975fa51 #148: clear PIN cache in sc_pkcs15_unbind()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4069 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 10:42:36 +00:00
viktor.tarasov 258a867bbc libopensc: re-design 'sc_pkcs15_allocate_object_content' for the case when the 'new' and 'old' data pointers are the same
;change the prototype of 'sc_pkcs15_find_pin_by_type_and_reference' to eliminate the compilation warnings;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4067 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 08:28:15 +00:00
flc 9a11b3019a set default auth_method SC_AC_CHV for emulated cards thanks to Martin Paljak patch
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4064 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 07:48:53 +00:00
viktor.tarasov 975d703c0d libopensc: remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4063 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 20:46:59 +00:00
martin 23b7c2673c pincache: pkcs15-pin.c:515: warning: unused variable ‘i’
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4061 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 19:54:59 +00:00
martin 7b6d2525da pincache: correct message for user consent PINs (it is a matter of policy not software support)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4060 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 19:53:53 +00:00
martin a8c4f57c55 Fix exports file:
{{{
Undefined symbols:
  "_sc_pkcs15init_fixup_acls", referenced from:
     -exported_symbols_list command line option
  "_sc_pkcs15init_set_pin_data", referenced from:
     -exported_symbols_list command line option
  "_sc_pkcs15init_set_secret", referenced from:
     -exported_symbols_list command line option
}}}


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4059 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 19:47:53 +00:00
martin edcf32337e libopensc: only one pkgconfig file is required.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4055 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 11:02:12 +00:00
viktor.tarasov 9c964e3d71 pincache: implement pincache as the content of the AUTH pkcs15 object
; in 'sc_pkcs15_pin_info' structure add 'auth_method' member to keep the PIN authentication method: CHV, AUT or SM;
; in pkcs15init profile add function to search PIN template by auth method and reference;
; in 'sc_pkcs15_remove_object' return silently if object to delete is NULL;
; in 'sc_pkcs15_object' structure add 'usage_counter' member;
; new 'sc_pkcs15_find_pin_by_type_and_reference' procedure to search PIN pkcs15 object by auth method and reference;
 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4048 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 22:04:07 +00:00
viktor.tarasov d7dfa2104a entersafe: fix import key RSA 2048 bits
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4046 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 10:09:06 +00:00
martin 30924e4e9d PKCS15: set the PRNG flag on PKCS#15 card object even if it was not set in TokenFlags if RNG capability is reported by the low level card driver.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4045 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 08:34:40 +00:00
martin 26f1750cd7 entersafe: don't mix hexadecimal and decimal in code and comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4044 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 08:31:19 +00:00
flc 6380feb1fd Use cardmod if explicitly request on config only
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4041 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-19 10:41:33 +00:00
viktor.tarasov 9c45262f5e MyEID: fix 'Activate Applet' apdu case
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4040 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-18 17:08:01 +00:00
viktor.tarasov d89e6377a0 MyEID: 'read until the end' not supported -- set maximal receiving size to 255
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4039 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-18 10:26:08 +00:00
viktor.tarasov 4395d5b8b3 MyEID: fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4038 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-18 10:08:32 +00:00
flc 3d23ea782b cardmod updates:
- Add comment to opensc.conf
- Use opensc log in cardmod
- Minor corrections on cardmod pcsc driver


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4036 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-17 07:51:52 +00:00
s 91da9ab819 fix memory leak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4027 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-12 16:53:07 +00:00
martin 5991dfb433 Remove the dummy EMV driver.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4021 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 14:50:18 +00:00
viktor.tarasov 2ab30d8c52 libopensc: 'javacard' driver has to be the last one before 'default' -- thanks to Andreas
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4020 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 14:47:34 +00:00
viktor.tarasov 8161c72fa3 libopensc: in
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4019 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 14:15:13 +00:00
flc 53d29939fd remove useless symbol from libopensc.exports
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4013 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-11 08:46:17 +00:00
aj da83260826 patch from debian bug report 470637 by Philippe Teuwen:
update_binary() was not foreseen by the middleware creators of BELPIC
so I added it, which allows to write some data in the
MF/ID/EF(Preferences) of the card.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4010 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-10 07:40:52 +00:00
viktor.tarasov b8009bec07 libopensc: error message for success
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4009 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-09 15:15:02 +00:00
viktor.tarasov b28add8e3b libopensc: in sc_pkcs15_object introduce the 'content' member
Replace not-used 'der' structure member by the 'content' one.

'Der' member was introduced to keep the ASN1 encoded object attributes. Actually it's not used.
'Content' is intended to keep the object value (AUTH object - pin cache value; CERT object - der value, ...)



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4008 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-09 14:45:07 +00:00
viktor.tarasov 909953d55a libopensc: separate 'remove' and 'free' pkcs15 object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4007 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-09 14:05:54 +00:00
viktor.tarasov 935b0740e4 libopensc: remove not used function
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4006 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-09 13:53:27 +00:00
aj 3073306989 Add a comment to keep javacard driver 2nd last.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4005 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-06 12:59:24 +00:00
martin 4d56ce2b7b Add a catch-all for (possibly) blank JavaCards. This way known blank JavaCards without a supported applet get recognized by opensc-tool -n.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4004 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-06 10:56:29 +00:00
alonbl f636cc1862 cardmod - build fixups and mingw stuff
1. Add --enable-cardmod to autoconf to enable feature explicitly.

2. Modify opensc-cardmod.dll to always have bitness suffix eg opensc-cardmod32.dll

3. Remove complex cardmod.h detection, could not find any reason for this.

4. Make cardmod.inf a template and inject opensc version into its version string.

5. More minor autoconf/automake cleanups.

6. Remove internal-winscard.h usage in cardmod.c as cardmod.h already includes winscard.h

7. DllMain is not exportable.

Notes:

1. I may caused other build not to work, will happy to work it out.

2. Cannot find reason why cardmod.inf cardmod-westcos.reg should reside in bin directory.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4003 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 21:39:28 +00:00
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