Commit Graph

1339 Commits

Author SHA1 Message Date
alonbl d7941bf850 Re-add pcsc-lite compile-time dependency
Win64 changed the SCARDCONTEXT from LONG to ULONG_PTR,
pcsc-lite did not follow this on 64bit platforms.
This breaks the pcsc module.

To solve this we use installed winscard.h in order to get proper
declerations.

As mingw32 does not have winscard.h we keep current types. mingw64 and
pcsc-lite system have winscard.h.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3590 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-27 19:16:28 +00:00
alonbl 4ad85b3d91 Add some more debug information to pcsc
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3589 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-26 19:13:14 +00:00
alonbl d771870d5c Resolve some conflict with win64
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3588 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-26 14:48:47 +00:00
ludovic.rousseau d2f428590b use 0x%08lx instead of 0x08%lx
Thanks to Alon Bar-Lev for the patch


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3587 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 15:04:29 +00:00
ludovic.rousseau 4a1e1192a6 display PC/SC error codes as 0x08%lx instead of %lx to make it explicit
they are hex values


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3586 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 07:46:24 +00:00
ludovic.rousseau b4c5c8d539 use SCARD_S_SUCCESS instead of 0
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3585 c6295689-39f2-0310-b995-f0e70906c6a9
2008-10-20 07:27:41 +00:00
alonbl ff4d6dd101 Fix for two apparent C code bugs
By Stanislav Brabec

entersafe_init_pin_info() was declared as int, but defined and used as
void, resulting in a function returning an unused pseudo-random value.

card-gemsafeV1.c uses comparison 'type == "DF"', which is always false,
as it compares pointer to a string with pointer to the string "DF" in
the code.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3563 c6295689-39f2-0310-b995-f0e70906c6a9
2008-09-10 12:44:40 +00:00
aj 9468d989cf Douglas E. Engert:
The pkcs15-gemsafeV1.c code assumes that the key_ref is always 3. But that is
not always the case. In our case it is 4. The patch tries to determine the
key_ref by looking at what appears to be a table of allocated keys, and picking
the first allocated key. 

In case this is not always true, the patch will also allow for the the
opensc.conf card flag = n to specify the key_ref as the low order 4 bits of the
flag.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3557 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-20 15:17:59 +00:00
aj 27d00f9265 Add new entersafe driver for ePass 3000 tokens.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3556 c6295689-39f2-0310-b995-f0e70906c6a9
2008-08-20 05:41:20 +00:00
aj 07247596d6 Apply security fix.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3552 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 13:25:16 +00:00
aj e243e7f322 make the sign_with_decrypt hack configureable.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3546 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 12:17:29 +00:00
aj 29d78fde39 move checks to pkcs15_bind, where we can look at the config.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3545 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-31 12:13:15 +00:00
cg2v 973bf9a791 export a GET DATA operation for cardos so opensc-explorer's do_get works
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3540 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-27 15:50:01 +00:00
alonbl 4fc6c498ed Make PC/SC work on Windows again
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3535 c6295689-39f2-0310-b995-f0e70906c6a9
2008-07-02 09:55:32 +00:00
alonbl 7534621a89 Revert pic changeset
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3533 c6295689-39f2-0310-b995-f0e70906c6a9
2008-06-09 08:32:42 +00:00
alonbl c18dbe5669 More aclocal->m4
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3532 c6295689-39f2-0310-b995-f0e70906c6a9
2008-06-09 08:31:38 +00:00
ludovic.rousseau 96064e195c add missing prototype for sc_pkcs15emu_rutoken_init_ex()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3523 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:30:37 +00:00
ludovic.rousseau bdaf49b0c8 add missing prototype for sc_pkcs15emu_tcos_init_ex()
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3522 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:30:16 +00:00
ludovic.rousseau 82314eaa56 do not use system as a variable name. system() is also a function
card-akis.c:400: warning: declaration of 'system' shadows a global declaration
/usr/include/stdlib.h:730: warning: shadowed declaration is here


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3521 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:26:08 +00:00
ludovic.rousseau 99a16c66db remove two unused variables
reader-pcsc.c:739: warning: unused variable 'rv'
reader-pcsc.c:862: warning: unused variable 'again'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3520 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:23:25 +00:00
ludovic.rousseau ca2da1bd67 Avoid variable name space collision
reader-pcsc.c:396: warning: declaration of 'priv' shadows a previous local
reader-pcsc.c:367: warning: shadowed declaration is here
reader-pcsc.c:909: warning: declaration of 'reader' shadows a previous local
reader-pcsc.c:901: warning: shadowed declaration is here 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3519 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-22 12:22:23 +00:00
alonbl e14cf57ad1 Better handle openct reader replug, revert last change in pkcs11-pin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3512 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-10 09:55:01 +00:00
alonbl a40cf036bb Fix sc_pkcs15_verify_pin() to handle OpenCT hotplug correctly
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3511 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-09 22:22:41 +00:00
ludovic.rousseau 91177e51ec Use size_t instead of int when needed, plus some other minor changes
Patch bug.1 included in Ticket #176


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3510 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-05 13:00:01 +00:00
alonbl 96b0f4a670 Verify PIN support Plug&Play
If card was reset or reader reconnected, verify can restart
transaction, as upper level will not cache PIN in this case.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3508 c6295689-39f2-0310-b995-f0e70906c6a9
2008-05-02 17:56:52 +00:00
alonbl e237574742 Plug&Play support
This is not the best solution, but focus on smallest code change.

