Commit Graph

16 Commits

Author SHA1 Message Date
martin 56fb57603b Merge [3758:3783/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3785 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-22 09:18:16 +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
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 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
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
aj c3fcd9f7dd Steve Jacobs: fix muscle driver.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3148 c6295689-39f2-0310-b995-f0e70906c6a9
2007-04-10 19:49:26 +00:00
martin 30d0066a58 Stop MS visual studio 2005 complaints.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3103 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-06 16:35:38 +00:00
aj 38720ba5e1 update to latest muscle code.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3080 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 21:58:16 +00:00
aj 31f4fada5b define these constants where used to kill warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3069 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-07 10:53:37 +00:00
aj b3822c349b update the MuscleCard driver for OpenSC to use an msc_id struct rather than
int/bytes and messing around with byte-swapping for that. (by Thomas Harning)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3067 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-30 08:14:16 +00:00
vtarasov 2d4bd463b0 Use do {...} while(0) construction for SC_TEST_RET, SC_FUNC_RETURN and SC_FUNC_CALLED defines
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3050 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-06 11:15:09 +00:00
sth bf23c032ca Endian-independent way to convert numbers to a byte array + vice versa
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2979 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-27 17:49:19 +00:00
sth 6d96437c4a The applet returns unexpected values when entering a wrong PIN; this is a work-around by Thomas Harning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2973 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-18 20:52:10 +00:00
nils 409fe3a9a0 fix warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2972 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-17 15:07:49 +00:00
sth 50490acca0 Added support for MuscleCard applet. Thanks to Thomas Harning, David Corcoran of Identity Alliance
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2968 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-07 08:33:37 +00:00