Commit Graph

2104 Commits

Author SHA1 Message Date
Alon Bar-Lev df8715849d Remove libltdl: Remove ltld references
http://www.opensc-project.org/pipermail/opensc-devel/2011-December/017490.html
cherry-picked from 'libtool' branch of Alon Barlev's github project git://github.com/alonbl/OpenSC.git
and rebased

Remove libltdl: Remove ltld references
(cherry picked from commit a350326c520c5b0cb185f90946648633f4d0e456)

Remove libltdl: Detect libdl
(cherry picked from commit 51e7de45c11823460e776492dcbd40e60583a7eb)

Remove libltdl: Use libscdl
(cherry picked from commit 09f3eadb8a1a47407c011dcd3d5ce461516f3b87)

Remove libltdl: Cleanup libscdl
(cherry picked from commit 52d5f1be01146079e3a6fad1c88ebb0f577d0a94)

Remove libltdl: Cleanup libscdl usage at Microsoft VC build

Untested, I don't have the environment, Martin, please test.
(cherry picked from commit 7fb18f8d0b0bae6d181981a0c71190440e917c2c)

Change-Id: I73c98ccb9365584b12f4b0b97b69316a190b6e45
2012-03-17 20:55:05 +01:00
viktorTarasov 63eb4a4b4b Merge pull request #4 from marschap/iso7816-for-staging
iso7816 cleanups for staging
2012-02-22 00:28:07 -08:00
Ludovic Rousseau 006a97b8c8 Use the short form sc_log() instead of sc_debug()
Replace sc_debug(ctx, SC_LOG_DEBUG_NORMAL, ...) by sc_log(ctx, ...) as
suggested by Viktor Tarasov
2012-02-21 21:22:54 +01:00
Ludovic Rousseau 27c6652a1d Remove extra spaces and tabs at end of lines 2012-02-21 21:10:20 +01:00
Ludovic Rousseau af9dada86c Fix compilation error on Windows
SC_READER_CAP_PACE has been renamed to SC_READER_CAP_PACE_GENERIC during
patch discussion.
Thanks to Viktor Tarasov for the bug report
2012-02-21 21:10:20 +01:00
Frank Morgner 1141ae5202 Add support for PACE-enabled readers
Implements PC/SC interface to PACE-enabled readers defined in PC/SC
pt. 10 AMD 1 and BSI TR-03119.