Changes:

1. Add detect_readers() to reader opts, this adds new readers to the end
   of the readers list until list is full.

2. Add sc_ctx_detect_readers() that calls readers' detect_readers().

3. Fixup pcsc_lock() so that it reconnect to the card and report proper
   error so caller may be notified if session was lost.

4. Allow context to be created without readers.

5. Call sc_ctx_detect_readers() from PKCS#11 C_GetSlotList with NULL_PTR.

6. Allow no reader at detect_card, as reader my be removed.

7. Since I broke ABI, I updated the external module version requirement
   to match OpenSC version. In the future a separate version should be
   maintained for each interface, this should be unrelated to the package
   version.

Alon

---

svn merge -r 3480:3505 https://www.opensc-project.org/svn/opensc/branches/alonbl/pnp

M    src/tools/opensc-tool.c
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/slot.c
M    src/libopensc/reader-pcsc.c
M    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
M    src/libopensc/reader-ctapi.c
M    src/libopensc/libopensc.exports
M    src/libopensc/reader-openct.c
M    src/libopensc/opensc.h


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3506 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 17:01:19 +00:00
alonbl c862f88ce7 SIGSEGV print_tags_recursive - fix
Patch opensc-0.11.4.trunk-r3502-fix-segv_print_tags_asn1.diff (for trunk
trunk revision 3502) is draft.


Example 1 (SIGSEGV):

OpenSC Explorer version 0.11.4-svn
OpenSC [3F00]> cd ff00
OpenSC [3F00/FF00]> asn1 0001
Printing tags for buffer of length 512
[Switching to Thread -1211906368 (LWP 25131)]

By Aktiv Co. Aleksey Samsonov



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3504 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 06:11:34 +00:00
alonbl 6c740b907e More MSVC fixups by Douglas E. Engert
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3503 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-29 06:09:00 +00:00
ludovic.rousseau e928d5565c convert C++ in C comment
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3502 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:57:03 +00:00
ludovic.rousseau c1311c8c6a card.c:756: warning: unused variable 'j'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3496 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:24:57 +00:00
ludovic.rousseau ab99cc50bd convert C++ comment in C comment (ISO C90)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3495 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-28 07:23:03 +00:00
alonbl 104ff0ed66 rutoken: Some MSVC fixups, by Aktiv Co. Aleksey Samsonov
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3490 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-24 16:34:08 +00:00
alonbl 8d7bce4de2 ruToken fixups
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011057.html

By Aktiv Co. Aleksey Samsonov



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3478 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-18 14:08:23 +00:00
alonbl 5d218007c3 Fix last reference to VERSION and not PACKAGE_VERSION
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3475 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-16 04:32:56 +00:00
alonbl 865f6e9c70 More fixups to maintainer-clean
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3471 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-11 12:52:46 +00:00
alonbl d84077749b Distribute autoconf generated files for MSVC build
Construct resource files and winconfig.h using autoconf
substitutions.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3468 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-08 18:36:42 +00:00
alonbl 54c1c735f3 Attached are the latest mode to OpenSC svn 3462 to use the Makefile.mak
files to build on Windows.

