Commit Graph

123 Commits

Author SHA1 Message Date
Raul Metsma 2b45194f4b Add EstEID 3.5 card support
EstEID card has new cold ATR and AID
2013-10-20 20:17:57 +02:00
Martin Paljak 16ee818440 Update domain name. paljak.pri.ee is gone since 2011. 2013-02-25 11:58:25 +02:00
ludovic.rousseau 9d490bc273 Remove dead code
card-mcrd.c:1023:20: warning: Value stored to 'linep' during its initialization
      is never read
                char line[256], *linep = line;
                                 ^       ~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5165 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:41:24 +00:00
martin d57395173c EstonianEid: better detection and workaround for the double tag bug with v3.0 cards
See wiki:EstonianEid for the description of known issues with the card.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5126 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-01 17:32:03 +00:00
martin bc5ddb7d95 EstonianEid: add new 2011 card ATR (18.01.2011+)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5112 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-19 08:37:07 +00:00
martin 5cc8814e30 EstonianEid: Add SC_ALGORITHM_RSA_RAW to not make sc_pkcs15_compute_signature remove the DigestInfo header.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4939 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-11 22:07:07 +00:00
martin c16179f75a EstonianEid: Don't leak 1024bit key to 2048b card properties
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4899 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 12:33:24 +00:00
martin 7ab591a684 libopensc: make sc_reset() take an additional parameter "do_cold_reset" which will unpower the card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4896 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-30 11:22:31 +00:00
martin 113dfda494 EstEID: add support for v 3.0 cards with 2048b keys
* Detect different cards based on ATR-s and on card objects
 * Set the card name from the ATR table
 * Conditionally add support for 2048b keys
 * Add workarounds for broken MULTOS and JavaCard cards.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4893 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-29 14:22:01 +00:00
martin df639efd89 EstonianEid: revert to old behavior and have the T=0 forcing.
Some cards have incorrect ATR-s and can cause troubles if pcsc-lite by default tries to set T=1 by default.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4834 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-28 13:11:13 +00:00
martin 6648255cb0 EstonianEid: add a broken EstEID ATR to the Micardo driver. Don't force a protocol for EstEID cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4825 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-22 15:48:04 +00:00
martin df2d7d1dd1 EstEID: remove incorrect ATR matching. A reset is required as there is no way simpler way to identify a broken card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4821 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-20 15:04:31 +00:00
martin f7000a93c1 EstEID: add workarond for a buggy card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4819 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-20 08:48:56 +00:00
martin fc5b3e5417 EstEID: buffer is 2 bytes bigger than max Le.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4720 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-14 09:27:46 +00:00
martin a5ca648afd Revert r4668. Change the way limitations on max send and receive sizes are set.
See http://www.opensc-project.org/pipermail/opensc-devel/2010-September/014836.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4706 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-09 18:58:44 +00:00
martin f9026bc86f EstEID: Fix #250. Force a SELECT FILE by cheating on the internal micardo path cache.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4697 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-06 09:32:13 +00:00
martin d994bb81a1 Micardo: remove redundant mcrd_decipher. Handled by ISO7816
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4696 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-06 08:54:13 +00:00
martin 362a907bf0 Micardo: Add SC_PIN_CMD_GET_INFO support, currently only for EstEID cards.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4690 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-05 16:52:56 +00:00
martin b04a1ef9f0 EstEID: small fixes for working with a modified max_send/recv_size
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4666 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-01 11:46:31 +00:00
martin c235f93cff EstEID: sc_format_path sets SC_PATH_TYPE_PATH by default
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4642 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 09:34:30 +00:00
ludovic.rousseau f47416d60e Do not cast the return value of malloc(3) and calloc(3)
From http://en.wikipedia.org/wiki/Malloc#Casting_and_type_safety
" Casting and type safety

malloc returns a void pointer (void *), which indicates that it is a
pointer to a region of unknown data type. One may "cast" (see type
conversion) this pointer to a specific type, as in

int *ptr = (int*)malloc(10 * sizeof (int));

When using C, this is considered bad practice; it is redundant under the
C standard. Moreover, putting in a cast may mask failure to include the
header stdlib.h, in which the prototype for malloc is found. In the
absence of a prototype for malloc, the C compiler will assume that
malloc returns an int, and will issue a warning in a context such as the
above, provided the error is not masked by a cast. On certain
architectures and data models (such as LP64 on 64 bit systems, where
long and pointers are 64 bit and int is 32 bit), this error can actually
result in undefined behavior, as the implicitly declared malloc returns
a 32 bit value whereas the actually defined function returns a 64 bit
value. Depending on calling conventions and memory layout, this may
result in stack smashing.