PACE can be started using `sc_perform_pace`. This function currently
calls the new `perform_pace` from `struct sc_reader_operations`, if the
reader has the needed capabilities. `sc_perform_pace` could also be
extended with a stand-alone implementation of PACE (code could be
imported from here http://vsmartcard.sourceforge.net/npa/README.html).

Note that the reader's PACE capabilities are correctly determined by
calling GetReaderPACECapabilities.

OpenSC's new PACE capabilities can be tested using the `npa-tool` from
the Virtual Smart Card Architecture (see link above).
2012-02-21 14:10:47 +01:00
Ludovic Rousseau 0c9717a82e Reformat: remove extra spaces and tabs 2012-02-17 10:06:57 +01:00
Stef Walter 00e02359a3 libopensc: Add 'paranoid-memory' setting for behavior when mlock() fails
* Setting paranoid-memory to true, and mlock() fails, then
   allocations which require non-pageable memory will return NULL
2012-02-17 10:02:55 +01:00
Stef Walter 6ed52a06b8 libopensc: Don't fail to allocate memory when mlock fails
* Print out warning when mlock fails, and continue.
 * The warning required a ctx to be passed in, so that means
   changing a few function signatures.

https://www.opensc-project.org/opensc/ticket/389
2012-02-17 10:02:55 +01:00
Doug Engert 51630a844e Cleanup PKCS15 PIV Card PIN flags
If PIV card Discovery Object is present and Global PIN is preferred,
turn off the LOCAL flag.
2011-12-15 14:58:02 -06:00
João Poupino c6fcd68fbc Fix for ticket #400
Specify the path of the Address PIN for IAS-based cards in order to properly
read the Citizen Address Data object.  Remove the "Citizen Data" object
association with the Address PIN, as it incorrectly describes the card layout.

http://www.opensc-project.org/opensc/ticket/400.

Change-Id: I7ca81d6d15c5e2b137ff3c9a40b7471eb2fad55c
2011-12-07 12:49:17 +02:00
Peter Marschall 931e913599 iso7816.c: clean up iso7816_restore_security_env()
No need for response buffers for APDUs of the APDU_CASE_1 type.

This should fix OpenSC Ticket #299.
2011-09-09 13:42:52 +02:00
Peter Marschall 93816b37cd iso7816.c: slightly clean up iso7816_delete_file()
Only set the APDU's data element for the APDU_CASE3_SHORT type;
no need to do it for the APDU_CASE_1 type.
2011-09-09 13:42:52 +02:00
Martin Paljak 17bc2c8809 FINeID: fix for broken organisation cards.
Certain FINeID cards for organisations return 6A88 instead of 6A82 for missing files.
This makes sc_enum_apps fail and will result in unknown card behavior from OpenSC.

See http://www.opensc-project.org/pipermail/opensc-devel/2011-June/016910.html
2011-07-13 17:25:09 +03:00
Martin Paljak ea4eee5dc2 Merge remote-tracking branch 'ludovic/master' into proposed 2011-06-28 11:18:23 +03:00
Ludovic Rousseau a59ded782e Fix compiler warnings
ctx.c:679:7: warning: "ENABLE_CTAPI" is not defined
ctx.c:681:7: warning: "ENABLE_OPENCT" is not defined
2011-06-23 17:07:26 +02:00
Martin Paljak dcf9a8e0b2 setcos: remove useless #if 1 2011-06-17 12:12:38 +03:00
Martin Paljak 17c295ab1e Fix compiler warnings:
../../src/libopensc/cardctl.h:231:30: warning: comma at end of enumerator list
 ../../src/libopensc/cardctl.h:629:13: warning: comma at end of enumerator list
2011-06-16 15:58:55 +03:00
Martin Paljak bc307ae975 compiler warning: muscle.c:588:12: warning: unused variable ‘buffer_size’
Also remove asserts, production code is compiled with asserts turned off, thus the unused variable warning.
2011-06-16 15:49:04 +03:00
Martin Paljak 46e0c49d7b pcsc: correctly handle timeout situation when refreshing reader state.
The code that treated a timeout as success was never reached, because the
surrounding if eliminated the possibility of entering the block when the return code
from SCardGetStatusChange was SCARD_E_TIMEOUT.

Issue found by Coverity Scan.
2011-06-16 10:15:34 +03:00
Martin Paljak 1f870b0c07 pcsc: initialize variables
Patch by Frank Morgner

http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016659.html
2011-06-16 10:08:04 +03:00
Martin Paljak 27572537ce FinnishEid: fix the symbolic names for FINeID v2 cards with 2048 keys and restore compatibility with v2 cards with 1024 keys.
The more proper name for the 2048bit cards could be "v2.5".

Thanks to jem@iki.fi, kivinen@iki.fi and tuju@iki.fi for the patch.
2011-06-15 14:10:37 +03:00
Martin Paljak f4c39e20b1 Merge remote-tracking branch 'ludovic/PCSCv2_PART10_PROPERTY_bMaxPINSize' into proposed 2011-06-15 11:06:38 +03:00
Martin Paljak a3a8ae3ef9 Merge remote-tracking branch 'peter/OpenPGP-20110611' into proposed 2011-06-15 11:06:23 +03:00
Ludovic Rousseau 75524a5be8 Fix PIN min and max sizes for pinpads
Some pinpads do not support PIN size less than 4 or greater than 8.
PC/SC v2 part 10 allows to ask the driver/reader for the supported
values. This avoids to have the SECURE PIN CCID command rejected by the
reader.

This should fix OpenSC ticket #361 "card-entersafe should ask the pinpad
reader for the maximum pin size"
2011-06-14 15:54:49 +02:00
Ludovic Rousseau 3b63bf351e Add PCSCv2_PART10_PROPERTY_* values
These are the tag values returned by PC/SC v2 part 10
FEATURE_GET_TLV_PROPERTIES command.
2011-06-14 15:54:49 +02:00
Ludovic Rousseau 40cb1c9e35 Merge remote branch 'upstream/master' 2011-06-14 14:00:18 +02:00
Ludovic Rousseau 8936901e2b Correctly wait for card event
The timeout parameter of SCardGetStatusChange() is a DWORD (unsigned
int). An int timeout parameter was used instead.
The problem happens on 64-bits architectures where DWORD is 64-bits long
and int is only 32-bits long. The sign extension C mechanism transforms
the PC/SC value INFINITE into -1 instead of 4294967295.

See http://www.opensc-project.org/pipermail/opensc-devel/2011-June/016831.html
"Kobil KAAN Advanced Reader, "waiting for card" timeout"
2011-06-14 13:50:37 +02:00
vtarasov a6b7743088 pkcs15: add comments for the authentication object data type
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5569 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-13 09:23:30 +00:00
Peter Marschall 4939432304 OpenPGP: unlink blob from blob tree in pgp_free_blob()
Remove links pointing to the blob to be deleted from other blobs in the
blob tree structure, so that removing a subordinate blob does not hurt
its parent or siblings.

Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
Peter Marschall da5a223e26 OpenPGP: use pgp_new_blob() to setup MF blob
Use the standard way to create blobs, pgp_new_blob(), also for the MF.

Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
Peter Marschall 4ddec5d384 OpenPGP: add DO info entries for MF
For consistency, add DO info entries for the MF 3F00.

Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
Peter Marschall 961a27c921 OpenPGP: update pgp_list_files()
* fail if buffer passed as parameter is too small
* only list readable objects

Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
Peter Marschall 2e7406922f OpenPGP: re-factor gpg_new_blob()
* get file as parameter & fail if it is NULL
* allow parent to be NULL
* do not rely on DO info to be passed as parameter,
  search it yourself using the global DO info list for the card.
* infer file type automatically from DO info matching the file ID.

Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
Peter Marschall b6ee0e3d75 OpenPGP: immediately quit on allocation errors in init
Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
Peter Marschall e3fca4ac11 OpenPGP: remove DO info entry for DO FF
DO FF is a "catch-all" DO that returns all the infos contained in the other
DOs in one hierarchy.
It is hence duplicate and not necessary.

Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
Peter Marschall 01e63424f5 OpenPGP: fix algorithms & key lengths calculation
Also include forgotten DO C3 in keylength calculation.
It contains the parameters for the authentication key.

Signed-off-by: Peter Marschall <peter@adpm.de>
2011-06-11 09:30:46 +02:00
andre 93baf137c3 libopensc: Fix for drivers returning an error if a challenge of length zero was requested. Actually nothing is done when obtaining such a challenge, thus nothing could fail.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5564 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-09 10:59:04 +00:00
jps c5c2366a0b Revert 5558
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5562 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-08 07:58:51 +00:00
andre a28bacf02c libopensc: Reveal another Belpic hack introduced in r2117.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5561 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-08 07:35:03 +00:00
jps b422872813 For CardOS 4.3B and 4.4, the Verify Retry Counter Package
can be loaded at ADMINISTRATION life cycle phase to change
the behavior of the VERIFY command in regard to return codes.
When that package is loaded, the PIN can be created with this
"verifyRC" flag in cardos.profile if the return code must be 
ISO7816-4 compliant (63Cx with x being the value of the remaining 
retry counter when required verification has failed).



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5558 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-07 12:44:53 +00:00
andre 947cdad801 pkcs15.c: In function ‘compare_obj_flags’:
pkcs15.c:1115: warning: unused variable ‘data’

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5555 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-07 06:33:01 +00:00
vtarasov 226bfaac74 pkcs15: add few attributes to the biometric authentication data type ...
to make happy VS compiler


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5552 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 16:51:36 +00:00
vtarasov efc5760646 win32: build also static version the pkcs11 module
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5551 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 16:14:11 +00:00
vtarasov d888b3fd55 pkcs15: use general 'AuthenticationObject' instead of 'PinObject'
now the attributes of the previous 'pin-info' data type are included
as the sub-type attributes of the general 'auth-info' data .
It will allow to include support of the 'biometricTemplate' and 'authKey' authentication types.

http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016655.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5550 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 15:46:25 +00:00
vtarasov 32d035a9ad AuthentIC: when returning PIN info set the 'tries-left' data to the 'non-initialized' value
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5549 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 15:13:06 +00:00
vtarasov f45f22ca73 westcos: resolve signed/unsigned comparison warning
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5548 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 15:05:58 +00:00
vtarasov f9b1a1e102 pkcs15: in 'TokenInfo' data the 'serialNumber' attribut is optional
If 'serialNumber' attribute is absent in the 'TokenInfo' data,
in the parsed data, this attribute will be set to the value of the card's serial.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5547 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 15:01:15 +00:00
andre a9eba2b205 libopensc: Remove unused parameter 'file_out' in function 'sc_pkcs15_read_file'.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5546 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-05 11:08:36 +00:00
vtarasov 438cf4b2d4 RuToken-ECP: profile option to allow the reset of User PIN with SoPIN
http://www.opensc-project.org/pipermail/opensc-devel/2011-May/016716.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5542 c6295689-39f2-0310-b995-f0e70906c6a9
2011-06-02 19:06:43 +00:00