Commit Graph

23 Commits

Author SHA1 Message Date
vtarasov d888b3fd55 pkcs15: use general 'AuthenticationObject' instead of 'PinObject'
now the attributes of the previous 'pin-info' data type are included
as the sub-type attributes of the general 'auth-info' data .
It will allow to include support of the 'biometricTemplate' and 'authKey' authentication types.

http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016655.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5550 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 15:46:25 +00:00
andre 3169f14b32 libopensc: Removes useless attribute 'file' in 'struct sc_pkcs15_df'
There is no need to carry around that attribute, because it's easy to look up the 'file' as needed. This is done by issuing a single sc_select_file command in sc_pkcs15init_update_any_df (pkcs15-lib.c).

The parameter 'file' of sc_pkcs15_add_df (pkcs15.c) became useless too and was removed in turn.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5316 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 04:09:33 +00:00
ludovic.rousseau ab589d7c99 Remove dead code
pkcs15-gemsafeV1.c:262:5: warning: Value stored to 'endptr' is never read
    endptr = (char *)(apdu.resp + apdu.resplen);
    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5159 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:16:10 +00:00
martin f5a21e417b pkcs15: don't play with TokenInfo.version. 0 means PKCS#15 v1.1. The flag is not used by OpenSC.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4789 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-05 16:02:57 +00:00
martin 50f99a20f8 libopensc: move TokenInfo fields from sc_pkcs15_card_t to a separate structure.
Thanks to Andre Zepezauer for the patch.

See http://www.opensc-project.org/pipermail/opensc-devel/2010-September/015076.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4788 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-05 15:44:58 +00:00
aj 6545b42c02 cleanup of the debug code:
* reduce to a few, supported functions.
* change all functions to take the debug level as parameter.
* use symbolic names for the debug levels.
* fix tools to pass "verbose"/"opt_debug" as ctx->debug.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4118 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 12:17:13 +00:00
viktor.tarasov 22f067863a libopensc emu: more general implementation of the postponed DF parsing
In previous version the card specific 'parse_df' handler was a part of 'sc_pkcs15_df'.

Now the placehold ('sc_pkcs15_operations') created for the all card emulator specific operations .


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4109 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 19:48:09 +00:00
viktor.tarasov 3a2f0415fe libopensc emu: postponed object loading
Some non-pkcs15 cards protect the reading of the private objects attributes. 

For the emulated pkcs15 cards, the 'init' emu-handler was the only place where pkcs15 objects could be loaded.
This handler is called before the card is binded, and so, for an application there was no 'normal' way to verify PIN and load the objects with protected attributes.

Actually it's possible to complete list of the pkcs15 objects after the emulated pkcs15 card has been binded. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4096 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-09 16:49:00 +00:00
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
martin d672fde449 Remove sc_error and sc_ctx_suppress_errors_* in favor of sc_debug/fprintf
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3721 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 08:46:59 +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
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 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
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 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 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