Commit Graph

53 Commits

Author SHA1 Message Date
Frank Morgner 60f2d06308 libopensc: fetch card's UID
Fetch card's UID.
For file caching, use UID if SN is not available.
2016-07-24 17:16:29 +02:00
Frank Morgner 0790969b97 recognize short EF identifier 2015-03-31 18:48:57 +02:00
Frank Morgner 3d9118a870 changed sc_apdu_t.data back to const unsigned char * 2014-10-27 22:48:34 +01:00
Viktor Tarasov 4d5b80fd3f libopensc: general usage method to allocate generalized time 2013-12-29 22:00:12 +01:00
Viktor Tarasov 51262f00ac pkcs15init: in profile more AC operations are parsed, ...
new AC-OP 'pin-use'
2013-12-29 20:05:35 +01:00
Frank Morgner 07818329ab made sc_apdu_t.data 'const' (which it used to be)
fixes a lot of warnings which pass a const buffer to the APDU's data

Note that a non-const data member is only required for sc_allocate_apdu
sc_free_apdu. They are currently used with an explicit typecast.
However, sc_allocate_apdu and sc_free_apdu both are not used once in the
entire project. One might also simply throw both functions away.
-- Both are thrown away. (VT)
2013-08-03 18:26:04 +02:00
Viktor Tarasov 3c804ff382 libopensc: more comments about FCP data 2013-02-25 10:20:31 +01:00
Viktor Tarasov 326232de90 libopensc: introduce 'encoded-content' to the sc_file data
it's the hold place for the file's initial encoded content.
For some cards such data can be included into the file creation command.
2013-02-24 19:37:35 +01:00
Viktor Tarasov 6a4de6d551 libopensc: APDU 'allocate & copy'and 'free' procedures 2013-01-06 17:30:41 +01:00
Viktor Tarasov 0166321835 libopensc: increase maximum number of card drivers
http://www.opensc-project.org/pipermail/opensc-devel/2012-October/018552.html
Default driver is disabled on 0.13 because there are more drivers listed in ctx.c. (leonardo.schenkel@gmail.com)

SC_MAX_CARD_DRIVERS is increases from 32 to 48. It's not the best solution, but the most rapid.
Will be waiting for the better proposals.
2012-11-04 16:44:34 +01:00
Viktor Tarasov 4cf3a3b204 move CK_VERSION data from 'pkcs15' to 'sc-card'
CK_VERSION is included into PKCS#11 data but is not specified by PKCS#15.

CK_VERSION can be provided by card's pkcs15 emulator or by the card's driver,
including the cards with the native support of pkcs#15 (and thus without pkcs15 emulator).

That's why the more general solution is to have these data included into 'sc-card' data type.
2012-10-21 16:24:11 +02:00
Viktor Tarasov 58b4304957 libopensc: 'init', 'format', 'compare', 'is-valid' OID procedures
In a reason of number of bugs(*) that concern the OID management,
the general usage OID procedures 'init', 'format', 'compare', 'is-valid' are introduced.
These procedures should be used by all actors: libopensc, pkcs15, pkcs11, tools, ....

(*)
This bug reported by Andreas Schwier :
8e75d971cb (commitcomment-1792477)

