Commit Graph

2104 Commits

Author SHA1 Message Date
martin 223f704b83 OpenPGP: fix top-level DOs according to spec
Added:
* 00c4: new top-level DO in 2.0
        can also be found inside constructed DOs 006E/0073 in 2.0 & 1.1
* 0101: new optional top-level DO starting in 1.1
        for private use
        max 254 bytes;
        access: read - always; write - verify CHV2
* 0102: new optional top-level DO starting in 1.1
        for private use
        max 254 bytes;
        access: read - always; write - verify CHV3
* 5f52: new top-level DO in 2.0
        can also be found inside constructed DOs 006E in 2.0
* 7f21: new optional top-level DO in 2.0
        use: card holder certificate (e.g. X.509) for the AUT key in the card
Removed:
* 0073: never a top-level DO, but part of top-level constructed DO 006E
Changed:
* 005e: not a constructed DO, but a simple/primitive DO

Note:
Trying to read non-existent top-level DOs or top-level DOs that weren't defined
in a spec version later than the current card's version does not hurt.
They are returned as empty.

Signed-off-by: Peter Marschall <peter@adpm.de>

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5468 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-23 17:29:09 +00:00
ludovic.rousseau 8183732da8 Fix compiler warning and potential bug
pkcs15-piv.c:129: warning: 'fbyte' may be used uninitialized in this function


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5464 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-22 10:21:59 +00:00
ludovic.rousseau c9fae6f6a1 Fix typo in comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5463 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-22 10:19:35 +00:00
ludovic.rousseau 7124273dee Fix a bug and a compiler warning
pkcs15-actalis.c: In function 'sc_pkcs15emu_actalis_init':
pkcs15-actalis.c:232: warning: dereferencing type-punned pointer will
break strict-aliasing rules

Never cast a pointer between types of different sizes. On 64-bit Unix
(LP64) int is 32 bits long and long is 64 bits long.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5462 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-22 10:16:36 +00:00
ludovic.rousseau 38e420bec3 Fix compiler warning
card-piv.c: In function 'piv_write_binary':
card-piv.c:1364: warning: signed and unsigned type in conditional expression