I got rutoken to compile, and took out the #ifdef's I had in last week.
The rutoken programmer declared some variables in the middle of a block
rather then having all the declare statements at the beginning of a block
as is normally done in C. The Microsoft compile treats this as an error.
(Actual many errors.)

The makedef.pl is no longer needed, as the exports files can be used.
Note that in the original Makefile.mak files only opensc.def and
pkcs15init.def were created.

winconfig.h has a number of changes. As discussed last week this could
be created by autoconf. I also noted that the Active State Perl that
was required for the makedef.pl has a psed command that could be used
like sed to update winconfig.h.  I did not attempt to do this.



  win32/Make.rules.mak - Use ENABLE_OPENSSL and ENABLE_ZLIB

  src/tools/Makefile.mak - add the rutoken.tool.exe

  src/tools/eidenv.c - use PACKAGE_VERSION

  src/pkcs11/Makefile.mak - reorder the objest to match the list in the
           Makefile.am. Makes it easier to read.

  src/include/winconfig.h - The windows version of the config.h
           Changes based on discussions on the list last week.

  src/common/Makefile.mak - renamed modules.

  src/pkcs15init/Makefile.mak - reordered, and added back the rutoken modules
           replaced the use of makdef.pl to sue the exports file.

  src/scconf/Makefile.mak - reordered objects.

  src/libopensc/card-rutoken.c -
           error. Moved the declares to the beginning of blocks.

  src/libopensc/Makefile.mak - reorder names, and add rutoken.
           Use the libopensc.exports file.

  src/libopensc/pkcs15-prkey-rutoken.c - more moving of declare statements.

By Douglas E. Engert

http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011011.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3464 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 19:42:43 +00:00
alonbl 66d819a3a6 ruToken C fixups
http://www.opensc-project.org/pipermail/opensc-devel/2008-April/011011.html

By Douglas E. Engert



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3463 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-07 19:25:21 +00:00
alonbl 6e65efb257 Some more build cleanups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3462 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 20:38:20 +00:00
alonbl 6f22611438 Fix some duplicate symbols with Windows header files.
Thanks to Douglas E. Engert.



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3460 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 16:46:50 +00:00
alonbl ac0c291f9c Fixup WINAPI location
By: Douglas E. Engert

 (2) Change the typdefs for the SC_*_t routines.
  The WINAPI had to be moved. For example from:
    typedef PCSC_API LONG (*SCardEstablishContext_t)...
  to:
    typedef LONG (PCSC_API *SCardEstablishContext_t)...



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3458 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 06:05:38 +00:00
alonbl 317ad765c5 Solve some Windows conflicts
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3457 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-04 05:39:34 +00:00
alonbl 0e2c664d34 Rename PC/SC library into PC/SC provider.
Sync symbols between configuration and source.
Put default provider in opensc.conf, opensc-tool.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3455 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-02 05:44:12 +00:00
alonbl 87db3c96c2 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3450 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 19:04:33 +00:00
alonbl 39abe22798 More separate srcdir fixups
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3449 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 17:08:17 +00:00
ludovic.rousseau 7e30721378 use $(srcdir) when needed to be able to build in separate build
directories using: cd foobar ; ../configure srcdir=..

Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010959.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3445 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 12:43:26 +00:00
ludovic.rousseau 9ffe2e159d use "pkcs15.h" instead of <opensc/pkcs15.h> (and similar)
Thanks to Douglas E. Engert for the patch
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010959.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3444 c6295689-39f2-0310-b995-f0e70906c6a9
2008-04-01 12:35:08 +00:00
alonbl 80a16f686d ruToken cleanups
Move constants out of standard files.
Create ruToken specific interface.
Update symbols.

Thread at:
http://www.opensc-project.org/pipermail/opensc-devel/2008-March/010917.html

Cleanup of:
http://www.opensc-project.org/pipermail/opensc-devel/2007-December/010617.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3439 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-26 06:24:37 +00:00
alonbl a88a543940 Fixup compile under cygwin
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3431 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-19 20:30:36 +00:00
ludovic.rousseau 8436f089c5 pkcs15-gemsafeV1.c:478: warning: 'sc_pkcs15emu_add_pubkey' defined but
not used


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3430 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-17 15:17:56 +00:00