Commit Graph

963 Commits

Author SHA1 Message Date
vtarasov 1e59a09dbd pkcs15init: for the EC key put the EC specific data into the 'params' member of 'key-info' data ...
; more of debug messages;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5414 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-01 20:14:06 +00:00
vtarasov 5e50a14b3f libopensc: introduce 'key-params' data type that contains pointer, size and 'free' handler ...
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016441.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5413 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-01 19:18:14 +00:00
vtarasov 49fb08f923 pkcs15init: use macro for the maximal number of linked ACL for one operation ...
Thanks to NdK. 
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016448.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5406 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 14:45:23 +00:00
vtarasov 06347f3a44 iasecc pkcs15init: when creating key slot, there is no needs to write zero value components
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5400 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 13:45:27 +00:00
vtarasov 81e1676122 iasecc pkcs15init: create/delete SDO private/public RSA key
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5399 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-26 17:32:34 +00:00
vtarasov 5e6d310491 iasecc: pkcs15init profiles: add 'CREATE' acl for the Oberthur's application DF ...
Obertbur's card do not returns FCP for selected application DF.
Newly introduced option will supply the missing ACL when creating new objects or files.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5395 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-26 16:27:42 +00:00
vtarasov 54f3e8c423 pkcs15init: little correction of r5386
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5390 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-22 14:02:45 +00:00
vtarasov 6b04ab7650 pkcs15init: in 'change-attribute' procedure use card specific 'update DF' handler ...
... when it's available. 
'Change-attribute' is used by pkcs15 framework for PKCS#11.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5389 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-22 14:00:47 +00:00
vtarasov 4fa9679463 pkcs15init: use dedicated function to fix the EC parameters ...
; use pointQ data to calculate intrinsic ID for the EC keys/certs


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5388 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-22 13:50:01 +00:00
vtarasov 78d90c4765 EC support: introduce data type dedicated to EC parameters ...
EC parameters can be presented in a three forms: namedCurve, OID and implicit data.
This new data type will facilitate manipulation of ec-parameters in the OpenSC tools and library.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5386 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-22 13:08:45 +00:00
vtarasov 3e9b88d6d6 pkcs15init iasecc: old syntax in the profile of the Oberthur's generic application
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5385 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-21 17:20:39 +00:00
andre ff7bb8fbf4 profile.c: Avoid warning:
profile.c:1212: warning: comparison between signed and unsigned

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5373 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 12:59:23 +00:00
andre 261d5269e5 pkcs15-init.h: Avoid warning:
pkcs15-init.c:1473: warning: assignment discards qualifiers from pointer target type

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5362 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 09:12:17 +00:00
vtarasov 8de6b57882 pkcs15init: different possible kinds of EC generate key parameters ...
named curve, oid and der


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5357 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-17 18:48:12 +00:00
vtarasov 2202614fdc pkcs15init setcos: no need of card specific 'delete-object' callback ...
there is nothing specific inside and it's never called by pkcs15init


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5349 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-16 17:57:49 +00:00
vtarasov d673e5f109 pkcs15init myEID: in profile increase size of xDF files, also ...
during initialization add the all xxDF to the ODF


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5344 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-15 17:11:38 +00:00
vtarasov 614e9fa566 pkcs15init: sipmlify the 'delete-object' callaback prototype ...
now it takes 'sc_pkcs15_object' argument instead of two arguments - object's type and object's data.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5343 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-15 16:50:04 +00:00
vtarasov 49da421ac0 pkcs15init: prepare pkcs15-lib for the EC key type ...
use keygen consistency procedure to return the EC key size;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5337 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 18:08:18 +00:00
vtarasov 7b6cf4219e pkcs15init: when deleting object, do not try to select object file without valid path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5336 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 17:59:59 +00:00
vtarasov 6705e2506b pkcs15init: remove useless function, use OpenSC standard convention for return value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5333 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 13:23:05 +00:00
vtarasov 2fecaa73bd pkcs15init: introduce EC key generation parameters
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5332 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 11:36:40 +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
andre b21eeb46b9 libopensc: Removes unused flag SC_CARD_CAP_RSA_2048.
Relates to [http://www.opensc-project.org/opensc/ticket/296#comment:1 #296].

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5308 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 18:16:40 +00:00
martin ea7eb699e5 WindowsInstaller: build for x64 with nmake -f Makefile.mak BUILD_TYPE=WIN64
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5286 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-01 08:06:25 +00:00
ludovic.rousseau 6fe27b2c4a Fix compiler warning
pkcs15-iasecc.c:63: warning: no previous prototype for 'iasecc_reference_to_pkcs15_id'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5254 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:19:15 +00:00
ludovic.rousseau c824662a03 Fix compiler warning
pkcs15-lib.c: In function 'prkey_fixup_rsa':
pkcs15-lib.c:1936: warning: declaration of 'ctx' shadows a previous local
pkcs15-lib.c:1911: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5253 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:16:52 +00:00
ludovic.rousseau de196fa205 Fix compiler warning
pkcs15-lib.c: In function 'sc_pkcs15init_store_private_key':
pkcs15-lib.c:1339: warning: declaration of ‘ctx’ shadows a previous local
pkcs15-lib.c:1278: warning: shadowed declaration is here

The ctx variable was already declared with the correct value.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5252 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:15:30 +00:00
ludovic.rousseau f88bbe117f Remove typedef file_info to complete the change/cleanup in revision 5250
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5251 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:12:40 +00:00
ludovic.rousseau 99bbc06bcb Fix compiler warning
profile.c: In function 'sc_profile_get_pin_id_by_reference':
profile.c:785: warning: declaration of ‘pin_info’ shadows a global declaration
profile.c:217: warning: shadowed declaration is here

Avoid using a typedef with a "common" name


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5250 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:10:10 +00:00
martin 7ab9b7f10d Fix a typo reported by lintian
I: libopensc3: spelling-error-in-binary ./usr/lib/libopensc.so.3.0.0 extention extension

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5238 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-20 12:18:55 +00:00
vtarasov 3c5d61716c pkcs15init: EnterSafe: increase size of the xDF files
http://www.opensc-project.org/pipermail/opensc-devel/2011-February/016051.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5236 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-15 09:39:04 +00:00
vtarasov 763c0bcefe pkcs15init: #327: unique ID for the private key objects. Thanks a Diego (NdK) ...
http://www.opensc-project.org/opensc/ticket/327


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5219 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-06 11:34:58 +00:00
vtarasov 4f266b6099 libopensc: include 'scdl' library when linking with Visual Studio ...
missing 'scdl' header file in 'pkcs15-lib'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5206 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-17 13:35:25 +00:00
martin 2ea78bf741 Amend r5201: also move libltdl build properties to the right Makefile and other leftovers.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5203 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-17 07:45:36 +00:00
martin ffb46d2573 core: reanimate the sc_dlopen API for dynamic loading
* shift libpkcs11 from src/pkcs11 to src/common as it is not used to implement the OpenSC PKCS#11 module
 * invent a "libscdl" mini library that implements either libltdl based dynamic loading or uses native interfaces
 * drop hard requirement for libltl to build OpenSC
 * native Windows build does not need libltdl any more
 * specify CNGSDK include dir to find cardmod.h. CNGSDK only registers with a handful of compilers

Deals with #323

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5201 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 19:02:11 +00:00
vtarasov 53dd2ceafa IAS/ECC: remove dead code and '//' coments, resolve some warnings ...
to be continued, thanks to Martin


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5200 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 14:05:17 +00:00
vtarasov 69b7f200eb IAS/ECC: include support of the IAS/ECC v1.0.1 cards ...
http://www.opensc-project.org/pipermail/opensc-devel/2011-January/015756.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5198 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 10:59:10 +00:00
vtarasov 57b7a81c3a IAS/ECC: add IAS/ECC card specific files ...
as it was announced in 
http://www.opensc-project.org/pipermail/opensc-devel/2011-January/015756.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5197 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 10:55:05 +00:00
vtarasov ce116f42b6 pkcs15init: for MyEID card set tokenInfo flags ...
it's a part of demand of the card driver's maintainer
http://www.opensc-project.org/pipermail/opensc-devel/2011-February/015994.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5196 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 10:46:06 +00:00
ludovic.rousseau b6ea61fcf5 Remove dead code
pkcs15-authentic.c:692:2: warning: Value stored to 'caps' is never read
        caps = card->caps;
        ^      ~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5151 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:54:31 +00:00
ludovic.rousseau 28bf3bf02e Remove dead code
pkcs15-oberthur-awp.c:143:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP container list";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:138:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP private object list";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:133:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP public object list";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:128:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP token info";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:122:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP private data object info";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:117:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP data object info";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:112:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP public key info";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:106:3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP private key info";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c💯3: warning: Value stored to 'desc' is never read
                desc = "Oberthur AWP certificate info";
                ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur-awp.c:338:2: warning: Value stored to 'rec_offs' is never read
        rec_offs = 0;
        ^          ~
pkcs15-oberthur-awp.c:1369:2: warning: Value stored to 'offs' is never read
        offs += len;
        ^       ~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5150 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:53:08 +00:00
ludovic.rousseau 12a0613da2 Remove dead code
pkcs15-oberthur.c:457:4: warning: Value stored to 'type' is never read
                        type = SC_PKCS15INIT_USER_PIN;
                        ^      ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur.c:452:4: warning: Value stored to 'type' is never read
                        type = SC_PKCS15INIT_USER_PUK;
                        ^      ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur.c:445:4: warning: Value stored to 'type' is never read
                        type = SC_PKCS15INIT_SO_PIN;
                        ^      ~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5149 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:51:02 +00:00
ludovic.rousseau 041a1449f5 Remove dead code
pkcs15-myeid.c:251:4: warning: Value stored to 'type' is never read
          type = SC_PKCS15INIT_USER_PIN;
          ^      ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-myeid.c:244:4: warning: Value stored to 'type' is never read
          type = SC_PKCS15INIT_SO_PIN;
          ^      ~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5148 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:50:00 +00:00
ludovic.rousseau d3a5a1389f Remove dead code
pkcs15-muscle.c:101:3: warning: Value stored to 'type' is never read
                type = SC_PKCS15INIT_USER_PIN;
                ^      ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-muscle.c:99:3: warning: Value stored to 'type' is never read
                type = SC_PKCS15INIT_SO_PIN;
                ^      ~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5147 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:48:56 +00:00
ludovic.rousseau b4bdb72745 Remove dead code
pkcs15-incrypto34.c:133:7: warning: Although the value stored to 'r' is used in
      the enclosing expression, the value is never actually read from 'r'
  ...r = sc_pkcs15init_authenticate(profile, p15card, file, SC_AC_OP_DELETE)...
     ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5146 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:47:40 +00:00
ludovic.rousseau 80ed46d689 Remove dead code
pkcs15-starcos.c:158:3: warning: Value stored to 'p' is never read
        *p++ = ipf_file->size & 0xff;
         ^~~
pkcs15-starcos.c:128:3: warning: Value stored to 'p' is never read
        *p++ = 0x00;    /* SM ISF: no */
         ^~~
pkcs15-starcos.c:239:3: warning: Value stored to 'p' is never read
        *p++ = ipf_file->size & 0xff;
         ^~~
pkcs15-starcos.c:206:3: warning: Value stored to 'p' is never read
        *p++ = 0x00;            /* SM ISF: no */
         ^~~
pkcs15-starcos.c:636:4: warning: Value stored to 'p' is never read
                *p++ = 0x00;
                 ^~~
pkcs15-starcos.c:613:4: warning: Value stored to 'p' is never read
                *p++ = (u8) kinfo->key_reference;       /* CHA byte */
                 ^~~
pkcs15-starcos.c:699:3: warning: Value stored to 'p' is never read
        *p++ = (u8) kinfo->key_reference;       /* CHA */
         ^~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5145 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:46:24 +00:00
ludovic.rousseau 98dd13f44f Remove dead code
pkcs15-jcop.c:118:17: warning: Value stored to 'type' is never read
                type = SC_PKCS15INIT_USER_PIN;
                ^      ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-jcop.c:112:17: warning: Value stored to 'type' is never read
                type = SC_PKCS15INIT_SO_PIN;
                ^      ~~~~~~~~~~~~~~~~~~~~
pkcs15-jcop.c:171:9: warning: Value stored to 'pub_len' is never read
        pub_len = 2 + mod_len + exp_len;
        ^         ~~~~~~~~~~~~~~~~~~~~~
pkcs15-jcop.c:284:6: warning: Value stored to 'bytes' is never read
     bytes   = mod_len / 2;
     ^         ~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5144 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:45:05 +00:00
ludovic.rousseau 18c144603a Remove dead code
pkcs15-cflex.c:747:3: warning: Value stored to 'key' is never read
        *key++ = 0;
         ^~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5143 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:42:50 +00:00
ludovic.rousseau 9df8712b9e Remode dead code
pkcs15-gpk.c:213:3: warning: Value stored to 'type' is never read
                type = SC_PKCS15INIT_USER_PIN;
                ^      ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-gpk.c:207:3: warning: Value stored to 'type' is never read
                type = SC_PKCS15INIT_SO_PIN;
                ^      ~~~~~~~~~~~~~~~~~~~~
pkcs15-gpk.c:853:3: warning: Value stored to 'pe' is never read
                pe++;
                ^~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5142 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:41:51 +00:00
ludovic.rousseau b8a9abe314 Remove dead code
pkcs15-lib.c:727:4: warning: Value stored to 'pin_type' is never read
                        pin_type = SC_PKCS15INIT_USER_PIN;
                        ^          ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-lib.c:1011:3: warning: Value stored to 'pin_type' is never read
                pin_type = SC_PKCS15INIT_SO_PIN;
                ^          ~~~~~~~~~~~~~~~~~~~~
pkcs15-lib.c:1009:3: warning: Value stored to 'pin_type' is never read
                pin_type = SC_PKCS15INIT_USER_PUK;
                ^          ~~~~~~~~~~~~~~~~~~~~~~
pkcs15-lib.c:1505:2: warning: Value stored to 'usage' is never read
        usage = SC_PKCS15_PRKEY_USAGE_SIGN;
        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-lib.c:1507:3: warning: Value stored to 'usage' is never read
                usage = sc_pkcs15init_map_usage(args->x509_usage, 0);
                ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-lib.c:2560:3: warning: Value stored to 'file' is never read
                file = df->file;
                ^      ~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5141 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:38:49 +00:00
ludovic.rousseau fb9e21d823 Fix a memory leak
The initializations are already done a few lines below

pkcs15-lib.c:1938:11: warning: Value stored to 'ctx' during its initialization
      is never read
                BN_CTX *ctx = BN_CTX_new();
                        ^     ~~~~~~~~~~~~
pkcs15-lib.c:1937:11: warning: Value stored to 'aux' during its initialization
      is never read
                BIGNUM *aux = BN_new();
                        ^     ~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5140 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:29:52 +00:00
ludovic.rousseau c17eb11d41 Fix compiler warning
pkcs15-authentic.c:97:1: warning: no previous prototype for function
      'authentic_reference_to_pkcs15_id' [-Wmissing-prototypes]
authentic_reference_to_pkcs15_id (unsigned int ref, struct sc_pkcs15_id *id)
^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5130 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:04:02 +00:00
ludovic.rousseau 65b65e588b Use & for logical and
pkcs15-asepcos.c:518:23: warning: use of logical && with constant operand; switch to bitwise & or remove constant [-Wconstant-logical-operand]
        *p++ = (fileid >> 8) && 0xff;
                             ^  ~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5129 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 16:54:28 +00:00
vtarasov 8e81e3912b MyEID: pkcs15init: create all xDF files at the stage of the card initialisation ...
it was discussed in 
http://www.opensc-project.org/pipermail/opensc-devel/2011-January/015620.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5115 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-19 14:47:54 +00:00
vtarasov 2fff7a1e91 pkcs15init: profile: unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5113 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-19 14:16:12 +00:00
vtarasov b560561755 pkcs15init: when deleting object ignore the object data file selection error 'FILE_NOT_FOUND' ...
just update the xDF content.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5107 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 10:39:08 +00:00
vtarasov 5ab90b9219 libopensc: avoid using of the not completely initialized 'sc_path' variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5106 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 09:48:26 +00:00
vtarasov d1f7e7b8c8 pkcs15init: profile: little fix of the previous commit
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5102 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 16:52:04 +00:00
vtarasov 2adfa05ac8 pkcs15init: profile: use short form of the log message call
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5101 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 16:49:56 +00:00
vtarasov 4c183b2b38 pkcs15init: function to finalize profile when binding to the application of the multi-application PKCS#15 card.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5100 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 16:28:44 +00:00
vtarasov 51ab68db83 pkcs15init: profile: redesign 'sc_profile_find_file_by_path()' ...
to take into account the non-zero 'aid' member in the 'path' parameter 
or in the path of the file's instance

also take into account the non-zero 'aid' when getting 'file-id'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5099 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 16:05:43 +00:00
vtarasov c65bc9023b pkcs15init: profile: new function 'get_parent' ...
to get profile instance of the parent of some file presented by it's profile name.

;accept hexadecimal values presented in 'xAB' form;
;coding style issues;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5098 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 15:51:47 +00:00
vtarasov 1519cb38a1 pkcs15init: profile: handles for 'profile-extention' and 'exclusive-aid' ...
'profile-extention' profile parameter used to load from the separate file 
the AID dependent profile part.

'exclusive-aid' profile parameter used to introduce the AID for the DF
that do not have file-id and that can be selected only by 'DF-NAME' selection.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5097 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 15:18:11 +00:00
vtarasov 35a54b511c pkcs15init: profile: sc_profile_finish() accept additional parameter 'application info' ...
Each application of the multi-application PKCS#15 card has it's own associated pkcs15init profile file.
Profile of the multi-application card contains an association between the ID of the on-card application 
and associated profile name.

When sc_profile_finish() is called
 - sc_card is connected,
 - information on the preset on-card applications is available;
 - AID of the applicaition to be binded is known.
thus allowing to sc_profile_finish() to load the final part of the profile.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5096 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 14:51:10 +00:00
vtarasov 41731ce56f pkcs15init: profile: parse new AC operation types ...
debug messages and some coding style issues


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5095 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 14:03:01 +00:00
vtarasov 7f5ea5b013 libopensc: export sc_find_app(), remove debug message, ...
avoid double '::' separator in path_print();
touch authentic profile file


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5087 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-12 17:41:10 +00:00
vtarasov 4c57c899b3 pkcs15init: add 'aid' argument to prototype of sc_pkcs15init_erase_card() ...
used to indicate application to erase


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5086 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 16:50:30 +00:00
vtarasov a798b2dc0c pkcd15init: get PIN reference from SE number when verifying 'SE' secret type ...
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5085 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 16:40:49 +00:00
vtarasov b9e25370ab tools: use 'aid' as the name of option to specify the on-card PKCS#15 application
; update documentation;
; debug messages;
; cleanup the authentic card profile.
 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5050 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-06 14:39:19 +00:00
vtarasov f2dc077c59 pkcs15init: use short debug message call
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5049 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 16:04:15 +00:00
vtarasov 0761a61a65 libopensc: use 'struct sc_aid' instead of 'u8 *aid, size_t aid_len'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5048 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 15:42:36 +00:00
vtarasov ffcc58baf3 pkcs15init: debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5044 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 14:33:32 +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 103af724fe liopensc: log: use 'normal' as default debug level ...
and make shorter short call to insert debug message


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5040 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-04 11:33:03 +00:00
vtarasov 3a2e88ce4d AuthentIC: remove unused members of the SDO structure
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5039 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-04 10:52:50 +00:00
vtarasov 392e6eff98 AuthentIC: use short form to insert 'normal' debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5038 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-04 09:19:09 +00:00
vtarasov 84b93e4099 Oberthur: replace 'SC_ERROR_MEMORY_FAILURE' return code by the 'SC_ERROR_OUT_OF_MEMORY'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5034 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-03 09:55:14 +00:00
vtarasov df92ba1684 pkcs15init: when deleting file by path, try to get 'DELETE' authentication of the file itself ...
then 'DELETE' authentication of parent


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5033 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-03 09:45:51 +00:00
vtarasov 4fbe008623 pkcs15init: more of debug messages in profile.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5032 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-03 09:44:10 +00:00
vtarasov 89d47696dd AuthentIC: remove unused macros, code layout
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5031 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 16:26:41 +00:00
vtarasov 0056eeb34c AuthentIC: memory allocation errors, thanks to Martin
for memory allocation errors use SC_ERROR_OUT_MEMORY instead of SC_ERROR_MEMORY_FAILURE


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5029 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 15:01:03 +00:00
vtarasov 0b618ab144 pkcs15-init: AuthentIC: user PIN reference in card profile
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5027 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:31:35 +00:00
vtarasov ae9854d7bc pkcs15-init: profile: instantiate 'BSO' file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5025 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:27:42 +00:00
vtarasov 6cc1134fac pkcs15-init: 'PSO-*' ACL names in profile
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5020 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:02:47 +00:00
vtarasov a7c75182a1 pkcs15-init: no more 'SPLIT-KEY' flag ...
more of debug messages


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5019 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 13:55:03 +00:00
vtarasov 6aaf1a79e3 AuthentIC: cleanup dead code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5012 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-31 10:52:15 +00:00
vtarasov 682c464540 AuthentIC: "now there is no way to build without OpenSSL" (Andre Zepezauer)
Thanks for patch.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5011 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-31 08:54:07 +00:00
vtarasov d644441f5c AuthentIC: add profile
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5007 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 14:42:30 +00:00
vtarasov 1a58c429cb 'AuthentIC': basic support of Oberthur's 'COSMO.v7/AuthentIC.v3.2' ...
it's the natively PKCS#15 card


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5006 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 14:40:28 +00:00
vtarasov 891f98363b pkcs15init: new 'emulation-store-data' operation ...
the first usage is to update the public key PKCS#15 object attributes 
and to encode it's direct value.
(support of the Oberthur's AuthentIC V3.2 card)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5001 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 12:50:35 +00:00
andre 5c6afb6bed Add missing initializers. Left over from r4508.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4952 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-16 01:47:03 +00:00
vtarasov e259021d36 win32: change path to OpenSC windows registers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4935 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-09 09:23:21 +00:00
ludovic.rousseau 6f5f29eee9 Revert revision 4853 because of a regression when initialing cards
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4857 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-06 13:03:46 +00:00
ludovic.rousseau 70ead491fc sc_pkcs15init_read_info(): do not use affectation and test in the same
line of code but use two different lines so the code is easier to read.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4854 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-02 08:02:13 +00:00
ludovic.rousseau 93f5e24e13 sc_pkcs15init_read_info(): do not call sc_pkcs15init_parse_info() if
sc_select_file() failed.

Thanks to Andre Zepezauer for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2010-November/015216.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4853 c6295689-39f2-0310-b995-f0e70906c6a9
2010-11-02 07:59:46 +00:00
vtarasov 0d96b3c9c3 oberthur: from the common part remove the Oberthur specific tokenInfo flags
Thanks to Andre Zepezauer for the patch.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4800 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-07 15:12:12 +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
viktor.tarasov 517878d102 myeid: applied patch for MyEID card profile
provided by Tony (Aventra development), thanks.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4777 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-27 07:50:14 +00:00
viktor.tarasov dc3b1d008b pkcs15init: homogenise line ending of debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4759 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-22 12:17:53 +00:00
s 659db6f50b Fix: default count of attempt (use profile) for new version firmware
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4752 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-21 18:14:04 +00:00
martin 4a547b6f09 libopensc: Don't touch TokenInfo.flags->loginRequired
See http://www.opensc-project.org/pipermail/opensc-devel/2010-September/014871.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4722 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-15 12:00:16 +00:00
s ac0a8dbb15 remove software RSA support for Rutoken S
Migration OpenSC to "new scheme" (further to r4646)
http://www.opensc-project.org/pipermail/opensc-devel/2010-September/014717.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4705 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-09 17:28:44 +00:00
viktor.tarasov ec6bb9859d MyEID: For Aventra card applied Toni's patch, enriched by Andre's proposal
see:
http://www.opensc-project.org/pipermail/opensc-devel/2010-August/014662.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4686 c6295689-39f2-0310-b995-f0e70906c6a9
2010-09-04 20:46:07 +00:00
martin cd01ad0936 pkcs15init: On Windows, get the profile directory from registry instead of configuration file.
This allows the installation directory for non-dll files to be anywhere on the system.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4652 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-25 12:51:55 +00:00
martin 1f73d32e40 libopensc: Remove unused internal SC_ERROR_EXTRACTABLE_KEY and correct relevant comments (native != extractable)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4645 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-23 10:32:26 +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
viktor.tarasov 3ea6b28405 #229: pkcs15init entersafe: 'sanity-check' includes the update of the User PIN's 'pinFlags'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4516 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-06 12:40:56 +00:00
viktor.tarasov ae14336221 pkcs15init: create frame to implement card specific 'sanity check' procedure
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4508 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-02 14:26:29 +00:00
viktor.tarasov 2883c17b15 pkcs15init: homogenize argument order of pkcs15init operations
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4507 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-02 13:46:13 +00:00
martin 48615686ac style: // -> /* */
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4416 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-16 12:01:04 +00:00
martin a1c77b96ab Entersafe: cache the presented PIN on personalization, simplify the code a bit.
See http://www.opensc-project.org/pipermail/opensc-devel/2010-June/014312.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4408 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-09 13:53:11 +00:00
martin 8737ace703 Entersafe: the default profile should have local PIN-s
See http://www.opensc-project.org/pipermail/opensc-devel/2010-June/014310.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4406 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-09 11:18:22 +00:00
martin ce0645d6d1 Fix compilation without OpenSSL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4404 c6295689-39f2-0310-b995-f0e70906c6a9
2010-06-09 10:06:42 +00:00
s a4e3273298 Rutoken S: add 'aid' to profile (for '-init --create-pkcs15 --so-pin 87654321 --so-puk -p rutoken+small')
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4390 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-30 13:54:54 +00:00
viktor.tarasov 78d6bc4189 pkcs15init: fix undeclared variable
Noted by Jean-Michel, thanks.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4383 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-27 08:12:20 +00:00
viktor.tarasov fff1963931 pkcs15init: do not reuse existing file when storing object data or updating certificate
merged with r4380:4380 of https://www.opensc-project.org/svn/opensc/branches/vtarasov/opensc-sm.trunk



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4382 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-26 14:33:01 +00:00
s 2d3722389d fix: Rutoken S: no need to reserve 5000 bytes for AppDF (pkcs15.profile: size = 5000)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4365 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 19:49:12 +00:00
viktor.tarasov e23756123e pkcs15init: when verifying PIN, if no value supplied, try to use pin pad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4361 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-19 08:26:01 +00:00
viktor.tarasov 39642a5d93 in feitian profile set 'local' flag for the User PIN
so that Feitian card profile will reflect the real card initialisation.

At the origin there were problem of signing with Feitian card, noted by Ludovic.

http://www.opensc-project.org/pipermail/opensc-devel/2010-May/014180.html





git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4345 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-13 17:45:43 +00:00
ludovic.rousseau e63d12bc8f replace spaces by tab
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4326 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-10 14:35:43 +00:00
viktor.tarasov 922d7cdc66 add TODO comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4325 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-10 09:18:49 +00:00
viktor.tarasov ac41eba3ac win32: merge the branches/vtarasov/opensc-sm.trunk
update win32 compilation;
Unix style line ending in src/pkcs15init/pkcs15-oberthur.h;
variables declaration issue in src/tools/cardos-tool.c.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4280 c6295689-39f2-0310-b995-f0e70906c6a9
2010-05-01 12:15:36 +00:00
viktor.tarasov d5f201bcb5 pkcs15init: in sc_pkcs15init_update_file() take care about file selection errors
Noted by Ludovic.

In sc_pkcs15init_update_file() procedure the file selection errors other then SC_ERROR_FILE_NOT_FOUND were not treated.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4271 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-28 09:20:17 +00:00
viktor.tarasov 06f5b0ba5b pkcs15init: when updating certificate and when there are no ACLs in FCI of selected file use default ACLs from the card profile
Some cards do not include security attributes into the FCI returned by 'SELECT' command.
    For such cards, when updating certificate, to authenticate 'UPDATE' operation use the
    'sc_file' with default ACLs instantiated from the card profile.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4265 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-24 17:37:02 +00:00
jps aa4d951101 Support for CardOS 4.4
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4264 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-21 14:38:23 +00:00
viktor.tarasov 8f4ee1b6e4 pkcs15init: fix #96: more details for the load profiles error
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4261 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-20 17:09:26 +00:00
viktor.tarasov 83ca335da7 cflex pkcs15init: use temporary PINs that satisfy default pin policy
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4257 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-19 12:10:56 +00:00
viktor.tarasov 0004461734 oberthur: add in emulator and create in pkcs15init the private data object
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4253 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-18 14:51:44 +00:00
viktor.tarasov 801fdcefe2 pkcs11, libopensc, pkkcs15init: not use C99 designated initializers
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4238 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-14 11:36:40 +00:00
viktor.tarasov 523d529248 pkcs15init: no more 'keycache' sources
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4218 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 13:41:04 +00:00
viktor.tarasov d3652ebf83 pkcs15init: no more 'keycache' sources
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4217 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 13:37:38 +00:00
viktor.tarasov 1c7aefe76e pkcs15init: corrent debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4216 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 08:46:27 +00:00
viktor.tarasov f9eb1b3bbb pkcs15init: for the newly generated key object set public key as it's content
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4215 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-12 08:44:24 +00:00
ludovic.rousseau 2820f78e09 Fix
pkcs15-oberthur-awp.c: In function ‘awp_encode_data_info’:
pkcs15-oberthur-awp.c:1211: warning: implicit declaration of function ‘sc_asn1_encode_object_id’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4205 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:23:21 +00:00
ludovic.rousseau d4b143830a Rename variable rand in rand_buf
pkcs15-oberthur-awp.c: In function ‘awp_new_container_entry’:
pkcs15-oberthur-awp.c:241: warning: declaration of ‘rand’ shadows a global declaration
/usr/include/stdlib.h:176: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4204 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:21:48 +00:00
ludovic.rousseau 8f6317b31b Use size_t instead of int to fix a compiler warning
pkcs15-oberthur.c: In function ‘cosm_write_tokeninfo’:
pkcs15-oberthur.c💯 warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4203 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:19:14 +00:00
ludovic.rousseau 8822668466 Use size_t instead of int to fix a compiler warning
pkcs15-myeid.c: In function ‘myeid_generate_key’:
pkcs15-myeid.c:687: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4202 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:15:12 +00:00
ludovic.rousseau 28a2ed6bd1 Fix
pkcs15-myeid.c: In function ‘myeid_new_file’:
pkcs15-myeid.c:321: warning: assignment discards qualifiers from pointer target type
pkcs15-myeid.c:323: warning: assignment discards qualifiers from pointer target type
pkcs15-myeid.c:325: warning: assignment discards qualifiers from pointer target type
pkcs15-myeid.c:327: warning: assignment discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4201 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:13:41 +00:00
ludovic.rousseau 4c6b6f937a Fix
pkcs15-entersafe.c:200: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:201: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:202: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:203: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:204: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:205: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:206: warning: initialization discards qualifiers from pointer target type
pkcs15-entersafe.c:207: warning: initialization discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4200 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:12:27 +00:00
ludovic.rousseau de2b498c31 setcos_generate_key(): use size_t instead of int to fix a compiler
warning

pkcs15-setcos.c:488: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4199 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:10:33 +00:00
ludovic.rousseau a3aa685be2 Use explict field names in the static initialisation to make it more
robust to code change

pkcs15-setcos.c:588: warning: missing initializer
pkcs15-setcos.c:588: warning: (near initialization for ‘sc_pkcs15init_setcos_operations.emu_update_dir’)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4198 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 12:05:40 +00:00
ludovic.rousseau 0f32e86732 declare a variable (const char *) to fix compiler warnings
pkcs15-setcos.c: In function ‘setcos_new_file’:
pkcs15-setcos.c:263: warning: assignment discards qualifiers from pointer target type
pkcs15-setcos.c:265: warning: assignment discards qualifiers from pointer target type
pkcs15-setcos.c:267: warning: assignment discards qualifiers from pointer target type
pkcs15-setcos.c:269: warning: assignment discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4197 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 11:58:08 +00:00
ludovic.rousseau 88764575f2 use (const char *) as return type to avoid compilation warnings:
pkcs15-lib.c: In function ‘get_template_name_from_object’:
pkcs15-lib.c:2152: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2154: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2156: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2159: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2161: warning: return discards qualifiers from pointer target type
pkcs15-lib.c: In function ‘get_pin_ident_name’:
pkcs15-lib.c:2815: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2817: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2819: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2823: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2825: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2827: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2829: warning: return discards qualifiers from pointer target type
pkcs15-lib.c:2832: warning: return discards qualifiers from pointer target type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4196 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-02 11:55:13 +00:00
martin d1d47d44c5 Fix #198: set correct access flags to private keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4193 c6295689-39f2-0310-b995-f0e70906c6a9
2010-04-01 14:16:43 +00:00
viktor.tarasov 4eaba6b404 muscle profile: keep default ACLs for the 'DIR' file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4188 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-31 12:41:39 +00:00
ludovic.rousseau 24b2d23585 westcos_pkcs15_create_pin(): use a temporary variable to not lose
negative values (errors)

Fix
pkcs15-westcos.c:135: warning: comparison of unsigned expression < 0 is always false
pkcs15-westcos.c:159: warning: comparison of unsigned expression < 0 is always false


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4165 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 15:04:20 +00:00
ludovic.rousseau 2e4610e3be Use a "const char *" to store a const C-string ptr. Fix
pkcs15-oberthur-awp.c:97: warning: assignment discards qualifiers from pointer target type
pkcs15-oberthur-awp.c:98: warning: assignment discards qualifiers from pointer target type
pkcs15-oberthur-awp.c:99: warning: assignment discards qualifiers from pointer target type
[etc...]


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4161 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:53:44 +00:00
ludovic.rousseau 35036bceca Fix
pkcs15-oberthur.c: In function ‘cosm_write_tokeninfo’:
pkcs15-oberthur.c:94: warning: format not a string literal and no format arguments
pkcs15-oberthur.c:96: warning: format not a string literal and no format arguments


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4160 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:50:05 +00:00
ludovic.rousseau 10bf1fc8df Fix
pkcs15-oberthur.c:61: warning: redundant redeclaration of ‘cosm_delete_file’
pkcs15-oberthur.h:93: warning: previous declaration of ‘cosm_delete_file’ was here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4159 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:46:06 +00:00
ludovic.rousseau f66a1cc5d5 Fix
pkcs15-westcos.c:41: warning: redundant redeclaration of ‘sc_check_sw’
../../src/libopensc/opensc.h:674: warning: previous declaration of
‘sc_check_sw’ was here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4158 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:44:56 +00:00
ludovic.rousseau 30b7888c34 Remove unused variables. Fix warning: unused variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4157 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:43:17 +00:00
ludovic.rousseau ecae106253 Fix warning: missing initializer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4156 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 11:37:13 +00:00
ludovic.rousseau 5914be4e58 Fix
pkcs15-lib.c:799: warning: no previous prototype for ‘sc_pkcs15init_store_puk’
pkcs15-lib.c:2814: warning: no previous prototype for ‘get_pin_ident_name’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4152 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 09:45:54 +00:00
ludovic.rousseau 6973403675 Fix pkcs15-oberthur-awp.c:729: warning: no previous prototype for
‘awp_update_object_list’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4151 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 09:44:22 +00:00
ludovic.rousseau 1eb944e256 Fix pkcs15-oberthur-awp.c:1246: warning: no previous prototype for
‘awp_set_data_info’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4150 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-28 09:43:20 +00:00
viktor.tarasov c891886f56 oberthur pkcs15init: sorry, fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4145 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-23 10:03:05 +00:00
viktor.tarasov c63225cf99 oberthur pkcs15init: non-install header; join pkcs15-oberthur-awp.obj to object list for win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4144 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-23 10:02:22 +00:00
viktor.tarasov 7106674d41 oberthur pkcs15init: support for creation of the 'public' DATA objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4143 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-22 14:17:27 +00:00
viktor.tarasov 0608713b07 oberthur pkcs15init: use macro for debug level
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4139 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 17:51:06 +00:00
viktor.tarasov 9b72b24d42 oberthur: forgotten header file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4138 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 17:21:39 +00:00
viktor.tarasov 0f82c7c1d4 oberthur: pkcs15init emulator
Now the native Oberthur card format is supported for emulation of pkcs15 and pkcs15init.

It means that card personalized with OpenSC and the obejcts created with OpenSC 
will be usable with the native Oberthur's middleware 
and vice-versa.





git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4137 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 12:30:39 +00:00
viktor.tarasov 0c9b9f21a8 pkcs15init: free cert object if 'link object' failed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4135 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 10:25:50 +00:00
viktor.tarasov ef8e169955 pkcs15init: use encoded public key as the 'content' of private and public key pkcs15 objects
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4134 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 10:15:51 +00:00
viktor.tarasov 7d6739feb2 pkcs15init: in pkcs15-init.h don't use parameters name in the function declarations
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4133 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:49:49 +00:00
viktor.tarasov ecbe32f778 pkcs15init: fix pkcs15-init.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4132 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:46:35 +00:00
viktor.tarasov 8419f95f76 pkcs15init: in pkcs15-init.h, for the function prototypes, homogenize using 'struct *' vs. '*_t'; do not use paramters name
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4131 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:39:16 +00:00
viktor.tarasov 965ecbf9a1 pkcs15init: pkcs15 card flags
Set 'TOKEN INITIALIZED' after an application has been added,
set 'USER PIN INITIALIZED' and 'LOGIN REQUIRED' after User PIN object has been created.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4130 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:27:09 +00:00
viktor.tarasov 5eba20e263 pkcs15init emulation: use emu_update_tokeninfo() if available
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4129 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:20:33 +00:00
viktor.tarasov e214ba206c pkcs15init: emulation API
Four method are added to the 'sc_pkcs15init_operations':
emu_update_dir		-- create or not the DIR file;
emu_update_any_df	-- update the non-pkcs15 descriptors that are equivalents to pkcs15 xDF files;
emu_update_tokeninfo	-- update analog of tokenInfo;
emu_write_info		-- to not create OPENSC-INFO file;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4128 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-18 09:10:51 +00:00
viktor.tarasov 69a2fb1941 oberthur: in profile do not use 'combined' pins in ACLs
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4125 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 16:45:02 +00:00
viktor.tarasov 5bba49e58c oberthur: in card profile set 'do-last-update' to 'false'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4124 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 16:40:12 +00:00
viktor.tarasov fb45d8925b pkcs15init: simplify internal API
; do not pad PIN in pkcs15init. It's already done in libopensc/pkcs15-pin;
; the 'do_verify_pin()', 'sc_pkcs15init_verify_key()' and 'do_get_and_verify_secret()' are replaced by unique 'sc_pkcs15init_verify_secret()'; edit debug messages;



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4123 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-17 16:26:07 +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 da9aa435c4 fix second part of #199: pkcs15init: when freeing pkcs15 object remove it from list
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4116 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-15 08:36:36 +00:00
viktor.tarasov e5300b1c2d fix #199: to authenticate 'update' in sc_pkcs15init_update_file() use the file instantiated from profile, rather then selected one
This bug concerned the card drivers for which the file ACLs cannot be obtained from the FCI of the selected file.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4114 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 23:35:08 +00:00
aj 02768fb5dc remove "split-key" option and emulat sign for sign,decrypt keys with padding
and decrypt() for cardos.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4113 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 22:52:51 +00:00
viktor.tarasov 8b15f0f340 pkcs15init: sc_pkcs15_add_df() has no more 'handler' parameter
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4110 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-13 19:54:28 +00:00
viktor.tarasov 052881c38f libopensc: in pkcs15 PIN commands 'pin_info' parameter replaced by 'pin_object'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4103 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-10 09:23:01 +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
viktor.tarasov aff7b5523c pkcs15init: homegenize pin reference type in a different structures; remove unused parameters in the internal procedures;
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4088 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-05 10:37:11 +00:00
viktor.tarasov 3a424cf26a pkcs15init: dummy object is not needed for the sc_pkcs15_find_XX() procedures; coding style issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4086 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 16:14:30 +00:00
viktor.tarasov 0e8e1a1bf0 pkcs15init cflex: fix protected initialisation
In the 'flex' card profile the ACLs of the public objects are set to 'NONE'.

As the pkcs15init core currently implemented, the AuthID attribute is not used for the public objects. 
Without AuthID the destination 'pin-domain' DF cannot be determined in a simple and sure manner.
That's why 'pin-domain' works only for private key, private data
and the public objects are placed into the application DF. 


; take 'flex' CHV files settings from the card profile;






git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4085 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 13:37:11 +00:00
viktor.tarasov de3e6aeba9 pkcs15init: prepare instantiation of the pin-domain templates
When binding profile and p15card (in sc_pkcs15init_set_p15card()), add to the profile EF list the named DF for the path of the all existing AUTH.

; variables name and coding style issues;
; debug messages;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4084 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 13:05:03 +00:00
viktor.tarasov 21acf3ed3d pkcs15init profile: fix indexed instantiation of pin/key domain; more of debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4083 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 12:55:09 +00:00
viktor.tarasov 5d08b13f98 pkcs15init asepcos: unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4082 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 12:49:12 +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
viktor.tarasov 1bd07bacd6 pkcs15init profile: syntax error can provoke segmentation fault
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4080 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-03 17:22:01 +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
viktor.tarasov 70ee7c1438 pkcs15init: in sc_pkcs15init_add_object() if DF update fails, remove object from the list before return
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4076 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 15:29:39 +00:00
viktor.tarasov dbd315c7e9 profile: 'cbs' member of 'struct sc_profile' is not used
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4075 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 14:01:25 +00:00
viktor.tarasov bb6ccdb9fb pkcs15init oberthur: no extractable key; for generated key set reference from the key's path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4073 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-01 13:36:02 +00:00
s adf4035d86 fix mistake in r4065
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4068 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 08:57:37 +00:00
s 839644bb4e add check params; fix: pkcs15-rutoken.c:208: warning: unused parameter 'puk'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4065 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-24 08:22:24 +00:00
viktor.tarasov 9485f168ee pkcs15init: 'defined bu not used'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4062 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 20:33:51 +00:00
viktor.tarasov 535131adda pkcs15init: instead of static keycache use the pincache as a content of the pkcs15 AUTH object
Tested with cards:
CardOS v4.3B;
SetCOS 4.4.1B;
Oberthur;
Cryptoflex 16k, 32k e-gate, 32k e-gate token;
GPK 8K;
Athena;
Aventra;
Fetian;
Rainbow 3000 (STARCOS SPK 2.3)




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4058 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 18:24:41 +00:00
viktor.tarasov 4dd6abf41b pkcs15init: in the prototypes of the internal procedures the 'struct sc_card' argument replaced with the 'struct sc_pkcs15_card' one
This patch is not largely tested and it will be followed (hope in a few hours) with another one 
that will replace the using of the static pincache 
with the pincache as the content of the AUTH pkcs15 object.

In the intervention into the card specific part I tried to respect its creator's coding style.
Sorry, if it's not always the case.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4057 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-21 16:21:57 +00:00
viktor.tarasov e5233e7297 cyberflex: no more 'protect-certificates' profile option
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4051 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 23:20:38 +00:00
viktor.tarasov ef919e94d4 pkcs15init: 'protect-certificates' profile option not used
Profile option 'protect-certifcates' was activated by default for all the cards, 
was mentioned and commented out only in 'flex' profile,
and finaly is not working 'by design' of pkcs15-lib.c

So, no need to keep this option, untill the valid arguments to restore it back.
Anyway, the access to certificates is controlled by the file's ACLs defined in profile.


;in profile use the 'define' macros to define the pin encoding type;



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4050 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 23:14:45 +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 ac5307d457 pkcs15init: when updating 'OpenSC Info' file, cleanup its non-used tail part -- thanks to Xiaoshuo
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4047 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-20 20:09:22 +00:00
viktor.tarasov ba3299bcef entersafe: sorry, fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4043 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-19 16:52:50 +00:00
viktor.tarasov 9bf12ba47f entersafe: unify cards behavior - don't throw error when erasing empty card
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4042 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-19 16:41:05 +00:00
s 709869785c fix: mis-usage of 'type' (PIN encoding style)
Thanks to Viktor TARASOV
http://www.opensc-project.org/pipermail/opensc-devel/2010-February/013454.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4037 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-17 17:19:14 +00:00
viktor.tarasov 42d7d22841 pkcs15init profile: accept the minimal file-ids difference from GPK profile
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4030 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-15 17:47:20 +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
s 85613b459d rutoken (ECP): add 4 DF (reserved for internal use)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3996 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 12:18:19 +00:00
s 0a4c42ba06 rutoken (S and ECP): never unblock SO PIN
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3995 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-04 10:39:30 +00:00
s b4a24af66d rutoken (S and ECP): both PINs are globals (and addition to changeset 3960, 3946)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3990 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-03 12:10:41 +00:00
viktor.tarasov 4c34f5b28c pkcs15init: useless if/else construction
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3986 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 18:15:53 +00:00
viktor.tarasov 6afab17c73 pkcs15init: remove commented-out code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3985 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 17:29:17 +00:00
viktor.tarasov b94d9896e1 pkcs15init: little fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3984 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 17:20:09 +00:00
viktor.tarasov 97ab1858e8 pkcs15init: remove the old commented-out code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3983 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 17:18:06 +00:00
viktor.tarasov 8026eabacd pkcs15init: remove profile option 'keep-public-key' that was used only by oberthur
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3982 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 16:45:47 +00:00
viktor.tarasov b065c70695 pkcs15init: abandon Old API
tested with Oberthur, CardOS and SetCOS.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3981 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 14:50:56 +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 840053f6ba 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@3975 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 09:44:46 +00:00
viktor.tarasov 976c214a05 pkcs15init: unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3974 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-02 09:33:29 +00:00
aj ac9f672189 update windows makefiles: only create one dll.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3973 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:22:28 +00:00
aj e9b3c5982e remove no longer used export files.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3972 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:20:51 +00:00
aj 4b2fe63ac2 build only one shared library instead of many.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3971 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:12:53 +00:00
viktor.tarasov 9c7624c81b pkcs15init: sc_verify() has been deprecated (thanks to Martin)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3970 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 10:14:04 +00:00
viktor.tarasov 0ce0b37487 pkcs15init miocos: remove obsolete code
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3969 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 09:04:10 +00:00
viktor.tarasov 167aed7c1f pkcs15init: migrate setcos to the New API
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3968 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-31 20:29:58 +00:00
viktor.tarasov 7f52a0267f pkcs15init cardos: fix update keys
When creating application DF ('PKCS15-AppDF'), User PIN is not yet created, and AC type 'SC_AC_SYMBOLIC' cannot be resolved.
So, in the card profile, the macro '$PIN' cannot be used to define the ACLs of the application DF.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3967 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-31 20:26:45 +00:00
viktor.tarasov b83ed7ed71 sertcos: both PINs are globals
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3965 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 17:41:05 +00:00
viktor.tarasov 19e9aaf635 pkcs15init: fix putting xPINs in cache
;when putting SOPIN into the global cache, use the path from the object info;
;sc_pkcs15init_create_pin() can be called to create PUK object;




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3964 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 17:40:03 +00:00
viktor.tarasov 742b0ea341 pkcs15init: one more fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3963 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 17:12:53 +00:00
viktor.tarasov 2bcd535284 pkcs15init: fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3962 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-29 17:08:26 +00:00
viktor.tarasov 90ba3c769d pkcs15init: card specific pkcs15init has to be ready for pin_reference = -1
Starting from r3946, the reference of PIN, instantiated from profile, is not overwritten by 0 in sc_pkcs15init_create_pin().
http://www.opensc-project.org/opensc/browser/trunk/src/pkcs15init/pkcs15-lib.c?rev=3946#L1064

So, card specific pkcs15init has to be ready for the pin_reference = -1. 




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3960 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 16:44:02 +00:00
viktor.tarasov 630eb213f4 miocos: migration to New API
Miocos card owners are heartly invited to test this revision.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3956 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 12:46:36 +00:00
viktor.tarasov 031bfc7a07 pkcs11: parametrize disabling of the slot for PUK
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3953 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-28 12:14:48 +00:00
viktor.tarasov 660fdea68a profile: for PIN flags use rather 'define' macro
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3951 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 18:18:10 +00:00
viktor.tarasov f2d3618ff6 oberthur: finalize migration to the NEW API
no more 'init_app'.

- Oberthur unblock style is the only one (local SOPIN is used as PUK);
- user PIN and PUK should be everywhere defined as local;
- SOPIN is always global.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3950 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 18:07:14 +00:00
viktor.tarasov 38e1144c1e pkcs15init: pkcs15 PinObject for PUK
When creating PIN, if 'puk_id' is defined in 'struct sc_pkcs15init_pinargs', 
the pkcs15 PinObject for PUK will be created. 

For a moment, PinObject is not created for SO PUK.







git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3949 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:53:51 +00:00
viktor.tarasov 8aa2128423 pkcs15-init tool: don't ask for PUK value when creating PIN with 'unblock-disabled' in flags
- prepare pkcs15-init tool for creating a pkcs15 PinObject for PUK.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3948 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:38:43 +00:00
viktor.tarasov 42ad65e8d2 sorry, fix
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3947 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:08:04 +00:00
viktor.tarasov 7f0abe80bb libopensc pkcs15: path is optional for PinAttributes of PinObject
- for 'global' PINs path in not encoded into the AODF;
- when selecting pin_reference, start from value defined in profile.




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3946 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-27 17:03:04 +00:00
viktor.tarasov 5cd5728c0e libopensc: search pkcs15 objects: accept NULL value for the output argument
So that, the dummy object for the 'search pkcs15 object' calls is not neccessary. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3942 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-26 12:59:08 +00:00
viktor.tarasov bc140126e9 pkcs15init: in select_object_path() look for the template also outside the 'key-domain'.
To use New API with the cards that do not have 'key-domain' in their profile,
when setting object data path,
the object template has to be also looked for outside the 'key-domain'.

;migrate Oberthur to the New API;
;use macros SC_CALLED, SC_TEST_.., SC_RETURN in pkcs15-lib.c




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3940 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-25 16:42:22 +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 e191142d04 pkcs15init: remove slots, according to r3931
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3932 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:26:14 +00:00
martin cd9e666926 SC_ERROR_MEMORY_FAILURE signals EEPROM failures on card. Failures to allocate memory on host result in SC_ERROR_OUT_OF_MEMORY.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3927 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 12:38:34 +00:00
s f2bc83b138 fix:
CK_MECHANISM rsa_mech = { CKM_RSA_PKCS_KEY_PAIR_GEN, NULL, 0 };
C_GenerateKeyPair(..., &rsa_mech, ..., ..., ..., ..., ..., ...); -> ... -> sc_pkcs15init_store_public_key -> sc_pkcs15init_store_data -> select_object_path -> sc_pkcs15_get_objects: return 0 -> CKR_OK
($ pkcs15-tool --list-public-keys:
Public RSA Key [Public Key]
        ...
        Path        : 3f0050000200
)

CK_MECHANISM gost_mech = { CKM_GOSTR3410_KEY_PAIR_GEN, NULL, 0 };
C_GenerateKeyPair(..., &gost_mech, ..., ..., ..., ..., ..., ...); -> ... -> sc_pkcs15init_store_public_key -> sc_pkcs15init_store_data -> select_object_path -> sc_pkcs15_get_objects: return 0 -> CKR_OK
($ pkcs15-tool --list-public-keys:
Public RSA Key [Public Key]
        ...
        Path        : 3f0050000200

Public GOSTR3410 Key [Public Key]
        ...
        Path        : 3f0050000200
)



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3923 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-22 12:01:17 +00:00
viktor.tarasov 39a70345b9 pkcs15init profile: 'private key' as BSO is differenciated from the one as EF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3920 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-21 10:07:40 +00:00
viktor.tarasov 6fc954cbc6 pkcs15init: new profile type BSO
at the profile level the difference between EF and BSO is:
- BSO path is always the path of the host DF and do not indexated when template is instanciated;
- EF path is always ending with file-id that is always indexated  when template is instanciated.

New non-static 'sc_profile_get_file_instance' procedure to instanciate non-template entries.
In profile.c get_uint() accepts hexadecimals.
In CardOS profile (I venture to) increase the xDF sizes 
	and change ACL to permit the key re-importing.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3919 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-21 09:41:40 +00:00
viktor.tarasov 54ee99d486 pkcs15init: use pinpad
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3917 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-17 21:08:13 +00:00
viktor.tarasov f205d48258 pkcs15init: dissociate object file-id and object ID;
;use macros SC_CALLED, SC_RETURN and SC_TEST_RET;
;change debug level in debug macros;

For a new pkcs15 object of a given type the file index is chosen as a first value in the range from 'file-id' to 'max-id', 
excluding the values that are already assigned to the file indexes of the existing pkcs15 objects of the same type.

'file-id' is defined in the template ('key-domain') of the card profile ;
'max-id' is 'file-id' + hard coded value 0xFE .



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3916 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-16 21:52:47 +00:00
viktor.tarasov 45b95583d0 profile sanity check: in template check for minimal difference between file-ids
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3915 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-16 20:55:45 +00:00
viktor.tarasov 1a7793c77c pkcs15init: possible error of 'find_object_by_id' should not be ignored
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3914 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 15:29:16 +00:00
viktor.tarasov bb5b8d0493 oberthur: increase sizes of xDF files; source tabified
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3913 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-15 14:08:54 +00:00
viktor.tarasov 0518ed57c5 no more 'reuse pkcs15 object'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3904 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-10 20:33:32 +00:00
aj f0484968a9 merge changes 0.11.11 -> 0.11.12
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3899 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-18 13:33:03 +00:00
s 9dff2deae1 fix: return CKR_USER_NOT_LOGGED_IN (now CKR_GENERAL_ERROR) from C_GenerateKeyPair for the case where there was no call C_Login
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3889 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-09 13:59:03 +00:00
aj 93a2b39028 Updated westcos driver by François Leblanc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3877 c6295689-39f2-0310-b995-f0e70906c6a9
2009-12-03 07:10:24 +00:00
s 56dd3ec0ea Modification Rutoken S binary interfaces by Aktiv Co. (OpenSC+Rutoken S driver for Windows works now)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3865 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 16:38:02 +00:00
s b372290e72 correct SEC_ATTR_SIZE name (add prefix)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3863 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-23 11:41:23 +00:00
s 5320ca6fd1 Corrected GOSTR3410 public key structure
Working now with GOST R 34.10:
$ pkcs15-init --store-private-key key --key-usage sign,decrypt --auth-id 2 --id 1 --pin "12345678"
$ pkcs15-init --store-certificate my_cert --id 1 --pin "12345678"

But have problem: no CKA_GOSTR3410_PARAMS by retrieve pub_key from certificate, if pub_key object was removed (see parse_x509_cert, asn1_decode_gostr3410_params)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3859 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-19 15:41:03 +00:00
martin b34a1a6128 Remove unused variables & fix line endings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3834 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:19:46 +00:00
martin e5b644c2f7 Remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3833 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 11:15:00 +00:00
martin 3ea5bb7987 Merge [3804:3822/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3824 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-13 09:45:21 +00:00
martin 450e1fc5ae Merge [3794:3803/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3804 c6295689-39f2-0310-b995-f0e70906c6a9
2009-11-05 18:27:56 +00:00
martin 30ab50600b Merged [3783:3794/trunk]
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3795 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-25 20:22:11 +00:00
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 ea37069272 Merged r3749:3758 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3759 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-05 20:10:07 +00:00
martin 9da39d8462 Merged r3719:3749 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3750 c6295689-39f2-0310-b995-f0e70906c6a9
2009-10-03 07:48:28 +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 d3201511c7 r3717:3719 from trunk
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3720 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-12 11:46:00 +00:00
aj 5f185e3079 Weitao Sun: no one can create more than 15 files
under 5015 df. I increase it from 15 to 48, and all are OK.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3713 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-23 08:56:41 +00:00
aj 0c2fe83c3b Aktiv Co./Aleksey Samsonov:
fix a bug in rutoken driver.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3711 c6295689-39f2-0310-b995-f0e70906c6a9
2009-07-22 12:24:33 +00:00
aj 7931ded481 Add new rutoken_ecp driver by Aktiv Co. / Aleksey Samsonov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3696 c6295689-39f2-0310-b995-f0e70906c6a9
2009-06-24 15:26:37 +00:00
aj 4670238556 Entersafe changes by Weitao Sun:
1.Card type FTCOS/PK-01C added. (new)
2.Limit pin length in range [4,16). (bug fix)
3.Can not unblock PIN. (bug fix)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3674 c6295689-39f2-0310-b995-f0e70906c6a9
2009-04-02 10:32:02 +00:00
aj 50f9ef865b check if len or p is 0/NULL and return.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3661 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-06 09:30:54 +00:00
aj 54a35a2f4f fix typo.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3660 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-06 09:26:41 +00:00
aj 3347ededf6 Improve this function even more.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3659 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-05 18:37:55 +00:00
aj aadf09d1de resolve an "undefined code" situation.
the old code was undefined, but ok (variables where never used
again in the "goto error" case). but the new code should
be clearer on this.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3658 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-05 15:28:17 +00:00
aj 9dd1407703 change base id so it does not overlap with the next one.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3657 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-05 15:15:24 +00:00
alonbl 34a75de5d7 Rutoken updates
By Aktiv Co. Aleksey Samsonov

- use PKCS#15 (not builtin PKCS#15 emulator)
- rutoken.profile (add privdata)
- correct using ACL
- correct erase procedure



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3640 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-28 12:10:13 +00:00
alonbl 2b41afbb3f Set hardcoded default for profile_dir
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3624 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-16 21:27:46 +00:00
aj 8a6bc59e66 Create new type "privdata" in all profiles with different
ACL settings, and check C_CreateObject parameter CKA_PRIVATE aka
pkcs15_create_data args.auth_id variable, aka sc_pkcs15init_new_object
object->flags & SC_PKCS15_CO_FLAG_PRIVATE to decide if "data" or "privdata"
profile needs to be used.

Tested with cryptoflex 32k and opensc-explorer, now I no longer can
"get" the data object file stored with "--private".


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3605 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-28 16:07:51 +00:00
aj 27d00f9265 Add new entersafe driver for ePass 3000 tokens.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3556 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-20 05:41:20 +00:00
aj 64fd479aa5 Chaskiel Grundman:
Nowhere in pkcs15init/pkcs15-cardos.c is the user pin ever 
requested or presented to the card. 
Since the update acl for the key object uses the user pin, the GENERATE 
KEY operation fails when it isn't logged in.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3537 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-21 14:35:21 +00:00
ludovic.rousseau fb7c59e7aa use #ifdef instead of #if
pkcs15-cardos.c:547:5: warning: "SET_SM_BYTES" is not defined
pkcs15-cardos.c:585:5: warning: "SET_SM_BYTES" is not defined


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3517 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:13:19 +00:00
alonbl 6c740b907e More MSVC fixups by Douglas E. Engert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3503 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 06:09:00 +00:00
ludovic.rousseau 932cc41f30 convert C++ comment in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3501 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:45:28 +00:00
ludovic.rousseau 7201fc7ace convert a C++ comment in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3500 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:44:07 +00:00
ludovic.rousseau 63b55ea0aa rutoken_new_file(): initialize sec_attr
pkcs15-rutoken.c:372: warning: 'sec_attr' may be used uninitialized in
this function


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3499 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:42:22 +00:00
alonbl 8d7bce4de2 ruToken fixups
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011057.html

By Aktiv Co. Aleksey Samsonov



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3478 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-18 14:08:23 +00:00
alonbl 865f6e9c70 More fixups to maintainer-clean
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3471 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-11 12:52:46 +00:00
alonbl d84077749b Distribute autoconf generated files for MSVC build
Construct resource files and winconfig.h using autoconf
substitutions.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3468 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-08 18:36:42 +00:00
alonbl 54c1c735f3 Attached are the latest mode to OpenSC svn 3462 to use the Makefile.mak
files to build on Windows.

I got rutoken to compile, and took out the #ifdef's I had in last week.
The rutoken programmer declared some variables in the middle of a block
rather then having all the declare statements at the beginning of a block
as is normally done in C. The Microsoft compile treats this as an error.
(Actual many errors.)

The makedef.pl is no longer needed, as the exports files can be used.
Note that in the original Makefile.mak files only opensc.def and
pkcs15init.def were created.

winconfig.h has a number of changes. As discussed last week this could
be created by autoconf. I also noted that the Active State Perl that
was required for the makedef.pl has a psed command that could be used
like sed to update winconfig.h.  I did not attempt to do this.



  win32/Make.rules.mak - Use ENABLE_OPENSSL and ENABLE_ZLIB

  src/tools/Makefile.mak - add the rutoken.tool.exe

  src/tools/eidenv.c - use PACKAGE_VERSION

  src/pkcs11/Makefile.mak - reorder the objest to match the list in the
           Makefile.am. Makes it easier to read.

  src/include/winconfig.h - The windows version of the config.h
           Changes based on discussions on the list last week.

  src/common/Makefile.mak - renamed modules.

  src/pkcs15init/Makefile.mak - reordered, and added back the rutoken modules
           replaced the use of makdef.pl to sue the exports file.

  src/scconf/Makefile.mak - reordered objects.

  src/libopensc/card-rutoken.c -
           error. Moved the declares to the beginning of blocks.

  src/libopensc/Makefile.mak - reorder names, and add rutoken.
           Use the libopensc.exports file.

  src/libopensc/pkcs15-prkey-rutoken.c - more moving of declare statements.

By Douglas E. Engert

http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011011.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3464 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 19:42:43 +00:00
alonbl 6e65efb257 Some more build cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3462 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 20:38:20 +00:00
alonbl 87db3c96c2 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3450 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 19:04:33 +00:00
alonbl 39abe22798 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3449 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 17:08:17 +00:00
ludovic.rousseau 7e30721378 use $(srcdir) when needed to be able to build in separate build
directories using: cd foobar ; ../configure srcdir=..

Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010959.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3445 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 12:43:26 +00:00
alonbl 80a16f686d ruToken cleanups
Move constants out of standard files.
Create ruToken specific interface.
Update symbols.

Thread at:
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010917.html

Cleanup of:
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3439 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-26 06:24:37 +00:00
alonbl f49f765ac6 Fix libtool versioning issues
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3421 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-15 11:05:26 +00:00
alonbl 8ac87f1b1e Remove useless comments
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3414 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-09 21:24:24 +00:00
alonbl 440ea331db Windows DLL suffix is actually delta
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3410 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-09 12:01:22 +00:00
alonbl 0a809dd5cb Complete rewrite of OpenSC build system.
1.  Build system now supports MinGW (Windows) compilation using msys and cross compilation.
2.  Ability to explicitly disable and enable dependencies of the package.
3.  openct, pcsc and nsplugins features are disabled by default.
4.  Modified pcsc driver to use pcsc dynamically, no compile time dependency is required.
5.  --enable-pcsc-lite configuration option renamed to --enable-pcsc.
6.  Install opensc.conf file (as opensc.conf.new if opensc.conf exists).
7.  Add--enable-doc configuration option, allow installing documentation into target.
8.  Add --disable-man configuration option, allow msys mingw32 users to
    build from svn without extra dependencies.
9.  Add export files to each library in order to export only required symbols.
    Windows native build may use these files instead of scanning objects' symbols.
10. Add opensc-tool --info to display some general information about the build.
11. Create compatibility library to be linked against library instread of recompiling the
    same source files in different places.
12. Add different win32 version resource to each class of outputs.
13. Make xsl-stylesheets location selectable.
14. Some win32 fixups.
15. Some warning fixups.
16. Many other autoconf/automake cleanups.

Alon Bar-Lev

svn diff -r 3315:3399 https://www.opensc-project.org/svn/opensc/branches/alonbl/mingw

_M   .
D    configure.in
_M   src
_M   src/openssh
M    src/openssh/Makefile.am
_M   src/tools
M    src/tools/rutoken-tool.c
M    src/tools/opensc-tool.c
M    src/tools/cardos-info.c
M    src/tools/pkcs15-crypt.c
M    src/tools/pkcs15-init.c
M    src/tools/piv-tool.c
M    src/tools/netkey-tool.c
M    src/tools/eidenv.c
M    src/tools/cryptoflex-tool.c
M    src/tools/util.c
M    src/tools/pkcs11-tool.c
M    src/tools/pkcs15-tool.c
M    src/tools/util.h
M    src/tools/opensc-explorer.c
M    src/tools/Makefile.am
_M   src/pkcs11
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-display.c
M    src/pkcs11/pkcs11-object.c
A    src/pkcs11/opensc-pkcs11.exports
M    src/pkcs11/sc-pkcs11.h
M    src/pkcs11/pkcs11-spy.c
M    src/pkcs11/openssl.c
M    src/pkcs11/Makefile.am
A    src/pkcs11/pkcs11-spy.exports
_M   src/tests
_M   src/tests/regression
M    src/tests/regression/Makefile.am
M    src/tests/sc-test.c
M    src/tests/pintest.c
M    src/tests/Makefile.am
_M   src/include
_M   src/include/opensc
M    src/include/opensc/Makefile.am
A    src/include/opensc/svnignore
M    src/include/Makefile.am
_M   src/signer
_M   src/signer/npinclude
M    src/signer/npinclude/Makefile.am
M    src/signer/Makefile.am
A    src/signer/signer.exports
_M   src/common
A    src/common/compat_dummy.c
D    src/common/getopt.txt
D    src/common/strlcpy.c
D    src/common/LICENSE
A    src/common/compat_getopt.txt
A    src/common/compat_strlcpy.c
A    src/common/LICENSE.compat_getopt
A    src/common/compat_getopt.c
D    src/common/strlcpy.h
D    src/common/ChangeLog
D    src/common/getpass.c
D    src/common/my_getopt.c
A    src/common/compat_strlcpy.h
A    src/common/compat_getpass.c
A    src/common/compat_getopt.h
A    src/common/ChangeLog.compat_getopt
D    src/common/README.strlcpy
D    src/common/my_getopt.h
A    src/common/compat_getpass.h
A    src/common/README.compat_strlcpy
D    src/common/strlcpy.3
A    src/common/README.compat_getopt
D    src/common/getopt.3
D    src/common/README.my_getopt
A    src/common/compat_strlcpy.3
A    src/common/compat_getopt.3
M    src/common/Makefile.am
M    src/Makefile.am
_M   src/pkcs15init
M    src/pkcs15init/pkcs15-oberthur.c
M    src/pkcs15init/profile.c
M    src/pkcs15init/pkcs15-lib.c
M    src/pkcs15init/pkcs15-rutoken.c
A    src/pkcs15init/pkcs15init.exports
M    src/pkcs15init/pkcs15-gpk.c
M    src/pkcs15init/Makefile.am
_M   src/scconf
M    src/scconf/Makefile.am
M    src/scconf/parse.c
A    src/scconf/scconf.exports
_M   src/libopensc
M    src/libopensc/card-rutoken.c
M    src/libopensc/compression.c
M    src/libopensc/sc.c
M    src/libopensc/card-piv.c
M    src/libopensc/pkcs15-openpgp.c
M    src/libopensc/pkcs15-postecert.c
M    src/libopensc/pkcs15-tcos.c
M    src/libopensc/opensc-config.in
M    src/libopensc/reader-pcsc.c
A    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
A    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-infocamere.c
M    src/libopensc/internal.h
M    src/libopensc/pkcs15-actalis.c
M    src/libopensc/pkcs15-starcert.c
M    src/libopensc/card-oberthur.c
M    src/libopensc/pkcs15-atrust-acos.c
M    src/libopensc/p15card-helper.c
D    src/libopensc/part10.h
M    src/libopensc/ui.c
M    src/libopensc/card-gpk.c
M    src/libopensc/pkcs15-wrap.c
M    src/libopensc/pkcs15-gemsafeGPK.c
M    src/libopensc/log.c
M    src/libopensc/pkcs15-esteid.c
M    src/libopensc/pkcs15-prkey-rutoken.c
M    src/libopensc/log.h
M    src/libopensc/Makefile.am
M    src/libopensc/reader-openct.c
_M   aclocal
M    aclocal/Makefile.am
_M   win32
M    win32/Makefile.am
A    win32/versioninfo.rc.in
A    win32/ltrc.inc
A    configure.ac
_M   doc
_M   doc/tools
M    doc/tools/pkcs15-profile.xml
D    doc/changelog.sh
D    doc/export-wiki.xsl
_M   doc/api
_M   doc/api/file
M    doc/api/man.xsl
_M   doc/api/asn1
_M   doc/api/apps
_M   doc/api/init
_M   doc/api/types
_M   doc/api/card
M    doc/api/html.xsl
_M   doc/api/misc
_M   doc/api/util
M    doc/Makefile.am
D    doc/export-wiki.sh
AM   doc/nonpersistent
A    doc/nonpersistent/export-wiki.xsl
A    doc/nonpersistent/Makefile.am
A    doc/nonpersistent/export-wiki.sh
A    doc/nonpersistent/svn2cl.xsl
D    doc/generate-man.sh
D    doc/svn2cl.xsl
M    Makefile.am
A    svnignore
_M   etc
M    etc/opensc.conf.in
M    etc/Makefile.am
D    man
_M   solaris
M    solaris/Makefile



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00
nils 5a04a103fb do not use memory quota
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3392 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-25 20:36:59 +00:00
nils c46c366f1d check tpin before trying to delete application
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3391 c6295689-39f2-0310-b995-f0e70906c6a9
2008-02-25 19:47:11 +00:00
ludovic.rousseau 156f368f9d add two missing files for ruToken support
Thanks to Ian Young for the bug report


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3312 c6295689-39f2-0310-b995-f0e70906c6a9
2008-01-04 08:57:12 +00:00
ludovic.rousseau bf9d6beaac new patch for ruToken support
Thanks to Andrew V. Stepanov
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010631.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3310 c6295689-39f2-0310-b995-f0e70906c6a9
2008-01-03 08:59:14 +00:00
jps 27257f2278 support for Siemens CardOS V4.2C
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3306 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-19 09:58:29 +00:00
ludovic.rousseau 0ecc294ed8 add support of ruToken
Thanks to Andrew V. Stepanov for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3304 c6295689-39f2-0310-b995-f0e70906c6a9
2007-12-17 13:39:20 +00:00
nils 5cdd93982d the so-puk is optional
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3276 c6295689-39f2-0310-b995-f0e70906c6a9
2007-09-28 19:10:39 +00:00
aj a7912a2426 add information about cardos 4.2b - latest cardos update.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3237 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-08 20:06:53 +00:00
ludovic.rousseau f0cbecfeb1 AM_LDFLAGS is not used in libpkcs15init_la_LDFLAGS so explicitly use it
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3235 c6295689-39f2-0310-b995-f0e70906c6a9
2007-08-02 13:53:40 +00:00
aj d7bde1e9e0 inline is something the compiler can decide on his own.
static is a good hint to the compiler for that - the function isn't used
outside of this file. 
"static inline" is not valid, visual studio doesn't compile that.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3209 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-09 14:17:43 +00:00
vtarasov 174802aa56 Enables the second PIN (one-time PIN) defined for the same application DF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3206 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-04 14:25:39 +00:00
nils 8770859315 add support for asepcos
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3200 c6295689-39f2-0310-b995-f0e70906c6a9
2007-07-03 20:44:34 +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 4cc1a50a49 Alessandro Premoli:
add support for reading, writing and deleting private (require cache_pins) and
public data objects in PKCS11. updated the pkcs11-tool and fixed a few
bugs in the code. Tested on an aladdin etoken.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3176 c6295689-39f2-0310-b995-f0e70906c6a9
2007-06-21 09:37:18 +00:00
nils 1645684fd5 increase size of pin buffer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3153 c6295689-39f2-0310-b995-f0e70906c6a9
2007-04-23 19:23:51 +00:00
vtarasov 7ce5aa3b13 change inappropriate oberthur profile
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3121 c6295689-39f2-0310-b995-f0e70906c6a9
2007-03-05 17:30:35 +00:00
ludovic.rousseau 45f5fcea0e comment out static and unused functions (sc_pkcs15init_read_unusedspace,
sc_pkcs15init_update_unusedspace, merge_paths,
sc_pkcs15init_add_unusedspace and sc_pkcs15init_remove_unusedspace)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3118 c6295689-39f2-0310-b995-f0e70906c6a9
2007-02-06 14:29:45 +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
nils 139ff4c39c check key size, set so-pin ref
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3112 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-19 21:08:20 +00:00
vtarasov 02215882f3 prepare Oberthur card support for secure messaging
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3095 c6295689-39f2-0310-b995-f0e70906c6a9
2007-01-02 10:06:02 +00:00
aj 9287da54da convert to utf-8.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3088 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-19 21:34:00 +00:00
aj a157eebec5 apcos driver is not yet commited.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3079 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 21:34:49 +00:00
nils 5977ce4f21 pad only if necessary
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3078 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 11:23:42 +00:00
nils c3fbf281b3 remove comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3077 c6295689-39f2-0310-b995-f0e70906c6a9
2006-12-18 11:22:51 +00:00
vtarasov 71aab076aa When forgetting PIN set to 'null' the corresponding named_pin's entry
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3048 c6295689-39f2-0310-b995-f0e70906c6a9
2006-11-02 09:19:17 +00:00
nils aec987df38 build fixes for win; patch supplied by Douglas E. Engert <deengert@anl.gov>
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3005 c6295689-39f2-0310-b995-f0e70906c6a9
2006-08-03 21:05:59 +00:00
nils 5efe5b3603 bugfix: copy the first n characters (if possible)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2999 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-14 08:18:57 +00:00
nils 886e63c60e cardos v4.3b support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2998 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-13 21:01:46 +00:00
ludovic.rousseau 126593aa01 - use strlcpy() instead of strncpy() to always have a terminating
NUL-byte

- use sizeof(field) instead of SC_PKCS15_MAX_LABEL_SIZE-1 or equivalent as
  the 3rd argument of strlcpy()


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2993 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-12 08:12:38 +00:00
ludovic.rousseau 5e922b5325 add -I$(top_srcdir)/src/common so that strlcpy.h is found
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2991 c6295689-39f2-0310-b995-f0e70906c6a9
2006-07-12 08:06:59 +00:00
aj 746dc392d8 Fix makefile: add muscle files.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2969 c6295689-39f2-0310-b995-f0e70906c6a9
2006-06-08 08:12:50 +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
aj 65a2cabffc make sure result is null-terminated.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2933 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:23:15 +00:00
aj 6cfbd9d4f9 at least partialy close memory leak.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2932 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:22:25 +00:00
aj 45742fc5d0 check df before dereferencing it.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2931 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:21:16 +00:00
aj ab0066b0d7 fix printf size_t problem with "%lu" and (unsigned long) cast.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2923 c6295689-39f2-0310-b995-f0e70906c6a9
2006-05-01 10:02:50 +00:00
aj 3066830238 close memory leaks.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2899 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-26 10:01:06 +00:00
sth 435d8ac62b There doesn't seem to be a need to leave the certs (and CDF) unprotected. In case there do are problems, please revert this change
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2884 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-06 18:41:12 +00:00
sth 9409c278df Set the user pin reference when writing a cert. If not, there's a problem with the onepin profile option: the CDF (and certs) will be created with NONE ACs instead of ACs that refer to the user PIN
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2883 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-06 18:38:20 +00:00
sth 95163a2678 protect certs by default
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2882 c6295689-39f2-0310-b995-f0e70906c6a9
2006-04-06 18:35:01 +00:00
ludovic.rousseau 2b8a2f4d90 sc_pkcs15_parse_tokeninfo() and sc_pkcs15_encode_tokeninfo() now use a
(sc_pkcs15_tokeninfo_t *) instead of struct (sc_pkcs15_card *)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2872 c6295689-39f2-0310-b995-f0e70906c6a9
2006-03-07 07:22:58 +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
nils a2194b9803 fix memory leak
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2837 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-12 17:07:31 +00:00
nils 5c3aed1189 - remove dependence on a specific threading library
- add two new structures: sc_thread_context_t which let
  the user specify the mutex functions to use and
  sc_context_param_t to specify parameters for the sc_context_t
  creation (including mutex functions) using sc_create_context()
- add new function sc_context_create()  
- remove timestamp code from libopensc


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2829 c6295689-39f2-0310-b995-f0e70906c6a9
2006-02-01 22:59:42 +00:00
aj 2cc82fe774 rename lower level function, fix typo.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2826 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-23 22:02:07 +00:00
aj f0c9f049a7 big rename etoken -> cardos, part II.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2825 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-23 21:48:08 +00:00
nils 41ee07a708 increase size for bigger keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2816 c6295689-39f2-0310-b995-f0e70906c6a9
2006-01-21 11:53:30 +00:00