count is a size_t and must be casted in an int since the fucntion
returns an int.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5461 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-22 10:10:21 +00:00
ludovic.rousseau 96ff2bbe36 Fix compiler warning
sc.c: In function 'sc_remote_apdu_allocate':
sc.c:725: warning: unused variable 'counter'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5460 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-22 10:07:24 +00:00
vtarasov 7e9f5b2270 pkcs15: in 'compute-signature', when doing 'zero-padding', set properly the new input data length
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5457 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-20 11:24:46 +00:00
vtarasov d2cc8f1364 ruToken-ECP: error in revert 'compute-signature' result procedure ...
'comute-signature' can be called with length of output data greater then signature size


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5456 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-19 17:00:29 +00:00
vtarasov 30eb1e9897 ruToken-ECP: in compute-signature procedure limit Le to 256 bytes ...
so that the APDU can pass the validity check


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5455 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-19 08:48:57 +00:00
vtarasov ce79a61d30 tools: print value of 'BOOLEAN' asn1 type
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5446 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-16 08:32:07 +00:00
vtarasov a44ec385bd iasecc: no support for SHA256 in the OpenSSL previous to v0.9.8
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5444 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 16:11:06 +00:00
vtarasov 65e10c29ad libopensc: add description for the 'remote data' data types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5443 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 15:34:03 +00:00
vtarasov c7ed3da502 libopensc: authentIC: use macros; use common CPLC data type
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5440 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 12:57:18 +00:00
vtarasov e6a3d92de7 libopensc: SM related errors
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5439 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 12:50:24 +00:00
vtarasov 4fbb37ae7e libopensc: 'remote data' related procedures: init, allocate, free
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5438 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 12:44:31 +00:00
vtarasov 292d561882 libopensc: move declaration of 'serial number' related data types from 'opensc.h' to 'types.h'...
also define CPLC and 'remote_data' data types.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5437 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-13 12:19:29 +00:00
vtarasov cbecf23395 iasecc: when getting data for qualified signature, take the last SHAxx block from the input data ...
... and not from the SHAxx-CTX, to avoid big/little endian uncertainty


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5435 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-10 08:24:27 +00:00
vtarasov 1e025a0ded iasecc: support the digital signature with RSA scheme PKCS#1 SHA-256 ...
in this mode the final digest (SHA-256) step has to be performed by card.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5433 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-09 15:31:02 +00:00
vtarasov 81dd8b7775 libopensc: export 'sc_do_log_noframe' instead of internal 'sc_do_log_va'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5431 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-08 08:10:16 +00:00
vtarasov 1176c59370 libopensc: export the wrapper for the internal log function dedicated to minidriver
http://www.opensc-project.org/pipermail/opensc-commits/2011-May/011049.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5430 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-08 08:07:03 +00:00
vtarasov 8e75d971cb asn1: when encoding the OID, make sure that unused part of input data is properly initialized
it's a supplement to r5355. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5429 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-08 07:59:16 +00:00
martin 34302525fc MiniDriver: add two exports used by MiniDriver. PKCS#1 related functions could be exported, internal logging should be eventually fixed in MiniDriver instead.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5428 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-05 14:26:27 +00:00
martin e4711a485e WindowsInstaller: don't link against winscard.lib, winscard.dll is loaded on runtime. Link minidriver against correct opensc.lib
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5427 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-05 14:03:36 +00:00
andre 03b4891c1e pkcs15-pubkey.c:975: warning: missing initializer
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5424 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-04 16:45:01 +00:00
vtarasov 5e50a14b3f libopensc: introduce 'key-params' data type that contains pointer, size and 'free' handler ...
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016441.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5413 c6295689-39f2-0310-b995-f0e70906c6a9
2011-05-01 19:18:14 +00:00
vtarasov c70e0ae982 iasecc: use atr mask to accept the Gemalto's IAS/ECC card without MF
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5411 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-30 17:51:43 +00:00
vtarasov 8098e82b16 libopensc: in 'READ BINARY' ignore the 'FILE_END_REACHED' error ...
see discussion
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016413.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5405 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 14:37:57 +00:00
vtarasov 5471aea023 libopensc: new error code macros -- 'corrupted data' and 'file end reached'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5404 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 14:28:03 +00:00
vtarasov 670942a0b4 iasecc: when preparing data to update PRIVATE KEY SDO use index to enumerate the SDO components
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5403 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 14:12:40 +00:00
vtarasov ad478eb9cc iasecc: write 'compulsorily use' data for the new key slot ...
Once written the 'compulsorily use' data cannot be changed. 
Write this data immediately after a new key slot has been created.
It helps to avoid further confusion between 'use new key slot' and 'reuse existing slot'.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5402 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 14:06:58 +00:00
vtarasov 6c3b43f636 iasecc: when signing short data sequence with PSO_DST ...
... 'last-hash-step' APDU do not includes the 'pre-hash' and 'counter' data -- only the 'last-data-block'.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5401 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-27 13:56:31 +00:00
vtarasov c9bf9bc22c iasecc: 'DELETE SDO' card ctl ...
to be used by Obertbur's IAS/ECC card.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5398 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-26 17:29:08 +00:00
vtarasov 346490b953 iasecc: 'CREATE SDO' card ctl ...
; static function dedicated to emulate FCP data of application DF when it's not returned by card



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5397 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-26 16:42:48 +00:00
vtarasov 3b9f5b94ae iasecc: encode data for the SDO creation, ...
; dedicated function to parse ACLs from DOCP data;
; when converting ACL chack and parse ACLs;
; change prototype of the internal static functions.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5396 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-26 16:34:44 +00:00
martin 1cdb3fa971 APDU parsing: switch to Frank Morgner's implementation
Patch by Frank Morgner, proposed in
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016419.html and
http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016420.html:

* replace partly incorrect extended APU parsing implementation
  with one factored-out in function sc_bytes2apdu() in apdu.c
* re-factor APDU parsing functions in
  - opensc-explorer
  - opensc-tool
  - piv-tool
  to make use of sc_bytes2apdu()

