Commit Graph

102 Commits

Author SHA1 Message Date
Frank Morgner fe44567d2b avoid redefinition of NDEBUG
fixes https://github.com/OpenSC/OpenSC/issues/1799
2020-01-07 11:27:57 +01:00
Frank Morgner 94388f9538 fixed more clang-tidy warnings 2019-06-05 13:48:51 +02:00
Frank Morgner b7b501d0a5 fixed issues reported by clang-analyzer 2019-05-21 19:34:46 +02:00
Frank Morgner 0bc95cb6a1 added include guards 2019-05-02 10:08:28 +02:00
Frank Morgner fc9277b778 use compat_getopt_long if getopt_long is not available
uses the autoconf way for replacing getopt.h

fixes https://github.com/OpenSC/OpenSC/issues/1527
2019-03-25 14:30:09 +01:00
Frank Morgner fdb0e6d581 Fixed Potential leak of memory 2019-02-14 09:22:23 +01:00
Frank Morgner 745b8cf420 added include guards to compatibility headers 2019-01-20 23:02:21 +01:00
Frank Morgner 5c7b7bb0b1 fixed minor XCode documentation warnings 2018-11-01 00:17:22 +01:00
Vadim Penzin 195d53b8a2 Fix division by zero in SimCList when appending to an empty list. 2018-10-16 12:10:04 +02:00
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
Frank Morgner 4317df10e6 created opensc-asn1
fixes installation of egk-tool.exe on win32
2017-11-17 10:03:54 +01:00
Frank Morgner d4befcc2e5 fixed unused dependency 2017-11-09 12:42:29 +01:00
Frank Morgner 4251a362b5 fixed potential memory leak 2017-11-09 12:42:29 +01:00
Frank Morgner 04a7075290 fixed compiler warnings 2017-11-09 12:42:29 +01:00
Frank Morgner 5bd4716ea0 added missing include 2017-10-27 19:48:22 +02:00
Jakub Jelen e2fe24d56a clang static analyzer reports
tools/pkcs15-tool.c:
	Dead assignment: Value stored to 'c' is never read
tools/pkcs11-tool.c:
	Dead assignment: Value stored to 'n' is never read
	Dead assignment: Value stored to 'rv' is never read
libopensc/card-cac.c:
	Dead assignemnt: Value stored to 'tl_head_len' is never read
	Dead increment: Value stored to 'outp' is never read
common/libpkcs11.c:
	Memory leak in case of C_UnloadModule() fails
libopensc/pkcs15-pubkey.c:
	Potential memory leaks
pkcs11/mechanism.c:
	Potential memory leak
pkcs11/framework-pkcs15.c:
	Potential memory leaks
	Dereference of null pointer
	Dead assignments
tools/sc-hsm-tool.c:
	Function call argument is an uninitialized value
	Dead assignment: Value stored to 'r' is never read
libopensc/card-openpgp.c:
	Dead assignment: ignoring the errors in case of sc_pkcs15_encode_pubkey() failed
libopensc/pkcs15-cac.c:
	Dead assignments: ignoring return values
libopensc/pkcs15-coolkey.c:
	Dead assignments: ignoring return values
libopensc/card-sc-hsm.c:
	Dereference of undefined pointer value: Properly check the file allocation
pkcs11/slot.c:
	Dead assignment
pkcs15init/pkcs15-cflex.c:
	Dereference of null pointer
	Uninitialized argument values