The returned pointer need not be explicitly cast to a more specific
pointer type, since ANSI C defines an implicit conversion between the
void pointer type and other pointers to objects. An explicit cast of
malloc's return value is sometimes performed because malloc originally
returned a char *, but this cast is unnecessary in standard C
code.[4][5] Omitting the cast, however, creates an incompatibility with
C++, which does require it.

The lack of a specific pointer type returned from malloc is type-unsafe
behaviour: malloc allocates based on byte count but not on type. This
distinguishes it from the C++ new operator that returns a pointer whose
type relies on the operand. (see C Type Safety). "

See also
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014586.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4636 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-18 15:08:51 +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
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 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 64f9578202 apdu.sensitive is not in use since [2868]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3751 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-03 09:31:07 +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
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
aj 047ee1d73e fix more warnings found by gcc/sparse.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3178 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 11:07:00 +00:00
aj 4acfe6b096 fix compiler/sparse warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3177 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 10:07:01 +00:00
martin 5dba203363 Make sure the right thing is always selected on the card by bypassing cache
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3142 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-21 09:33:40 +00:00
martin 1bee8bf5c6 off by 1
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3104 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-07 23:40:44 +00:00
martin 779326b9e5 Match EstEID based on ATR contents rather than the full ATR itself.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3098 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-05 16:13:46 +00:00
aj ad79822134 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3085 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:32:31 +00:00
martin 821a009609 New EstEID v1.5 card ATR
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3042 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-09 15:09:44 +00:00
nils aeae39f47d fix warnings
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3035 c6295689-39f2-0310-b995-f0e70906c6a9
2006-10-01 20:52:37 +00:00
martin b1a87b6fa5 Make sure every new opensc instance sees the card from the sight starting point.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3011 c6295689-39f2-0310-b995-f0e70906c6a9
2006-09-04 20:01:20 +00:00
aj 45007b3da7 compile fixes for win32.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2949 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-12 20:01:26 +00:00
aj b507ee68e4 add support for d-trust cards.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2927 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:12:36 +00:00
aj 5adad6431a Lindent so the result is easier to read / diff.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2886 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-18 08:16:21 +00:00
nils 8c926455d0 add support for two byte tags in sc_asn1_find_tag() + normalize return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2840 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-12 18:30:53 +00:00
martin 9e410e5f6c Some cleanup/fixes in micardo/esteid code related to new apdu.c
Now it works again ;)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2820 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-23 17:37:10 +00:00
martin 363d9be861 Get rid of handwritten sc_read_record calls
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2809 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-07 23:40:36 +00:00
nils 47ee84e72d add functions
void sc_ctx_suppress_errors_on(sc_context_t *ctx);
	void sc_ctx_suppress_errors_off(sc_context_t *ctx);
to turn on/off error suppression (to avoid accessing
sc_context_t directly) and use it.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2671 c6295689-39f2-0310-b995-f0e70906c6a9
2005-10-30 19:08:06 +00:00
martin 8596348a75 * Get rid of reset card error that comes from pcsc only and deal with reset situations with SCardReconnect
* Add some options to control pcsc behavior.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2553 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-08 11:35:26 +00:00
nils f6c95792fe let src/libopensc/ compile with -Wall -W -Wno-unused-parameter -Werror
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2546 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-07 08:33:55 +00:00
martin 5f2a3a58c7 Adjust function name to reflect documented functionality
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2364 c6295689-39f2-0310-b995-f0e70906c6a9
2005-06-27 13:51:45 +00:00
pisi c6c67692da Minor additions
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2237 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-09 12:25:25 +00:00
bert 2d97002824 API fixup: use defined type instead of struct for exposed structs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2232 c6295689-39f2-0310-b995-f0e70906c6a9
2005-03-08 20:59:35 +00:00
aet df5e357694 - Whitespace cleanup from me and Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2181 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-11 20:09:34 +00:00
aet 32b417cbf3 - First stab towards standardized card types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2172 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-10 10:07:13 +00:00
aet ece96aff98 - Add atrmask to sc_atr_table
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2160 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-09 11:33:37 +00:00
aet 69d2e9014d - Optimize a few cpu cycles from _sc_match_atr_hex
- Replace struct sc_atr_table / _sc_match_atr with
  recently introduced _hex variants
- Rewrote _add_atr
- Introduce int type variable to sc_card_t, so that
  every other card driver won't have to glue around
  with this
- Card driver cleanups, optimize the number of
  sc_match_atr called per card driver. Also
  always try direct match with _sc_match_atr
  first, before relying on eg. historical bytes
  information on some card drivers