Thanks to Peter Marschall and Frank Morgner
This fixes #260 and #351.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5394 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-26 07:29:53 +00:00
vtarasov 27cd40629e iasecc: Oberthur's card strictly follows specification in 'IO buffer size' ...
Most of the card producers interpret 'send' values in 'IO buffer size' data as "maximum APDU data size" .
The last Oberthur's card strictly follows specification and interpret these values as "maximum APDU command size".


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5392 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-24 17:57:49 +00:00
vtarasov 9376b73d14 EC support: new exported function to fill up the EC parameters data ...
for ex. with the given named curve fills the 'OID' and 'encoded OID' members


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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5386 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-22 13:08:45 +00:00
vtarasov 38103c64cf pkcs15: new function to encode an OID in DER format
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5380 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-21 14:12:03 +00:00
vtarasov 669a10572a asn1: now sc_der_copy() returns int value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5379 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-21 13:46:28 +00:00
andre fa8fd1602d types.h: Avoid warning:
opensc-tool.c:356: warning: comparison between signed and unsigned

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5372 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-19 12:34:16 +00:00
andre 90ffef6dc9 asn1.c: Check boundaries __before__ accessing memory.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5361 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-18 12:29:47 +00:00
martin 007d27feeb Introduce sc_ctx_log_to_file to set the debug file of libopensc.
On Windows every DLL has their own file descriptor table, thus specifying
-v from any of the OpenSC tools resulted in a crash when the tool tried to override
ctx->debug_file with stderr.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5359 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-18 10:01:27 +00:00
vtarasov caf3789439 asn1: in encode-object-id procedure do not stop on zero -- it's a valid value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5355 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-17 18:39:01 +00:00
vtarasov 28ccae7918 card-piv: store serial number into the 'serialnr' member of sc_card structure ...
... when serial number was asked for the first time.
Then return the stored value for the every next request of serial number.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5348 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-16 17:35:56 +00:00
dengert 461721cf6d PIV piv_get_uid to derive a better guid from the
FASCN or the GUID so that most of the uniquness
is maintained. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5339 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-14 16:51:25 +00:00
martin 44cf3d06ae MiniDriver: rename cardmod to minidriver in source.
Also change some grammar, whitespace (reported by git) and wording (Opensc->OpenSC) issues.
Add some comments here and there.

