Commit Graph

4395 Commits

Author SHA1 Message Date
martin f73eb87fed MacInstaller: use the pre-built libopensc.dylib for building OpenSC.tokend
This way it can be built without installing OpenSC on a clean machine.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5193 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-10 13:40:35 +00:00
dengert 0a9d507556 Fixes to cardmod:
The registry in no longer used to pass the
    handles provided by BaseCSP. sc_ctx_use_reader
    is used instead.  (uses r5190)

    A decryption routine was added as it is needed by login.

    Key container names are based on the card serial
    number and cert ID. The must be unique as they
    are searched for in the certificate store to 
    find the card to insert in some situations. 

    If the handles change, the association to the reader
    and card is refreshed as it may be a different card
    or reader.  (uses r5127)

    Extra low lowel debugging was added. To use
    it the CARDMOD_LOW_LEVEL_DEBUG but be defined in
    cardmod.c This can log entries before and sc_context
    is established. 

    The use of "texte" was replaced, as it looked like there 
    could be buffer overflows. It was replaced with a 
    loghex routine.

    SC_ALGORITHM_RSA_HASH_MD5_SHA1 can now be used
    (IE uses this.) 
       
    Several other bugs were fixed.

The code can now bue used for AD login, and was tested
with swaping cards duirng login, and with several readers. 
The code is still experimental, and for login to work,
the dlls were moved to system32. 



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5192 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-09 17:52:00 +00:00
dengert 0180a969db Remove dependency on sc_establish_context, and provide appname
via sc_ctx_create_context and ctx_param.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5191 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-09 14:45:51 +00:00
dengert d3b3faa91a Add sc_ctx_use_reader as a reader driver operation.
It is used by cardmod to pass in pointers to the PC/SC handles 
provided by the caller of cardmod. Other drivers will return
an error if this routine called. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5190 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-09 14:33:52 +00:00
dengert 025da6d0f5 Fix #325 add SC_PKCS15_PRKEY_USAGE_ENCRYPT and SC_PKCS15_PRKEY_USAGE_DECRYPT
to PIV KEY Management keys and certificates, includeing the Retired keys. 
This applies to 0.12.0 and needs to be in 0.12.1


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5189 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-08 15:49:35 +00:00
dengert 98aa4cb571 Fix uninitialized variables and warning messages.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5188 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-07 16:23:54 +00:00
andre c209e3a757 Allow hex-strings to be separated by space characters:
opensc-tool -s "00 A4 00 00 02 3F 00 00"

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5187 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-06 22:43:12 +00:00
andre 1008062844 Adjust SC_MAX_APDU_BUFFER_SIZE to maximum size of Short APDU.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5186 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-06 22:33:13 +00:00
andre 8b76cee572 Revert r5137, because size_t is defined as unsigned integer type (without further qualification).
http://www.opengroup.org/onlinepubs/000095399/basedefs/stddef.h.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5185 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-06 17:28:30 +00:00
ludovic.rousseau 2f186bee8b Remove unused variables
card-authentic.c: In function ‘authentic_init_oberthur_authentic_3_2’:
card-authentic.c:423: warning: unused variable ‘resp’
card-authentic.c: In function ‘authentic_process_fci’:
card-authentic.c:1042: warning: unused variable ‘acls_NEVER’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5184 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-05 22:40:08 +00:00
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