Commit Graph

3911 Commits

Author SHA1 Message Date
ludovic.rousseau 9afa56f740 card-piv.c:564: warning: unused variable ‘buf_len’
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5183 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:37:51 +00:00
ludovic.rousseau fe31597e4d Remove dead code
p15card-helper.c:263:22: warning: Although the value stored to 'r' is used in
      the enclosing expression, the value is never actually read from 'r'
  ...!= (r = sc_pkcs15emu_add_x509_cert(p15card, &cert_obj, &cert_info))) {
         ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p15card-helper.c:237:22: warning: Although the value stored to 'r' is used in
      the enclosing expression, the value is never actually read from 'r'
  ...if(SC_SUCCESS != (r = sc_select_file(card, &cert_info.path, NULL))) {
                       ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
p15card-helper.c:224:3: warning: Value stored to 'r' is never read
                r = SC_SUCCESS;
                ^   ~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5182 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:17:57 +00:00
ludovic.rousseau fc40ad754c Remove dead code
pkcs15-oberthur.c:353:3: warning: Value stored to 'len' is never read
                len = sizeof(label) - 1;
                ^     ~~~~~~~~~~~~~~~~~
pkcs15-oberthur.c:587:3: warning: Value stored to 'sz' is never read
  ...sz = len > sizeof(key_obj.label) - 1 ? sizeof(key_obj.label) - 1 : len;
     ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15-oberthur.c:669:2: warning: Value stored to 'offs' is never read
        offs += 2 + len;
        ^       ~~~~~~~
pkcs15-oberthur.c:656:3: warning: Value stored to 'sz' is never read
  ...sz = len > sizeof(cobj.label) - 1 ? sizeof(cobj.label) - 1 : len;
     ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5181 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:14:19 +00:00
ludovic.rousseau 9c03435cc9 Remove dead code
pkcs15-westcos.c:198:3: warning: Value stored to 'usage' is never read
                usage =
                ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5180 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:12:14 +00:00
ludovic.rousseau 7789948e4d Remove dead code
pkcs15-tccardos.c:253:3: warning: Value stored to 'pinType' is never read
                pinType   = key_descr & TC_CARDOS_PIN_MASK;
                ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5179 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:11:03 +00:00
ludovic.rousseau f8fc900c20 Remove dead code
pkcs15-openpgp.c:110:2: warning: Value stored to 'length' is never read
        length = r;
        ^        ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5178 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:09:20 +00:00
ludovic.rousseau 7c81ad9aa3 Fix typo in error message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5177 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:08:13 +00:00
ludovic.rousseau 034cdb1151 Add missing checks for NULL before dereferencing
card-authentic.c:913:33: warning: Field access results in a dereference of a
      null pointer (loaded from variable 'apdus')
                rv = sc_check_sw(card, apdus->sw1, apdus->sw2);
                                       ~~~~~  ^
card-authentic.c:958:33: warning: Field access results in a dereference of a
      null pointer (loaded from variable 'apdus')
                rv = sc_check_sw(card, apdus->sw1, apdus->sw2);
                                       ~~~~~  ^
card-authentic.c:1001:33: warning: Field access results in a dereference of a
      null pointer (loaded from variable 'apdus')
                rv = sc_check_sw(card, apdus->sw1, apdus->sw2);
                                       ~~~~~  ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5176 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:07:52 +00:00
ludovic.rousseau 52251f931c Remove dead code
card-authentic.c:440:2: warning: Value stored to 'resp_len' is never read
        resp_len = sizeof(resp);
        ^          ~~~~~~~~~~~~
card-authentic.c:1053:4: warning: Value stored to 'acls' is never read
                        acls = acls_NEVER;
                        ^      ~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5175 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:02:42 +00:00
ludovic.rousseau 4d8fdd103c Remove dead code
card-ias.c:132:32: warning: Although the value stored to 'ins' is used in the
      enclosing expression, the value is never actually read from 'ins'
        r = len = pad = use_pin_pad = ins = p1 = 0;
                                      ^     ~~~~~~
card-ias.c:132:2: warning: Value stored to 'r' is never read
        r = len = pad = use_pin_pad = ins = p1 = 0;
        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
card-ias.c:366:2: warning: Value stored to 'ctx' is never read
        ctx = card->ctx;
        ^     ~~~~~~~~~
card-ias.c:361:6: warning: Although the value stored to 'pathlen' is used in the
      enclosing expression, the value is never actually read from 'pathlen'
        r = pathlen = stripped_len = offset = 0;
            ^         ~~~~~~~~~~~~~~~~~~~~~~~~~
card-ias.c:361:2: warning: Value stored to 'r' is never read
        r = pathlen = stripped_len = offset = 0;
        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
card-ias.c:361:31: warning: Although the value stored to 'offset' is used in the
      enclosing expression, the value is never actually read from 'offset'
        r = pathlen = stripped_len = offset = 0;
                                     ^        ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5174 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:01:21 +00:00
ludovic.rousseau 75ef203f27 Remove dead code
card-westcos.c:1066:4: warning: Value stored to 'r' is never read
                        r = SC_ERROR_INVALID_ARGUMENTS;
                        ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5173 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:58:40 +00:00
ludovic.rousseau 6473a883d4 Remove dead code
card-asepcos.c:446:19: warning: Value stored to 'p' during its initialization is
      never read
        u8     buf[64], *p = buf;
                         ^   ~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5172 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:57:51 +00:00
ludovic.rousseau d8cc0e41da Add a missing check for NULL before dereferencing
card-asepcos.c:312:52: warning: Dereference of null pointer
                r = asepcos_parse_sec_attr(card, *file, (*file)->s...
                                                                 ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5171 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:57:16 +00:00
ludovic.rousseau 8f68f4440d Remove dead code
card-piv.c:614:2: warning: Value stored to 'buf_end' is never read
        buf_end = rp + buf_len;
        ^         ~~~~~~~~~~~~
card-piv.c:1129:3: warning: Value stored to 'r' is never read
                r = 0;
                ^   ~
card-piv.c:1478:2: warning: Value stored to 'q' is never read
        q = rbuf;
        ^   ~~~~
card-piv.c:1628:2: warning: Value stored to 'q' is never read
        q = rbuf;
        ^   ~~~~
card-piv.c:2456:4: warning: Value stored to 'certobjlen' is never read
                        certobjlen = 0;
                        ^            ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5170 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:54:36 +00:00
ludovic.rousseau 8a1431a56d Remove dead code
card-atrust-acos.c:548:2: warning: Value stored to 'keyID' is never read
        keyID = env->key_ref[0];
        ^       ~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5169 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:51:48 +00:00
ludovic.rousseau 870a00cc8a Remove a useless test
If card is NULL we can't dereference card->ctx to log an error
We must assume card i snever NULL

card-oberthur.c:1537:3: warning: Field access results in a dereference of a null
      pointer (loaded from variable 'card')
  ...SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_INVALID_ARGUMENTS)...
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
card-oberthur.c:1537:24: note: instantiated from:
                SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, ...
                               ~~~~  ^
card-oberthur.c:2258:3: warning: Field access results in a dereference of a null
      pointer (loaded from variable 'card')
  ...SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, SC_ERROR_INVALID_ARGUMENTS)...
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
card-oberthur.c:2258:24: note: instantiated from:
                SC_FUNC_RETURN(card->ctx, SC_LOG_DEBUG_NORMAL, ...
                               ~~~~  ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5168 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:50:48 +00:00
ludovic.rousseau dd55567cf9 Remove dead code
card-oberthur.c:1539:2: warning: Value stored to 'prv' is never read
        prv = (struct auth_private_data *) card->drv_data;
        ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5167 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:45:17 +00:00
ludovic.rousseau 28b6b60870 Remove dead code
card-starcos.c:657:5: warning: Value stored to 'p' is never read
                        *p++ = file->record_length & 0xff;
                         ^~~
card-starcos.c:652:5: warning: Value stored to 'p' is never read
                        *p++ = file->record_length & 0xff;
                         ^~~
card-starcos.c:647:5: warning: Value stored to 'p' is never read
                        *p++ = file->size & 0xff;
                         ^~~
card-starcos.c:609:4: warning: Value stored to 'p' is never read
                *p++ = tmp;     /* SM ISF */
                 ^~~
card-starcos.c:572:4: warning: Value stored to 'p' is never read
                *p++ = tmp;
                 ^~~
card-starcos.c:1024:2: warning: Value stored to 'keyID' is never read
        keyID = env->key_ref[0];
        ^       ~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5166 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:44:14 +00:00
ludovic.rousseau 9d490bc273 Remove dead code
card-mcrd.c:1023:20: warning: Value stored to 'linep' during its initialization
      is never read
                char line[256], *linep = line;
                                 ^       ~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5165 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:41:24 +00:00
ludovic.rousseau 81581ff6e8 Remove dead code
card-cardos.c:304:3: warning: Value stored to 'r' is never read
                r = 256;
                ^   ~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5164 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:39:15 +00:00
ludovic.rousseau e46c4ccd1f Remove dead code
card-flex.c:358:2: warning: Value stored to 'left' is never read
        left = *p++;
        ^      ~~~~
card-flex.c:358:10: warning: Value stored to 'p' is never read
        left = *p++;
                ^~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5163 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:35:17 +00:00
ludovic.rousseau 451121f9b5 Remove dead code
card-setcos.c:506:3: warning: Value stored to 'bKeyNumber' is never read
                bKeyNumber = 0;
                ^            ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5162 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:34:04 +00:00
ludovic.rousseau a4e314e453 Add missing check code for NULL before dereferencing
reader-pcsc.c:1076:3: warning: Dereference of null pointer (loaded from variable
      'event_reader')
                *event_reader = NULL;
                ^~~~~~~~~~~~~
reader-pcsc.c:1098:3: warning: Dereference of null pointer (loaded from variable
      'event')
                *event = 0;
                ^~~~~~
reader-pcsc.c:1137:6: warning: Dereference of null pointer (loaded from variable
      'event_reader')
                                        *event_reader = ...
                                        ^~~~~~~~~~~~~
reader-pcsc.c:1112:6: warning: Dereference of null pointer (loaded from variable
      'event_reader')
                                        *event_reader = NULL;
                                        ^~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5161 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:32:28 +00:00
ludovic.rousseau 67d0a41ed2 Remove dead code
muscle.c:417:2: warning: Value stored to 'ptr' is never read
        ptr += newPinLength;
        ^      ~~~~~~~~~~~~
muscle.c:918:2: warning: Value stored to 'inPtr' is never read
        inPtr += toSend;
        ^        ~~~~~~
muscle.c:917:2: warning: Value stored to 'left' is never read
        left -= toSend;
        ^       ~~~~~~
muscle.c:1012:26: warning: Value stored to 'p' is never read
        ushort2bebytes(p, use); p+=2;   
                                ^  ~



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5160 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:18:34 +00:00
ludovic.rousseau ab589d7c99 Remove dead code
pkcs15-gemsafeV1.c:262:5: warning: Value stored to 'endptr' is never read
    endptr = (char *)(apdu.resp + apdu.resplen);
    ^        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5159 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:16:10 +00:00
ludovic.rousseau 3da2a84b0d Remove dead code
pkcs15.c:1033:3: warning: Value stored to 'r' is never read
                r = sc_pkcs15_parse_df(p15card, df);
                ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pkcs15.c:1677:3: warning: Value stored to 'obj_len' is never read
                obj_len = p - oldp;
                ^         ~~~~~~~~
pkcs15.c:1948:4: warning: Value stored to 'r' is never read
                        r = len;
                        ^   ~~~
pkcs15.c:1942:6: warning: Value stored to 'record_len' is never read
                                        record_len = head[2] * 256 + head[3];
                                        ^            ~~~~~~~~~~~~~~~~~~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5158 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:11:59 +00:00
ludovic.rousseau f76600b901 Remove dead code
apdu.c:166:5: warning: Value stored to 'p' is never read
                        *p++ = (u8)apdu->le;
                         ^~~
apdu.c:156:4: warning: Value stored to 'p' is never read
                        p += apdu->lc & 0xff;
                        ^    ~~~~~~~~~~~~~~~
apdu.c:147:5: warning: Value stored to 'p' is never read
                        *p++ = (u8)apdu->le;
                         ^~~
apdu.c:139:3: warning: Value stored to 'p' is never read
                p += apdu->lc;
                ^    ~~~~~~~~
apdu.c:118:3: warning: Value stored to 'p' is never read
                p += apdu->lc;
                ^    ~~~~~~~~
apdu.c:112:5: warning: Value stored to 'p' is never read
                        *p++ = (u8)apdu->le;
                         ^~~
apdu.c:107:5: warning: Value stored to 'p' is never read
                        *p++ = (u8)apdu->le;
                         ^~~
apdu.c:102:4: warning: Value stored to 'p' is never read
                *p++ = (u8)apdu->le;
                 ^~~
apdu.c:99:5: warning: Value stored to 'p' is never read
                        *p++ = (u8)0x00;
                         ^~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5157 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:09:15 +00:00
ludovic.rousseau 46946f285f Remove dead code
ef-atr.c:41:16: warning: Value stored to 'category' during its initialization is
      never read
        unsigned char category = *buf;
                      ^          ~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5156 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:04:28 +00:00
ludovic.rousseau 9906e5af66 Remove dead code
asn1.c:1321:3: warning: Value stored to 'r' is never read
                r = 0;
                ^   ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5155 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:03:28 +00:00
ludovic.rousseau 49f19fecb0 Remove dead code
log.c:107:2: warning: Value stored to 'left' is never read
        left -= r;
        ^       ~
log.c:106:2: warning: Value stored to 'p' is never read
        p += r;
        ^    ~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5154 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:01:35 +00:00
ludovic.rousseau f4af7743f1 Remove dead code
ctx.c:550:25: warning: Value stored to 'count' is never read
                        ctx->conf_blocks[count++] = blocks[0];
                                         ^~~~~~~


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5153 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 21:00:38 +00:00
ludovic.rousseau c8f5ab4fe5 Fix analyzer warnings. The code looked good.
sc.c:667:12: warning: The left operand of '>=' is a garbage value
        if (tx[2] >= 0)
            ~~~~~ ^
sc.c:656:12: warning: The left operand of '>=' is a garbage value
        if (tx[0] >= 0) {
            ~~~~~ ^


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5152 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 20:59:28 +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 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 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 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
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 2c6d3ee9fa pkcs15: comments and debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5094 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 13:11:21 +00:00
vtarasov 3fdb9f9e71 pkcs15: when getting public key data, return 'direct' object value if available
add debug messages


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5093 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-17 12:54:15 +00:00
vtarasov fd670f2dce pkcs15: initialize 'supported algorithms' in SE data by the ones from tokenInfo
for some cards to prepare security environment for the PSO operation
card driver may need the value of 'algRef' attribut of tokenInfo.supportedAlgorithm.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5092 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-14 17:12:04 +00:00
flc 5e13c7d083 remove unset sc_pkcs15init_finalize_profile function from libopensc.exports
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5091 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-14 09:59:42 +00:00
vtarasov 71bfc87282 asn1: spelling of the debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5090 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-13 15:06:12 +00:00
vtarasov 2a8fc56402 pkcs15: add array with supported algos references to the key info data type ...
and imlement API to access it


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5089 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-13 14:05:19 +00:00
vtarasov 66412d6e53 asn1: accept long tag ...
According to X.690-0207 ch.8.1.2.4


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5088 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-13 13:59:22 +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 76b0a73a80 tools: reserve more place for the print path and AID buffer ...
to insert the '::' indicator of 'AID' or 'DF_NAME' path type


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5084 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 10:46:09 +00:00
vtarasov 772ab4cefb libopensc: parse EF.ATR: redefine 'STATUS' macros ...
thanks to Andre Zepezauer for his precious remarks


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5083 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 10:29:23 +00:00
vtarasov 56c05c6a6a pkcs15: asn1: extend DDO with 'ddoAID' and 'ddoIIN' ...
This extension is used by multi-applications cards when EF.ODF with EF.tokenInfo 
and xDF with (secure) data objects are placed in a different applications.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5082 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 10:19:57 +00:00
vtarasov e98dee0092 pkcs15: asn1: local PIN should have a path defined ...
if there is no 'path' in the 'PinAttributes', use DDO.AID or application path as a PIN's path.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5081 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 10:12:42 +00:00
vtarasov a1c3191ba1 libopensc: parse EF.DIR: no need to check the presence of mandatory AID after success of ASN1 decoding
use "struct sc_aid"


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5080 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-11 10:08:05 +00:00
vtarasov 8f5f0b684a libopensc: remove non-ISO7816 members from the EF.ATR data, thanks to Andre Zepezauer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5079 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-10 14:15:37 +00:00
vtarasov fa9ed3add0 asn1: invalid detection of AID presence in ASN1 path data
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5078 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-10 10:44:52 +00:00
vtarasov 40cb9c99b8 asn1: decode 'extendedPath'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5077 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 17:25:09 +00:00
vtarasov aaa92eeb3d libopensc: adapt 'make_absolute_path' to the path with valid 'aid' member ...
use make_absolute_path() to compose path to 'ODF' and 'tokenInfo'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5076 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 17:23:10 +00:00
vtarasov a808379756 libopensc: when printing 'path', print also the value of 'aid' if available.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5075 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 17:17:01 +00:00
vtarasov 0fefb0b078 pkcs15-tool: do not print non-relevant to the 'list-applications' context information
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5074 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 17:13:14 +00:00
vtarasov 4ab8018781 iso7816: use already defined local variable 'ctx' instead of 'card->ctx'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5073 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 10:42:40 +00:00
martin 75c1254e22 Initial modifications to support OpenPGP v2.0 (CryptoStick)
* Correct naming: openpgp not opengpg
 * Set the card name from ATR table
 * Add card type enums
 * Currently OpenPGP is read-only.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5072 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 10:17:16 +00:00
martin 2d5c76d3d1 iso7816: Don't translate a returned FCP template from SELECT FILE to "unknown data received"
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5071 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 10:17:08 +00:00
vtarasov 2b47d90daf libopensc: to be compiled with Visual Studio
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5070 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 10:02:43 +00:00
vtarasov 2244d0c96f libopensc: procedure to log the card's cache
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5069 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 09:32:34 +00:00
vtarasov 8ee55a38b3 libopensc: extend DDO data type with the parsed 'aid', 'oid' and 'iid' members
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5068 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 09:29:39 +00:00
vtarasov b2d885fe34 libopensc: extend serial number to the ISO/IEC 7812 PAN definition
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5067 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 09:25:22 +00:00
vtarasov f304fed517 libopensc: add 'crts' array to 'struct sc_acl_entry' ...
For some cards the acl bytes, retrived from 'select' response, can reference 
a SE (and not directly PIN).
In such case, to proceed an authentication for the card operation 
the information about the SE's CRTs is needed.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5066 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 09:13:47 +00:00
vtarasov 8f2c96863a libopensc: do not return 'SUCCESS' if EF.ATR do not exist ...
debug messages


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5065 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 08:51:55 +00:00
vtarasov 5a7f8a2d60 libopensc: initialize 'sc_path' type variables ...
it's needed to initialize the 'aid' member of 'struct sc_path'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5064 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 08:49:15 +00:00
vtarasov 42fbe85a52 libopensc: use 'calloc' to allocate application info ...
remove unused variable


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5063 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 08:31:06 +00:00
vtarasov ca382fd93b iso7816: accept 'FCP' tag when processing FCI
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5062 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-09 08:28:38 +00:00
vtarasov a576582701 libioensc: use 'struct sc_atr' instead of 'u8 *atr, size_t atr_len'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5061 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 17:18:58 +00:00
vtarasov eb4f283c6a pkcs15: do not call sc_parse_ef_atr() ...
it should be called in the 'init' handle of the card driver 
when EF.ATR is present


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5060 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 16:09:39 +00:00
vtarasov bf4aa793af libopensc: parse content of the EF(ATR) file
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5059 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 15:49:10 +00:00
vtarasov 65cd456256 opensc-explorer: print raw content of 'CONTEXT' tag
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5058 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 15:47:58 +00:00
vtarasov cb5b141391 pkcs15: remove unused variables
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5057 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 15:44:13 +00:00
vtarasov 82adc9361e pkcs15: in sc_pkcs15_card include the pointer to the application that the card was binded to
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5056 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 13:31:30 +00:00
vtarasov e600a1e0ac opensc-explorer: in 'asn1' command print raw content of the ASN1_APPLICATION data
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5055 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 09:00:39 +00:00
martin 6af2bc07c3 PC/SC: don't try to use SCARD_SHARE_DIRECT if there is a card in the reader. This can confuse some card/reader combos.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5054 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 08:55:12 +00:00
vtarasov bbcc780460 pkcs15-tool: in help message move 'list-applications' action to the head of the actions group
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5053 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-07 08:50:41 +00:00
vtarasov 2f0b83eecd pkcs15-tool: new action 'list-applications'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5052 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-06 16:21:15 +00:00
vtarasov 209224816a libopensc: introduce TLV and LV data type, use it to store DDO data
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5051 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-06 16:16:24 +00:00
vtarasov 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 0611b6260f libopensc: add 'sc_aid' member to 'sc_path' ...
not all application DF have and can be selected by its file-id.
So, new member in 'sc_path' will help to describe the full path to some EF(DF) inside a card.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5047 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 15:39:43 +00:00
vtarasov 4d81ffcea6 pkcs15-tool: new 'bind-to-aid' argument ...
to indicate application to bind when more then one on-card application detected


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5046 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 15:22:12 +00:00
vtarasov 121260b846 pkcs15: some changes to the discovery on-card applications code ...
; 'known' pkcs#15 applications are moved to the head of the card applications array;
; card specific 'bind finalization' code moved to the dedicated procedures;
; remove unused sc_application member, procedures;
; remove commented code;
; add debug messages;


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5045 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 14:53:52 +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 7a14e97794 cardmon: 'bind' prototype has been changed
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5043 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 14:32:38 +00:00
vtarasov 4914b022d1 pkcs15-tool: new 'bind-to-aid' argument ...
indicate application to bind when multi-application card is used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5042 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-05 14:29:49 +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 cf7c9fd726 libopensc: log: short form to insert 'normal' debug message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5037 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-04 09:17:37 +00:00
andre 1b7585480c openssl.c: Fixes comparsion between signed and unsigned
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5036 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-03 16:20:19 +00:00
andre be3e50aa96 framework-pkcs15.c: Fixes two warnings:
1 x comparsion between signed und unsigned
1 x unused parameter 'flags'

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5035 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-03 15:10:18 +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
martin f8f38e7d86 Reject creating files bigger than 64K.
Most smart cards currently have only 64K or 128K of EEPROM. This will give better errors earlier for people trying to import huge keyfiles with TrueCrypt.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5030 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 15:05:42 +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 898b62bf56 libopensc: more of debug messages, code layout
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5028 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:32:11 +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
martin c7422df6b5 opensc-tool: make --list-algorithms know about GOST keys
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5026 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:31:15 +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 971d643a0a libopensc: encode/decode 'direct' public key value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5024 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:25:48 +00:00
vtarasov d45fb4ca1b libopensc: set 'enumerated' flag for xDF if corresponding EF file was successfully read ...
it's an extention of r4983, that was not properly working for the existing but empty xDF files.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5023 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:22:38 +00:00
vtarasov 4b5bc9900c libopensc: asn1: allow empty path
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5022 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:14:24 +00:00
vtarasov aec6e175f5 AuthentIC: read/write/update binary card handles can use the 'WAITING-AREA' reader facility ...
when used with virtual reader, the APDUs can be buffered in the reader's
internal buffer, before sending it to the distant card.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5021 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 14:11:00 +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
martin 3e18e0838d Fix compiler warning
util.c: In function ‘util_getpass’:
util.c:348: warning: comparison between signed and unsigned

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5018 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 12:55:10 +00:00
martin f10d2908a5 opensc-tool: combined with --verbose, --list-readers will show tha ATR and name of the card, together with extra reader flags
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5017 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 12:55:03 +00:00
martin 16726a55b5 tools: allow to specify an ATR in the --reader option.
This facilitates automated testing on a single machine with several identical readers with inserted cards.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5016 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 12:54:57 +00:00
martin c911c2ffeb PC/SC: add additional flags to indicate readers which are in use and readers which are in exclusive mode.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5015 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 12:54:51 +00:00
martin d1d64f9dfe AktivRutokenECP: make opensc-tool -n show the actual token name, based on ATR
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5014 c6295689-39f2-0310-b995-f0e70906c6a9
2011-01-02 12:54:44 +00:00
vtarasov 83453633b7 libopensc: remove '\n' from the debug message ...
'sc_do_log_va' takes care of line ending


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5013 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-31 11:09:21 +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
andre 7743f6944a opensc-explorer.c: Fixes usage of size_t variables. According to ANSI C the type of size_t is always an unsigned type.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5010 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-31 00:50:30 +00:00
andre 5481e61dad cardos-tool.c: According to ANSI C the type of size_t is always an unsigned type.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5009 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-31 00:00:00 +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 8b270205cc libopensc: API for the 'erase-binary' card operation
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5005 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 13:25:09 +00:00
vtarasov ee907b7a69 libopensc: add new authentication methods, add ACLs to PIN info, ...
add 'next' member to 'sc_apdu' structure


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5004 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 13:20:19 +00:00
vtarasov 2804395cf4 libopensc: revert erroneous commit
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5003 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 13:10:28 +00:00
vtarasov 92c3e59e16 libopensc: Now 'cache-valid' flag is a member of 'sc_card_cache' ...
add 'current_ef' and 'current_df' member to 'sc_card_cache'.
The main purpose of this is to reduce number of APDU transactions.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5002 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 13:04:55 +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
vtarasov 5a9e4b1ca6 pkcs15-tool: minor change of the private key info layout
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5000 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-30 12:29:29 +00:00
martin f694bbf597 libopensc: correctly use HAVE_MALLOC_H to include malloc.h
See http://www.freebsd.org/cgi/cvsweb.cgi/ports/security/opensc/files/patch-src_libopensc_card-piv.c#rev1.1

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4999 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-29 10:45:08 +00:00
martin abcdb86c4e Fix #302: in C_Logout silently ignore missing card specific logout hooks.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4998 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-29 10:45:01 +00:00
andre 33a67cac5b pkcs15.c: Fixes a bug that occurs in the situation where a PKCS15 EF contains partially invalid data. I.e. the last object in the EF is broken and thus can't be decoded successfully. In that case the whole EF becomes never flagged as enumerated. This in turn results in endless processing of that EF. Thereby the first valid objects became attached to the internal obj_list over and over again.
That patch prevents the repeated attachment of objects to obj_list, because it marks an EF as enumerated as soon the first object was successfully appended.

Left over from #266.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4983 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-22 21:45:43 +00:00
martin 791cbd7f53 Fix r4977: C89 style to support MS Visual Studio
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4979 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-20 08:57:07 +00:00
ep ab40e70e04 Wrong structure size calculation in pkcs15-itacns.c; thanks to Matteo Nastasi for the heads-up.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4978 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-19 11:18:43 +00:00
ep c14831eebd Modified patch for Actalis smart cards. Closes #235.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4977 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-19 11:18:40 +00:00
andre 02c4f1ec77 pkcs11-tool.c: Avoid compiler warning 'may be used uninitialized in this function'.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4968 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-18 00:44:12 +00:00
andre b7fad04e10 pkcs11-tool.c: Simplifies interface to show_key() and avoids more compiler warnings.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4967 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-17 23:02:03 +00:00
andre 30bf0f17a8 pkcs11-object.c: Add missing initializers.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4966 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-17 19:09:24 +00:00
andre b58592d297 mechanism.c: Removal of unused variables.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4965 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-17 18:47:41 +00:00
andre 1a5c0aea24 framework-pkcs15.c: Avoid some warnings if the macro USE_PKCS15_INIT is undefined. That is always the case if build without OpenSSL.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4964 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-17 17:54:07 +00:00
dengert bf28607dd3 More ENABLE_OPENSSL changes so sc_pkcs11_register_sign_and_hash_mechanism
will not fail. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4963 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-17 17:12:22 +00:00
andre 82824402f4 framework-pkcs15init.c: Add missing initializers.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4962 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-17 16:30:12 +00:00
andre 50567141f0 Rename of SC_NO_ERROR to SC_SUCCESS.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4954 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-16 05:04:37 +00:00
andre 6b10272caa framework-pkcs15.c: More specific log messages. Enables better tracking of errors.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4953 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-16 03:56:49 +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
andre f9acbf9073 pkcs15.h: Fixing type of parameter to avoid compiler warning: 'comparison between signed and unsigned'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4951 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-15 13:47:58 +00:00
andre 8defdf9aed pkcs15-algo.c: Just making the compiler happy.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4949 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-14 03:11:31 +00:00
andre 3cfe542813 Textual output of SC_ERROR_* return codes in debug messages.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4948 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-14 03:08:17 +00:00