- Fixed a memory leak from the miocos driver


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2145 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-06 19:40:40 +00:00
aet bd0f86f69c - Unify all card drivers ATR matching code to use _sc_match_atr_hex,
untested as of yet.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2134 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-04 20:29:35 +00:00
nils ced7764f02 fix debug message + remove empty lines, patch supplied by Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2085 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-19 19:56:49 +00:00
aet e5baf6da45 - Convert C++ comments into C to avoid compiler errors on some platforms
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2013 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-15 10:56:45 +00:00
nils e7a0b8f4eb cleanup: declare local functions as static, renamed shadowed variables etc.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2012 c6295689-39f2-0310-b995-f0e70906c6a9
2004-12-15 09:35:30 +00:00
aj d1da4005aa fix select_file in mcrd. by Martin Paljak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1968 c6295689-39f2-0310-b995-f0e70906c6a9
2004-11-01 21:13:57 +00:00
aj 44c55aea82 clarify micardo situtation.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1965 c6295689-39f2-0310-b995-f0e70906c6a9
2004-11-01 11:41:20 +00:00
nils e583473ceb two patches from Marin Paljak <martin.paljak@gmail.com> :
- remove unnecessary function from the reader ops
- add a field for pinpad support
- cleanup + fix indent in card-mcrd.c


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1948 c6295689-39f2-0310-b995-f0e70906c6a9
2004-10-22 07:29:07 +00:00
nils 49b5366530 add additional atr
patch supplied by Martin Paljak <martin@paljak.pri.ee>


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1889 c6295689-39f2-0310-b995-f0e70906c6a9
2004-08-19 08:41:51 +00:00
aj fe3914b397 kill two warnings about unused variables.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1835 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-14 22:11:53 +00:00
aj 268a302950 Add support for Estonian ID card. Written by Martin Paljak.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1834 c6295689-39f2-0310-b995-f0e70906c6a9
2004-07-14 21:13:54 +00:00
okir 323240fa44 - small fix in mcrd_finish
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1576 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-30 15:43:19 +00:00
okir 734bceb682 - Error logging changes: replace ctx->log_errors with ctx->suppress_errors,
so that we can nest error suppression using suppress_errors++/suppress_errors--


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1518 c6295689-39f2-0310-b995-f0e70906c6a9
2003-10-14 09:56:50 +00:00
aet 5616dba08e - Stop using unflexible automake conditionals when
building PC/SC, OpenCT or USBToken support,
  use ifdef's directly in source.
- Because of above, add HAVE_PCSCLITE for winconfig.h
- Remove unnecessary includes for log.h, opensc.h and
  errors.h in libopensc sources, they're already taken
  care by internal.h.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1406 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-03 09:28:55 +00:00
aet 763fc16704 Rename libopensc specific error/debug to sc_error/sc_debug
We should have done this ages ago.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1392 c6295689-39f2-0310-b995-f0e70906c6a9
2003-08-25 14:21:18 +00:00
okir 2abc504051 - remove signedness warnings printed by new gcc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1176 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-30 08:54:42 +00:00
okir 48a61e95c0 - added card name to struct sc_card to allow upper level apps to identify
card type more precisely


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1173 c6295689-39f2-0310-b995-f0e70906c6a9
2003-05-28 20:52:33 +00:00
sth 9631ef3636 removed const in sc_card_driver (caused win32 crash)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@918 c6295689-39f2-0310-b995-f0e70906c6a9
2003-02-20 12:51:07 +00:00
okir 9acca0e724 - Implemented new PIN verify/change/unblock framework. All PIN operations
are routed through sc_pin_cmd(), which builds the APDU and either passes
  it to the card directly, or to the card reader along with a request to
  read the PIN(s) from the reader's keypad.

  Currently, entering PIN in the standard way (i.e. via the application)
  should still work - I have verified GPK and eToken; Cryptoflex verify
  should work as well. Anything else needs additional testing, and support
  for keypad input in particular (I cannot test this at the moment for
  lack of a suitable reader).


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@811 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-23 18:47:27 +00:00
aet 148f4051f6 Various build fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@697 c6295689-39f2-0310-b995-f0e70906c6a9
2002-10-19 16:51:37 +00:00
jey 0810ccf4af - Removed error list
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@683 c6295689-39f2-0310-b995-f0e70906c6a9
2002-08-21 10:15:58 +00:00
jey 8bbcb933a4 - Added driver for MICARDO 2 cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@681 c6295689-39f2-0310-b995-f0e70906c6a9
2002-08-21 10:13:28 +00:00