Commit Graph

35 Commits

Author SHA1 Message Date
Peter Marschall 5abe99d228 fix typos
Mass-typo fixing, almost exclusively in comments and text strings.

While at it also fixed a few (very few) grammar errors.
2018-04-15 09:34:45 +02:00
Jakuje dae323ea50 License clarification (#988)
* License clarification: Olaf Kirch

> Please refresh my memory; what is the license of the other files in
> pkcs15init and the pkcs11 code that I authored? Any files missing
> license information should use the same.

https://sourceforge.net/p/opensc/mailman/message/35704660/

* License clarificaiton: Vincent Le Toux

> Do whatever you want with it ;-)
https://sourceforge.net/p/opensc/mailman/message/35704731/

* License clarification: Ludovic Rousseau

> So the license should be the same as for pcsc-lite i.e. 3-clause BSD
> license as in, the original,
> https://github.com/LudovicRousseau/PCSC/blob/master/src/PCSC/winscard.h

> I added a license in the strlcpycat.h file for pcsc-lite. See
> https://github.com/LudovicRousseau/PCSC/blob/master/src/strlcpycat.h

https://sourceforge.net/p/opensc/mailman/message/35705399/
2017-03-14 22:47:13 +01:00
Frank Morgner 0f2b9a4a4e Merge pull request #543 from frankmorgner/appveyor
Use AppVeyor as good as we can
2015-09-10 16:40:58 +02:00
Frank Morgner 819a6686c9 use _WIN32 instead of WIN32 2015-09-10 15:23:18 +02:00
Frank Morgner cf2a9cbbb0 added call back for getting vendor/product id
implementation taken from
83142d4cae
2015-09-02 10:47:29 +02:00
Frank Morgner c92e3b4f98 honour PC/SC pt 10 dwMaxAPDUDataSize
closes #306
2015-07-28 09:49:44 +02:00
vletoux 3b873adad2 win32: allows UNICODE built.
UNICODE is set by default by Visual Studio (but can be deactived)
The trick is to force ANSI version by appending a A to the function calls.
2015-03-29 13:54:51 +02:00
Frank Morgner a7564d6f1e Use C99 flexible array member
The structures PIN_MODIFY_STRUCTURE and PIN_VERIFY_STRUCTURE now use a
C99 flexible array member when available for abData field.

uint8_t abData[];

See http://lists.alioth.debian.org/pipermail/pcsclite-cvs-commit/2013-May/006191.html
2013-08-02 15:18:07 +02: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 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
martin 19da5d8f16 WindowsInstaller: Fix Mingw32 Windows build
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4793 c6295689-39f2-0310-b995-f0e70906c6a9
2010-10-06 07:10:44 +00:00
ludovic.rousseau 31d1a552d3 Use (SCARD_READERSTATE *) instead of LPSCARD_READERSTATE since
LPSCARD_READERSTATE is not define in old pcsc-lite (< 1.6.3) nor Mac OS X


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4631 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 09:33:56 +00:00
martin 484d484c21 PC/SC: Fix building on OS X and mingw32 after r4626
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4628 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-16 08:59:05 +00:00
ludovic.rousseau 947c3291db Use SCARD_READERSTATE instead of SCARD_READERSTATE_A
SCARD_READERSTATE_A is not used by Microsoft API and is no more
defined/used by pcsc-lite >= 1.6.2

Thanks to Josef Windorfer for the bug report
http://www.opensc-project.org/pipermail/opensc-user/2010-August/004235.html


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4626 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-15 14:57:34 +00:00
martin 9f639f48c4 Add back MAX_ATR_SIZE which was erroneously removed in r4611. Fixes mingw32 build.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4622 c6295689-39f2-0310-b995-f0e70906c6a9
2010-08-13 09:27:38 +00:00
ludovic.rousseau c7a99c2e03 Use || instead of | in a #if check
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4619 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-30 07:09:15 +00:00
martin 5c2c12bb78 Trac #244: Fix structure packing on Apple and SUN. Fix display detection by updating structure definitions.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4611 c6295689-39f2-0310-b995-f0e70906c6a9
2010-07-26 13:16:37 +00:00
flc 0e03c6d5cf add cardmod a minidrivers for windows
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4001 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-05 13:05:25 +00:00
martin d006b1845e libopensc:
- Remove slot abstraction from internal API and all reader drivers. CT-API (from where it all comes from) readers with multiple slots (if still found) can be presented as separate readers, OpenCT should remove the slot abstraction, PC/SC never knew about it. None of the tools knew how to use slots.
 - Add sc_cancel (translates to SCardCancel)
 - Re-implement sc_wait_for_event; support a blocking call.
 - Replace the "int reader" API with "* sc_reader_t" style; add "Get reader by name" functionality.
 - Remove "action" parameter from sc_disconnect_card() (was not used)


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3931 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-24 15:25:08 +00:00
martin 7ce6c1d05e PC/SC: Add SCardCancel to please mingw
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3903 c6295689-39f2-0310-b995-f0e70906c6a9
2010-01-10 18:44:02 +00:00
martin f6d4da7919 PC/SC: Improve core and pinpad code
* Make opensc-tool -l display pinpad capabilities, if available
 * Detect reader capabilities when a reader is found, not when a connection to a card is opened
 * Fix unpadded PIN block parameters to not be rejected by the latest free CCID driver
 * When locking the card and it has been reset by some other application (or re-attached), clear cache and lock again
 * Enable pinpad detection by default