2017-07-18 22:40:20 +02:00
Frank Morgner 6bfb39454b Fix missing error handling of memory allocation (#1020)
* libopensc: handle allocation errors
* handle more faults during memory allocation

fixes several situations that cause segmentation fault
2017-04-20 21:08:49 +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
Jakuje 777e2a3751 adding a CAC support into OpenSC (#841)
* Includes adding support for parsing extensions from a certificate.
* Move lebytes2ushort() to related functions in internals.h
* Adds Simple TLV related functions
2017-02-27 11:05:12 +01:00
Jakub Jelen 24346062c0 libpkcs11: Prevent double-free when the dlopen fails 2016-11-22 21:21:06 +01:00
Jakuje 12f4026160 Fix Coverity remarks (#876) 2016-10-10 22:21:46 +02:00
Frank Morgner 28958af559 added compatibility function for VC14 2016-10-07 14:17:40 +02:00
Frank Morgner 0898d06944 fixed and cleaned up nmake Makefiles 2016-06-23 07:35:53 +02:00
Doug Engert 81e91c70f3 Handle C and C++ "inline" and "restrict" keywords for various compilers
simclist.h is changed to either accept a predefined inline and/or
predefined restrict macro or tests for known compilers and sets
simclist_inline and simclist_restrict with the approprate keyword
for the compiler being used or defines them as blank.

The logic used is based on code in OpenSSL-1.1 e_os2.h

For example, "configure" could define inline and/or restrict.
But OpenSC is built on other platforms without a config.h and thus
changes to simclist.h are still needed.

simclist.c is changed by replacing inline with simclist_inline
and restrict with simclist_restrict.

The one and only use of inline in card-dnie.c is removed as there
is no need to have the function inline. This avoids any inline issues.

If inline is needed in other OpenSC code or in card-dnie.c,
simclist_inline could be used.

(Another option is to just remove all inline and restrict keywords
from OpenSC code.)

 Changes to be committed:
	modified:   src/common/simclist.c
	modified:   src/common/simclist.h
	modified:   src/libopensc/card-dnie.c
2016-03-22 15:51:36 +01:00
Frank Morgner 83d5ac5fee remove compat_strnlen.obj from windows build
windows already implements this function
2016-02-16 07:15:36 +01:00
Frank Morgner 500e358ea7 fixed syntax error 2016-02-16 07:11:57 +01:00
Frank Morgner 89f9d9e85d add compatibility implementation for strnlen
fixes https://github.com/OpenSC/OpenSC/issues/660
2016-01-20 10:47:27 +01:00
Frank Morgner 622b71970f add compat_report_rangecheckfailure.c to libcompat 2015-11-01 21:02:34 +01:00
vletoux 8a47f238de win32: link OpenSSL statically again 2015-11-01 13:35:05 +01:00
Olaf Kirch f42a1c2563 Replace outdated address okir@lst.de -> okir@suse.de
Signed-off-by: Olaf Kirch <okir@suse.de>
2015-10-05 14:07:28 +02:00
Frank Morgner 819a6686c9 use _WIN32 instead of WIN32 2015-09-10 15:23:18 +02:00
Frank Morgner bcb5fc15e5 honour HAVE_CONFIG_H 2015-04-22 23:55:33 +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 7a34c204c1 fixed dereference before null check
silence warnings reported by coverity-scan
2015-01-22 20:29:33 +01:00
Nikos Mavrogiannopoulos 218d198bdc Call dlclose() only when having a valid handle.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
2014-04-21 20:23:11 +02:00
Viktor Tarasov f641ebd248 fixed errors reported by cppcheck: part 1
partially applied the pull request #182 from Frank Morgner -- updated the common frameworks source files
2013-09-29 20:28:45 +02:00
Frank Morgner d5e86752de added getpass implementation for non windows
modifies terminal attributes to emulate _getch
2013-09-29 19:19:17 +02:00
Frank Morgner e3649fb7de fixed even more compiler warnings 2013-08-02 15:43:25 +02:00
Ludovic Rousseau ea40e7fe24 Use AM_CPPFLAGS instead of INCLUDES
Fix autoreconf warnings:

$ autoreconf -vis -Wall
[...]
src/common/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/libopensc/Makefile.am:19: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/minidriver/Makefile.am:15: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/pkcs11/Makefile.am:10: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/pkcs15init/Makefile.am:36: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/scconf/Makefile.am:12: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/sm/Makefile.am:8: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/tests/Makefile.am:9: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
src/tools/Makefile.am:15: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2012-09-25 23:03:38 +02:00
Viktor Tarasov cb13633634 remove trailing whitespaces
inspired by
http://www.opensc-project.org/pipermail/opensc-devel/2012-March/017883.html

Change-Id: If170e830d8d9587a31742feffb6fff54cfdf75b4
2012-04-03 00:00:56 +02:00
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
Ludovic Rousseau b9c43b9214 Remove a useless cast in sc_dlopen() 2011-06-21 13:56:40 +02:00
Ludovic Rousseau d3c13fd471 Fix compiler warning
libscdl.c: In function 'sc_dlerror':
libscdl.c:86: warning: old-style function definition
2011-06-21 13:53:08 +02:00
martin ea7eb699e5 WindowsInstaller: build for x64 with nmake -f Makefile.mak BUILD_TYPE=WIN64
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5286 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-01 08:06:25 +00:00
ludovic.rousseau 18ca8b94e1 Fix compiler warning
ibscdl.c:30: warning: no previous prototype for 'sc_dlopen'
libscdl.c:35: warning: no previous prototype for 'sc_dlsym'
libscdl.c:40: warning: no previous prototype for 'sc_dlerror'
libscdl.c:45: warning: no previous prototype for 'sc_dlclose'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5249 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:02:18 +00:00
ludovic.rousseau a88972b36a Fix compiler warning
libscdl.c: In function 'sc_dlerror':
libscdl.c:38: warning: old-style function definition


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5248 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 15:00:04 +00:00
ludovic.rousseau e2c1756a1c Fix compiler warning
libpkcs11.c: In function 'C_LoadModule':
libpkcs11.c:37: warning: implicit declaration of function 'lt_dlinit'
libpkcs11.c:37: warning: nested extern declaration of 'lt_dlinit'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5247 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 14:58:45 +00:00
ludovic.rousseau 5fd2ef4b12 Fix compiler warning
libscdl.h:24: warning: function declaration isn’t a prototype


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5245 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-23 14:55:23 +00:00
martin 8f4dfe2c85 Amend r5201: put libscdl.h/libpkcs11.h to distribution package and link against libltdl where needed.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5210 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-17 20:46:13 +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