See http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016261.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5329 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 07:40:12 +00:00
vtarasov 54fb422831 pkcs15: include EC private/public key types into the pkcs#15 object search procedures
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5322 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 11:30:45 +00:00
andre 383d6e8362 ctx.c: Replaces magic integer -1 with defined constant value.
See [http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/cards.h?rev=5320#L32 cards.h]

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5321 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 10:34:55 +00:00
vtarasov 848180ab50 libopensc: use short debug macros in card.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5319 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 09:20:15 +00:00
vtarasov b614444aae libopensc: use short debug macros in pkcs15.c
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5318 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 09:18:25 +00:00
vtarasov 5102e4d882 card-piv: 'emulate' MF selection by selection of the PIV applet ...
so that, PIV card can be used with the 'opensc-explorer' interactive tool


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5317 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 08:47:35 +00:00
andre 3169f14b32 libopensc: Removes useless attribute 'file' in 'struct sc_pkcs15_df'
There is no need to carry around that attribute, because it's easy to look up the 'file' as needed. This is done by issuing a single sc_select_file command in sc_pkcs15init_update_any_df (pkcs15-lib.c).

The parameter 'file' of sc_pkcs15_add_df (pkcs15.c) became useless too and was removed in turn.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5316 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-10 04:09:33 +00:00
vtarasov 86af8eed3d card-pin: make working 'external authenticate' ...
'key-ref' and 'algo' arguments of the piv_general_external_authenticate() function 
were not used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5315 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-09 19:26:34 +00:00
vtarasov 004c08b6a0 card-piv: invalid arguments for SC_TEST_RET macro
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5314 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 15:16:47 +00:00
andre 69c846f904 libopensc: Re-defines SC_CARD_FLAG_ONBOARD_KEY_GEN to be local to the file card-flex.c, because that flag is used nowhere else. In principle, this patch only reverts some changes made by r2192.
Relates to #296.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5312 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-08 13:30:32 +00:00
andre b21eeb46b9 libopensc: Removes unused flag SC_CARD_CAP_RSA_2048.
Relates to [http://www.opensc-project.org/opensc/ticket/296#comment:1 #296].

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5308 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 18:16:40 +00:00
vtarasov be46a660e7 libopensc: export names of the 'get GUID' routines
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5304 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 16:46:38 +00:00
vtarasov f8ba3ea76d libopensc: general routines to get serialized GUID
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5302 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 16:42:23 +00:00
andre 89b975022c opensc.h: Removes unused flag SC_CARD_CAP_EMV.
Relates to [http://www.opensc-project.org/opensc/ticket/296#comment:1 #296].

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5301 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 16:18:56 +00:00
andre 213fa68ea0 card-setcos.c: Fixes misuse of SC_CARD_FLAG_ONBOARD_KEY_GEN. From [http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/opensc.h?rev=5299#L411 opensc.h]:
#define SC_CARD_FLAG_ONBOARD_KEY_GEN    0x00000001
#define SC_CARD_CAP_APDU_EXT            0x00000001


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5300 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-07 15:38:22 +00:00
andre ac3a48d7ca pkcs15.h: Fixes type inconsistency, because in [http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/opensc.h?rev=5190#L148 opensc.h] algo_ref is defined as unsigned int.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5299 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-06 22:46:46 +00:00
andre 93deff0161 dir.c: Avoid warnings:
dir.c:212: warning: comparison between signed and unsigned
dir.c:220: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5298 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-06 15:11:18 +00:00
andre d3215b67df asn1.c: Avoid warnings:
asn1.c:747: warning: comparison between signed and unsigned
asn1.c:785: warning: comparison between signed and unsigned


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5297 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-06 15:06:02 +00:00
martin cd3012f55e Fix #340: ignore pinpad properties of readers known to be broken.
On Mac OS X the HP smart card keyboard claims secure PIN entry support but the PIN is transmitted to host.
Disregard the pinpad flag for this reader. Other readers claiming pinpad support but having problems to follow in this list.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5273 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-29 11:36:45 +00:00
ludovic.rousseau fe630c884f Fix a real bug (and a compiler warning)
pkcs15-oberthur.c: In function 'sc_pkcs15emu_oberthur_add_pubkey':
pkcs15-oberthur.c:585: warning: statement with no effect
pkcs15-oberthur.c: In function 'sc_pkcs15emu_oberthur_add_cert':
pkcs15-oberthur.c:654: warning: statement with no effect


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5269 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 17:17:07 +00:00
ludovic.rousseau b435f6007a Fix compiler warning
pkcs15-itacns.c: In function 'itacns_add_data_files':
pkcs15-itacns.c:478: warning: declaration of 'list_size' shadows a global declaration
../../src/common/simclist.h:497: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5267 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 16:05:24 +00:00
ludovic.rousseau 8c0dbf4b02 Fix compiler warning
card-iasecc.c: In function 'iasecc_get_serialnr':
card-iasecc.c:2218: warning: declaration of 'ii' shadows a previous local
card-iasecc.c:2165: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5266 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 16:02:42 +00:00
ludovic.rousseau 0e6b87b135 Fix compiler warning
card-iasecc.c: In function 'iasecc_select_file':
card-iasecc.c:647: warning: declaration of 'rv' shadows a previous local
card-iasecc.c:635: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5265 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 16:01:45 +00:00
ludovic.rousseau 161678d8a6 Fix compiler warning
card-iasecc.c:1529: warning: declaration of 'ffs' shadows a global declaration
/usr/include/string.h:121: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5264 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 16:00:56 +00:00
ludovic.rousseau 11ae160d55 Fix compiler warning by commenting dead code
card-authentic.c:510: warning: 'authentic_resize_file' defined but not used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5263 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:58:17 +00:00
ludovic.rousseau 577499f80c Fix compiler warning
card-authentic.c: In function 'authentic_chv_verify_pinpad':
card-authentic.c:1255: warning: declaration of 'ffs' shadows a global declaration
/usr/include/string.h:121: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5262 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:57:20 +00:00
ludovic.rousseau 4410ae0397 Fix compiler warning
card-westcos.c: In function 'westcos_init':
card-westcos.c:255: warning: declaration of 'priv_data' shadows a previous local
card-westcos.c:210: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5261 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:55:06 +00:00
ludovic.rousseau 902e4b139a Fix compiler warning by commenting dead code
card-piv.c:179: warning: 'oid_prime256v1' defined but not used
card-piv.c:180: warning: 'oid_secp384r1' defined but not used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5260 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:53:15 +00:00
ludovic.rousseau 1f2c8211ad Fix compiler warnings
card-oberthur.c: In function 'auth_pin_verify_pinpad':
card-oberthur.c:1581: warning: declaration of 'ffs' shadows a global declaration
/usr/include/string.h:121: warning: shadowed declaration is here
card-oberthur.c: In function 'auth_pin_reset_oberthur_style':
card-oberthur.c:1802: warning: declaration of 'ffs' shadows a global declaration
/usr/include/string.h:121: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5259 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:51:29 +00:00
ludovic.rousseau f1170e009a Fix compiler warning
reader-pcsc.c: In function 'refresh_attributes':
reader-pcsc.c:339: warning: declaration of 'rv' shadows a previous local
reader-pcsc.c:273: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5258 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:46:51 +00:00
ludovic.rousseau f7f6213d24 Fix compiler warning
reader-pcsc.c: In function 'refresh_attributes':
reader-pcsc.c:337: warning: declaration of 'state' shadows a previous local
reader-pcsc.c:272: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5257 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:45:41 +00:00
ludovic.rousseau 842550ae20 Fix compiler warning
pkcs15-pubkey.c: In function 'sc_pkcs15_pubkey_from_spki_filename':
pkcs15-pubkey.c:944: warning: 'buflen' may be used uninitialized in this function


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5256 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:43:00 +00:00
ludovic.rousseau 88a07de60d Fix compiler warning
ctx.c: In function 'sc_context_create':
ctx.c:646: warning: implicit declaration of function 'lt_dlinit'
ctx.c:646: warning: nested extern declaration of 'lt_dlinit'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5255 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:41:20 +00:00
ludovic.rousseau c1bd559f99 Fix compiler warning
cards.h:221: warning: function declaration isn’t a prototype


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5246 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 14:56:22 +00:00
martin b0b5da2ab6 Fix building CT-API after r5061, noticed by Jenkins autobuild
reader-ctapi.c:255: error: ‘sc_reader_t’ has no member named ‘atr_len’

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5244 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-21 06:54:16 +00:00
ludovic.rousseau 8ef19c4ad2 typo: dont -> don't
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5243 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-20 14:50:44 +00:00
martin 7406d84415 Fix a typo reported by lintian
I: libopensc3: spelling-error-in-binary ./usr/lib/libopensc.so.3.0.0 enviroment environment

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

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5238 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-20 12:18:55 +00:00
vtarasov a55f2f098b iso7816: try to read full amount of the requested data ...
actually, if an error 'Wrong Le' happens, the APDU with the reduced size is re-transmitted
(http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/apdu.c#L401) .
iso7816_read_binary() returns this reduced amount of data and do not trying to read the missing part .


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5237 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-15 12:18:51 +00:00
alonbl b8fcfa8a1f openct: Wrong size
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5235 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 20:18:01 +00:00
alonbl 1a19093b42 Make openct compile again
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5234 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 19:45:02 +00:00
vtarasov 39f3c2b7c6 rtecp: in non-extended APDUs the 'Le' value cannot be more then 256 bytes ...
after r5186 the SC_MAX_APDU_BUFFER_SIZE has been increased
and so existing defintion of Le value became invalid.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5233 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 18:19:07 +00:00
vtarasov a076397671 pkcs15: without AID specified return the first available PKCS#15 application ...
revert accidential commit, thanks to Pierre Ossman.
http://www.opensc-project.org/pipermail/opensc-devel/2011-March/016149.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5232 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 18:13:38 +00:00
vtarasov b1a1dc245a pkcs15: accept more then one xDF file of the same type ...
partial revert of r4096, thanks to Pierre Ossman
http://www.opensc-project.org/pipermail/opensc-devel/2011-March/016148.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5231 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 18:09:48 +00:00
vtarasov 27f493e6d8 libopensc: fix debug message
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5230 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-14 18:02:50 +00:00
vtarasov a067bf35a3 pkcs15: more of the debug messages
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5228 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-13 18:11:07 +00:00
vtarasov d7c0ad71ff ruToken: in non-extended APDUs the 'Le' value cannot be more then 256 bytes ...
in r5186 the SC_MAX_APDU_BUFFER_SIZE has been increased
and so the previous defintion of Le value became invalid.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5225 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-11 17:57:46 +00:00
andre 12df79c14b pkcs15.c: Avoid compiler warning:
pkcs15.c:286: warning: unused variable ‘conf_block’


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5223 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-07 18:10:11 +00:00
andre 3442649b42 pkcs15-pin: Fixing the method of obtaining objects protected by a particular PIN. Now it's in accordance with PKCS15. See [http://www.opensc-project.org/pipermail/opensc-devel/2011-January/015818.html discussion].
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5222 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-07 16:15:41 +00:00
andre 39db526407 pkcs15-piv: Remove unused functionality.
These lines made use of the attribute card->flags which is mostly unused in the whole framework. That attribute becomes nearly obsolete without these lines. See [http://www.opensc-project.org/pipermail/opensc-devel/2011-March/016104.html discussion].

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5221 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-07 16:00:23 +00:00
vtarasov 33f44f8dc1 pkcs15: pin references are always positive integers ...
In the OpenSC versions previous to 0.11.5 the references greater then
127 were erroneously encoded by one byte (negative value ecording to the
ASN.1 rules).
Actually some other proprietary PKCS#15 cards have also this infirmity.

Actual commit makes general the application of the hack used for 'starcos' card.

http://www.opensc-project.org/pipermail/opensc-devel/2011-February/016062.html


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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5219 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-06 11:34:58 +00:00
andre 8ff3d5d647 Fixing misuse of SC_CARD_FLAG_RNG. From opensc.h :
[http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/opensc.h?rev=5190#L88 #define SC_ALGORITHM_RSA_PAD_PKCS1      0x00000002]
[http://www.opensc-project.org/opensc/browser/trunk/src/libopensc/opensc.h?rev=5190#L413 #define SC_CARD_FLAG_RNG                0x00000002]

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5218 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-04 16:23:07 +00:00
martin 711cbda2e0 PC/SC: Add "PIN length not in range" interpretation to PC/SC pinpad code.
This way this condition won't get translated to a generic -1200 error, as 0x6403 is not a known SW.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5217 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-02 14:18:09 +00:00
dengert d4bcba5808 Allow a key to be used to sign a certificate request
even if the normal usage does not allow sign.
This is need when initializing a card when called by
OpenSSL req -engine  



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5215 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-25 17:20:52 +00:00
vtarasov dc7cde4d79 ias/ecc: do not throw an error when there is SM or Auth.Ext protection
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5214 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-23 08:57:30 +00:00
dengert 432a89c18b Fix malloc warning by using stdlib.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5211 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-18 20:37:50 +00:00
vtarasov 7ca921fc4a ias/ecc: use extended path in the 'include' macros
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5208 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-17 17:24:31 +00:00
dengert 6ef7366074 void issues with ssize_t See r5135 and r5195
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5207 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-17 14:50:33 +00:00
vtarasov 4f266b6099 libopensc: include 'scdl' library when linking with Visual Studio ...
missing 'scdl' header file in 'pkcs15-lib'


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

Deals with #323

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


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


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


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5197 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 10:55:05 +00:00
vtarasov d953d4ade4 card-piv: 'ssize_t' is not defined when compiling with Visual Studio
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5195 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-16 10:31:59 +00:00
martin 43be49b4a3 libopensc: correct ASN.1 parsing of EF(TokenInfo).
Two fields should be optional. This also fixes #322

Thanks to Toni for finding and Andre for fixing the problem.
See http://www.opensc-project.org/pipermail/opensc-devel/2011-January/015613.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5194 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-10 20:31:34 +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 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
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
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