git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3730 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 09:48:56 +00:00
martin cd5aff8ea0 PC/SC: More return codes are handled.
git-svn-id: https://www.opensc-project.org/svnp/opensc/branches/martin/0.12@3726 c6295689-39f2-0310-b995-f0e70906c6a9
2009-09-14 09:03:33 +00:00
martin 9668f0aa33 Add support for LCD detection on pinpad devices.
* Update IOCTL definitions to PC/SC part 10 v2.02.05 
 * Return SC_SUCCESS instead of 0 if returning SC_ codes.
 * Detect the presence of a display with FEATURE_IFD_PIN_PROPERTIES

Tested with patched CCID driver on OS X, with SPR532 (no display) and OK3821 (with display)

Known CCID reader with a display:

ATMEL_AT91SO.txt:  wLcdLayout: 0x0210
CardMan3821.txt:  wLcdLayout: 0x0210
Kobil_EMV_CAP.txt:  wLcdLayout: 0x0210
Xiring_XI-SIGN.txt:  wLcdLayout: 0x020C
Xiring_XI-SIGN_6000.txt:  wLcdLayout: 0x020C




git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3666 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-21 11:09:12 +00:00
alonbl cd6adb4e26 Fix Windows PINPAD mingw issue
Thanks to François Leblanc

http://www.opensc-project.org/pipermail/opensc-devel/2009-March/011932.html



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3662 c6295689-39f2-0310-b995-f0e70906c6a9
2009-03-07 21:55:40 +00:00
alonbl 304f227d79 Add SCARD_E_NO_SERVICE to internal-winscard.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3632 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-20 08:45:12 +00:00
alonbl fbd51c705e Revert 3630
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3631 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-20 08:42:47 +00:00
alonbl ce5c5f3ae9 Add SCARD_E_NO_SERVICE to internal-winscard.h
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3630 c6295689-39f2-0310-b995-f0e70906c6a9
2009-01-19 19:43:19 +00:00
ludovic.rousseau 6e56f8384a #include <wintypes.h> on __APPLE__ to define DWORD, LONG, etc. Windows types
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3603 c6295689-39f2-0310-b995-f0e70906c6a9
2008-12-11 09:18:09 +00:00
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 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
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 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 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
alonbl 0a809dd5cb Complete rewrite of OpenSC build system.
1.  Build system now supports MinGW (Windows) compilation using msys and cross compilation.
2.  Ability to explicitly disable and enable dependencies of the package.
3.  openct, pcsc and nsplugins features are disabled by default.
4.  Modified pcsc driver to use pcsc dynamically, no compile time dependency is required.
5.  --enable-pcsc-lite configuration option renamed to --enable-pcsc.
6.  Install opensc.conf file (as opensc.conf.new if opensc.conf exists).
7.  Add--enable-doc configuration option, allow installing documentation into target.
8.  Add --disable-man configuration option, allow msys mingw32 users to
    build from svn without extra dependencies.
9.  Add export files to each library in order to export only required symbols.
    Windows native build may use these files instead of scanning objects' symbols.
10. Add opensc-tool --info to display some general information about the build.
11. Create compatibility library to be linked against library instread of recompiling the
    same source files in different places.
12. Add different win32 version resource to each class of outputs.
13. Make xsl-stylesheets location selectable.
14. Some win32 fixups.
15. Some warning fixups.
16. Many other autoconf/automake cleanups.

Alon Bar-Lev

svn diff -r 3315:3399 https://www.opensc-project.org/svn/opensc/branches/alonbl/mingw