In pkcs15-algo sc_asn1_get_algorithm_info() can return the OID without ending '-1's:
https://github.com/OpenSC/OpenSC/blob/staging/src/libopensc/pkcs15-algo.c#L452
https://github.com/OpenSC/OpenSC/blob/staging/src/libopensc/pkcs15-algo.c#L459
2012-09-06 10:47:29 +02:00
Viktor Tarasov cfd5aaba7d SM: initial implementation of secure messaging framework 2012-06-08 20:17:35 +02:00
Viktor Tarasov 6337149ef7 pkcs15: decode 'seInfo', 'profileIndication', 'lastUpdate'
Encode,decode  'lastUpdate', 'seInfo', 'profileIndication' of TokenInfo (CIAInfo).
Trailing whitespaces.
2012-05-30 09:03:27 +02:00
vtarasov 65e10c29ad libopensc: add description for the 'remote data' data types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5443 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 15:34:03 +00:00
vtarasov 292d561882 libopensc: move declaration of 'serial number' related data types from 'opensc.h' to 'types.h'...
also define CPLC and 'remote_data' data types.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5437 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 12:19:29 +00:00
andre fa8fd1602d types.h: Avoid warning:
opensc-tool.c:356: warning: comparison between signed and unsigned

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5372 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 12:34:16 +00:00
andre 1008062844 Adjust SC_MAX_APDU_BUFFER_SIZE to maximum size of Short APDU.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5186 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-06 22:33:13 +00:00
vtarasov 76b0a73a80 tools: reserve more place for the print path and AID buffer ...
to insert the '::' indicator of 'AID' or 'DF_NAME' path type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5084 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 10:46:09 +00:00
vtarasov 40cb9c99b8 asn1: decode 'extendedPath'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5077 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 17:25:09 +00:00
vtarasov 8ee55a38b3 libopensc: extend DDO data type with the parsed 'aid', 'oid' and 'iid' members
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5068 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 09:29:39 +00:00
vtarasov f304fed517 libopensc: add 'crts' array to 'struct sc_acl_entry' ...
For some cards the acl bytes, retrived from 'select' response, can reference 
a SE (and not directly PIN).
In such case, to proceed an authentication for the card operation 
the information about the SE's CRTs is needed.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5066 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 09:13:47 +00:00
vtarasov a576582701 libioensc: use 'struct sc_atr' instead of 'u8 *atr, size_t atr_len'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5061 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 17:18:58 +00:00
vtarasov 209224816a libopensc: introduce TLV and LV data type, use it to store DDO data
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5051 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-06 16:16:24 +00:00
vtarasov 0611b6260f libopensc: add 'sc_aid' member to 'sc_path' ...
not all application DF have and can be selected by its file-id.
So, new member in 'sc_path' will help to describe the full path to some EF(DF) inside a card.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5047 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 15:39:43 +00:00
vtarasov f2924672d8 pkcs15: add 'aid' parameter to the prototype of the 'bind' functions ...
prepare for the multi-application support


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5041 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 14:21:04 +00:00
vtarasov ee907b7a69 libopensc: add new authentication methods, add ACLs to PIN info, ...
add 'next' member to 'sc_apdu' structure


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5004 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 13:20:19 +00:00
martin cae16b6ef8 By default the reader driver does not have receive/send limitations.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4714 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-13 07:40:45 +00:00
martin 8c1bcea28a libopensc: remove unused SC_MAX_READER_DRIVERS
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4710 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-11 13:00:54 +00:00
martin 0858a5c854 libopensc: remove SC_MAX_READERS which is not used.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4708 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-11 13:00:36 +00:00
viktor.tarasov f85b625b47 pkcs15: correct the comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4511 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 12:57:10 +00:00
viktor.tarasov f18ba7d984 pkcs15: decode 'supportedAlgorithms' in 'TokenInfo'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4510 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 12:54:23 +00:00
viktor.tarasov 1d82e8abab re-distribute 'define' macros between types.h and opensc.h
move 'define' macros closer to the definition of the related data types


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4509 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-05 09:33:51 +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
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 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
aj f9b30e48c4 fix typos, patch by Gürer Özen
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3257 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-22 18:38:02 +00:00
nils 1b4472ca9f use const, add yet another ACL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3114 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-20 12:46:40 +00:00
vtarasov 0d0048e5ad introduce SC_PATH_TYPE_FROM_CURRENT and SC_PATH_TYPE_PARENT path types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3094 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-02 10:04:35 +00:00
aj b3ad2f9dd2 convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3084 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:31:17 +00:00
nils de4b5c280f - implement thread-safe path printing function sc_path_print() and use
it src/libopensc/ and src/pkcs15init/
- use size_t for the certlen parameter of sc_pkcs15init_update_certificate()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2811 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-11 23:41:17 +00:00
nils fe3e93b625 summary: -complete rewrite of the APDU/transmission handling
code (should now support extended APDUs and is
          hopefully better documented. Note: support for
          the T0 ENVELOPE command is still missing due to
          a lack of test cards).
         -add new APDU case constants SC_APDU_CASE_2 etc.
          which let OpenSC decides, based on the card
          capabilities, whether to use short or extended
          APDUs.
         -add new capability SC_CARD_CAP_RSA_2048 for
          cards supporting 2048 bit RSA operations (note:
          this is more a preliminary hack)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2795 c6295689-39f2-0310-b995-f0e70906c6a9
2005-12-28 20:01:43 +00:00
aet c1b0626cdd - Cleanup, typo fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2123 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-02 10:21:10 +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
okir 021ea9c0c3 - added length value to sc_path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@734 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-02 13:42:03 +00:00
aet 3dccd63989 - C++ support. Compiles with gcc/g++ for Linux, otherwise
completely untested.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@574 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-19 14:23:31 +00:00
okir 5d8b1000ca - eToken patches from Markus Friedl
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@546 c6295689-39f2-0310-b995-f0e70906c6a9
2002-04-17 13:36:35 +00:00