Commit Graph

4351 Commits

Author SHA1 Message Date
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 19343c77e2 Remove dead code
scconf.c:195:2: warning: Value stored to 'ret' is never read
        ret = scconf_put_str(block, option, !value ? "false" : "true");
        ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
scconf.c:585:3: warning: Value stored to 'r' is never read
                r = 0;
                ^   ~
scconf.c:711:3: warning: Value stored to 'r' is never read
                r = 0;
                ^   ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5139 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:25:08 +00:00
ludovic.rousseau a8da1aa886 Fix compiler warning
card-piv.c:2014:7: warning: unused variable 'outp' [-Wunused-variable]
        u8 * outp = out;
             ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5138 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:47:09 +00:00
ludovic.rousseau 63c293e963 Fix a compiler warning
opensc-explorer.c:1440:22: warning: conversion specifies type 'unsigned int' but
      the argument has type 'size_t' (aka 'unsigned long') [-Wformat]
                printf("expecting %u, got only %d bytes.\n", len, r);
                                  ~^                         ~~~
                                  %lu


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5137 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:44:56 +00:00
ludovic.rousseau 1b192154d0 Fix compiler warning
pkcs15-westcos.c:247:8: warning: initializing 'char *' with an expression of
      type 'char const [8]' discards qualifiers
        char *name = "WESTCOS";
              ^      ~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5136 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:42:49 +00:00
ludovic.rousseau b3aee43e96 Fix a bug. read(2) returns a signed value. read(2) errors were not detected in
the previous code.

card-piv.c:833:10: warning: comparison of unsigned expression < 0 is always
      false [-Wsign-compare]
        if (len < 0) {
            ~~~ ^ ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5135 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:34:29 +00:00
ludovic.rousseau 6ccb540185 Fix compiler warning
ctx.c:56:1: warning: control may reach end of non-void function [-Wreturn-type]
}
^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5134 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:20:43 +00:00
ludovic.rousseau 4459b3df6c Fix compiler warnings
sc.c:406:39: warning: missing field 'usage' initializer
      [-Wmissing-field-initializers]
                SC_AC_NEVER, SC_AC_KEY_REF_NONE, {{0}}, NULL
                                                    ^
sc.c:409:38: warning: missing field 'usage' initializer
      [-Wmissing-field-initializers]
                SC_AC_NONE, SC_AC_KEY_REF_NONE, {{0}}, NULL
                                                   ^
sc.c:412:41: warning: missing field 'usage' initializer
      [-Wmissing-field-initializers]
                SC_AC_UNKNOWN, SC_AC_KEY_REF_NONE, {{0}}, NULL
                                                      ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5133 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:16:54 +00:00
ludovic.rousseau 9811426bc5 Fix compiled warnings
card-authentic.c:1770:1: warning: no previous prototype for function
      'authentic_manage_sdo_encode_prvkey' [-Wmissing-prototypes]
authentic_manage_sdo_encode_prvkey(struct sc_card *card, struct ...
^
card-authentic.c:1832:1: warning: no previous prototype for function
      'authentic_manage_sdo_encode' [-Wmissing-prototypes]
authentic_manage_sdo_encode(struct sc_card *card, struct ...
^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5132 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:11:18 +00:00
ludovic.rousseau e2bd5b1cc6 Fix compiler warning
pkcs15-pubkey.c:787:5: warning: no previous prototype for function
      'sc_pkcs15_read_der_file' [-Wmissing-prototypes]
int sc_pkcs15_read_der_file(sc_context_t *ctx, char * filename,
    ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5131 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 17:05:33 +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
ludovic.rousseau 689ac169d4 Fix compiler warning
cards.h:215: warning: function declaration isn’t a prototype


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5128 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 16:37:11 +00:00
dengert 1adcc611c2 Add _sc_delete_reader to allow for a single reader to be
deleted from the ctx->readers list. This will be used 
by cardmod and for consistence by sc_release_context.



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

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5126 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-01 17:32:03 +00:00
andre 13dd004198 pkcs15.c: Check info->label for NULL before calling strdup(). Avoids segmentation fault in the case where info->label == NULL. Fixes #318.
Thanks lmamane.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5125 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-27 22:18:16 +00:00
martin 03be594243 core: Fix PIN caching for PIN codes protecting user consent keys, broken in r4048
Such PIN codes were erroneously cached in memory, even though not used with revalidation..
User consent relates to private keys, not PIN codes.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5124 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-27 14:25:35 +00:00
martin 9afbc55883 pkcs15-tool: check for remaining PIN tries before changing a PIN.
If the card supports it, changing a blocked PIN will result in an error before PIN entry, not when the card re-states that the PIN is already blocked.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5123 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-27 14:25:30 +00:00
ep 1ed93af035 Amend and update register of IC manufacturers for itacns
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5122 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-27 08:43:32 +00:00
martin e033245ad1 MacInstaller: track Tokend branch in Git based on OpenSC release.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5121 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-24 10:59:20 +00:00
martin 2b04b0c328 libopensc: calling sc_context_create without parameters is not allowed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5120 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-22 12:53:09 +00:00
martin dac7b9f750 MiniDriver: MS Visual Studio is identified by _MSC_VER not VISUAL_STUDIO
http://predef.sourceforge.net/precomp.html#sec35

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5119 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-20 13:02:50 +00:00
martin 0c263bd234 MiniDriver: change cardmod.h include style to help building with compilers which don't have cardmod.h registered in the search path.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5118 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-20 12:58:39 +00:00
martin 8c51f42121 MiniDriver: embed the manifest into minidriver DLL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5117 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-20 12:58:30 +00:00
martin c44ad2c028 MiniDriver: Create cardmod DLL with nmake as well.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5116 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-19 15:06:29 +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 6ce28a6adb libopensc: initialize 'sc_ef_atr' type variable
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5114 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-19 14:22:57 +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
martin bc5ddb7d95 EstonianEid: add new 2011 card ATR (18.01.2011+)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5112 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-19 08:37:07 +00:00
vtarasov e7790508f6 pkcs15: when setting object data's path, use, if available, the AID from 'DiscretionaryDataObject'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5111 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 16:31:41 +00:00
vtarasov 47f997983e pkcs15: simplify PIN's path assignement
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5110 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 16:17:15 +00:00
vtarasov 04f9c46d15 pkcs15-tool: do not print empty path, print path also when it only has 'aid' member
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5109 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 16:06:29 +00:00
vtarasov 41c0090321 pkcs15: redesign sc_pkcs15_make_absolute_path() ...
- do nothing if child has 'aid';
- child inherit the parents's 'aid' if this one exists;
- child inherit parents's path of type 'DF NAME' as  'aid';
- return if child path is zero length;

- finaly concatenate parent and child paths.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5108 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 16:02:09 +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
andre 5405d74d19 opensc.conf.in: clean up white spaces
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5105 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-18 04:43:32 +00:00
andre 752af86f2b pkcs15-pin.c: fixes segmentation fault in the case where p15card->app == NULL
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5104 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 21:09:48 +00:00
vtarasov 3efe35d246 libopensc: avoid the using of not completely initialized 'sc_path' variables
to be continued...


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5103 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 19:00:52 +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