_M   .
D    configure.in
_M   src
_M   src/openssh
M    src/openssh/Makefile.am
_M   src/tools
M    src/tools/rutoken-tool.c
M    src/tools/opensc-tool.c
M    src/tools/cardos-info.c
M    src/tools/pkcs15-crypt.c
M    src/tools/pkcs15-init.c
M    src/tools/piv-tool.c
M    src/tools/netkey-tool.c
M    src/tools/eidenv.c
M    src/tools/cryptoflex-tool.c
M    src/tools/util.c
M    src/tools/pkcs11-tool.c
M    src/tools/pkcs15-tool.c
M    src/tools/util.h
M    src/tools/opensc-explorer.c
M    src/tools/Makefile.am
_M   src/pkcs11
M    src/pkcs11/pkcs11-global.c
M    src/pkcs11/framework-pkcs15.c
M    src/pkcs11/mechanism.c
M    src/pkcs11/pkcs11-display.c
M    src/pkcs11/pkcs11-object.c
A    src/pkcs11/opensc-pkcs11.exports
M    src/pkcs11/sc-pkcs11.h
M    src/pkcs11/pkcs11-spy.c
M    src/pkcs11/openssl.c
M    src/pkcs11/Makefile.am
A    src/pkcs11/pkcs11-spy.exports
_M   src/tests
_M   src/tests/regression
M    src/tests/regression/Makefile.am
M    src/tests/sc-test.c
M    src/tests/pintest.c
M    src/tests/Makefile.am
_M   src/include
_M   src/include/opensc
M    src/include/opensc/Makefile.am
A    src/include/opensc/svnignore
M    src/include/Makefile.am
_M   src/signer
_M   src/signer/npinclude
M    src/signer/npinclude/Makefile.am
M    src/signer/Makefile.am
A    src/signer/signer.exports
_M   src/common
A    src/common/compat_dummy.c
D    src/common/getopt.txt
D    src/common/strlcpy.c
D    src/common/LICENSE
A    src/common/compat_getopt.txt
A    src/common/compat_strlcpy.c
A    src/common/LICENSE.compat_getopt
A    src/common/compat_getopt.c
D    src/common/strlcpy.h
D    src/common/ChangeLog
D    src/common/getpass.c
D    src/common/my_getopt.c
A    src/common/compat_strlcpy.h
A    src/common/compat_getpass.c
A    src/common/compat_getopt.h
A    src/common/ChangeLog.compat_getopt
D    src/common/README.strlcpy
D    src/common/my_getopt.h
A    src/common/compat_getpass.h
A    src/common/README.compat_strlcpy
D    src/common/strlcpy.3
A    src/common/README.compat_getopt
D    src/common/getopt.3
D    src/common/README.my_getopt
A    src/common/compat_strlcpy.3
A    src/common/compat_getopt.3
M    src/common/Makefile.am
M    src/Makefile.am
_M   src/pkcs15init
M    src/pkcs15init/pkcs15-oberthur.c
M    src/pkcs15init/profile.c
M    src/pkcs15init/pkcs15-lib.c
M    src/pkcs15init/pkcs15-rutoken.c
A    src/pkcs15init/pkcs15init.exports
M    src/pkcs15init/pkcs15-gpk.c
M    src/pkcs15init/Makefile.am
_M   src/scconf
M    src/scconf/Makefile.am
M    src/scconf/parse.c
A    src/scconf/scconf.exports
_M   src/libopensc
M    src/libopensc/card-rutoken.c
M    src/libopensc/compression.c
M    src/libopensc/sc.c
M    src/libopensc/card-piv.c
M    src/libopensc/pkcs15-openpgp.c
M    src/libopensc/pkcs15-postecert.c
M    src/libopensc/pkcs15-tcos.c
M    src/libopensc/opensc-config.in
M    src/libopensc/reader-pcsc.c
A    src/libopensc/internal-winscard.h
M    src/libopensc/ctx.c
A    src/libopensc/libopensc.exports
M    src/libopensc/pkcs15-piv.c
M    src/libopensc/pkcs15-infocamere.c
M    src/libopensc/internal.h
M    src/libopensc/pkcs15-actalis.c
M    src/libopensc/pkcs15-starcert.c
M    src/libopensc/card-oberthur.c
M    src/libopensc/pkcs15-atrust-acos.c
M    src/libopensc/p15card-helper.c
D    src/libopensc/part10.h
M    src/libopensc/ui.c
M    src/libopensc/card-gpk.c
M    src/libopensc/pkcs15-wrap.c
M    src/libopensc/pkcs15-gemsafeGPK.c
M    src/libopensc/log.c
M    src/libopensc/pkcs15-esteid.c
M    src/libopensc/pkcs15-prkey-rutoken.c
M    src/libopensc/log.h
M    src/libopensc/Makefile.am
M    src/libopensc/reader-openct.c
_M   aclocal
M    aclocal/Makefile.am
_M   win32
M    win32/Makefile.am
A    win32/versioninfo.rc.in
A    win32/ltrc.inc
A    configure.ac
_M   doc
_M   doc/tools
M    doc/tools/pkcs15-profile.xml
D    doc/changelog.sh
D    doc/export-wiki.xsl
_M   doc/api
_M   doc/api/file
M    doc/api/man.xsl
_M   doc/api/asn1
_M   doc/api/apps
_M   doc/api/init
_M   doc/api/types
_M   doc/api/card
M    doc/api/html.xsl
_M   doc/api/misc
_M   doc/api/util
M    doc/Makefile.am
D    doc/export-wiki.sh
AM   doc/nonpersistent
A    doc/nonpersistent/export-wiki.xsl
A    doc/nonpersistent/Makefile.am
A    doc/nonpersistent/export-wiki.sh
A    doc/nonpersistent/svn2cl.xsl
D    doc/generate-man.sh
D    doc/svn2cl.xsl
M    Makefile.am
A    svnignore
_M   etc
M    etc/opensc.conf.in
M    etc/Makefile.am
D    man
_M   solaris
M    solaris/Makefile



git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3405 c6295689-39f2-0310-b995-f0e70906c6a9
2008-03-06 16:06:59 +00:00