Commit Graph

227 Commits

Author SHA1 Message Date
Frank Morgner c4a75eb1c2 updated NEWS file with CVEs 2020-11-12 11:14:17 +01:00
Frank Morgner 2f6ab4c1a2
Prepare RC1 of 0.21.0 (#2117) 2020-10-03 01:11:33 +02:00
Peter Marschall 16c889cf7d spelling fixes
Fix various spelling errors, mostly in comments but also in texts displayed.

Errors found & interactively fixed using 'codespell', with additional manual
checks after the fixes.
2020-08-30 10:35:14 +02:00
Jakub Jelen b02da8348b configure: Do not check for strlcpy and strlcat in Linux.
The check is broken with clang and standard glibc does not have these anyway

And unbreak fuzzer build failure

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=22192
2020-05-26 10:03:23 +02:00
Frank Morgner b08d33ceb6 Travis: seperate installer packages not needed anymore 2020-05-11 18:41:16 +02:00
Frank Morgner 178c4a9eaa fixed checking for strlcat/strlcpy
newer clang uses a definition rather than a function
2020-05-11 18:41:16 +02:00
Doug Engert 8a5a1435f1 pkcs15-tool.c - print Supported_algorithms from tokenInfo
Some cards can provide supported algorithms in tokenInfo
which contain ECDSA OID, and PKCS11 mechanism

Don't know how many Algo_refs were actually read,
and a ref of 0 may be valid. print at least one Algo_refs.

Print the mechanism from PKCS11, and print operations
Use the $(top_srcdir)/src/pkcs11/pkcs11-display.c  on Unix
Use the $(TOPDIR)\src\pkcs11\pkcs11-display.obj on Windows

pkcs15.tool.c treat ECDSA OID as inline

pkcs15-tool prints PKCS11 mechanisms using pkcs11-display.c
Automake now warns that the default will change, in the future
so "[subdir-objects]" is added to configure.ac

 Changes to be committed:
	modified:   configure.ac
	modified:   src/tools/Makefile.am
	modified:   src/tools/Makefile.mak
	modified:   src/tools/pkcs15-tool.c
2020-05-09 23:59:51 +02:00
Jakub Jelen be57a4bf0f configure: Do not overwrite passed CFLAGS 2020-05-07 02:32:46 +02:00
Marcin Cieślak 768bd1dde7 Check if we HAVE_ENDIAN_H
BSDs will have <sys/endian.h>, Linux just <endian.h>
2020-04-03 09:52:08 +02:00
Frank Morgner 267aea759c use platform dependant implementation of erasing memory
fixes potentially insecure use of memset in CWA SM implementation

fixes https://github.com/OpenSC/OpenSC/issues/1957
2020-03-06 12:23:16 +01:00
Charlène 2f7d0cf20f Put user supplied CFLAGS on top priority 2020-02-07 08:57:26 +01:00
Jakub Jelen 9a6cf6af3e configure: Add option to generate code coverage (for unit tests)
./configure --enable-code-coverage --disable-optimization
make check
make code-coverage-capture
lcov --summary OpenSC-*-coverage.info

This does not work well with Windows so on windows it should be disabled (WIP)
2020-01-07 17:07:48 +01:00
Jakub Jelen 8e6d2e251d unittests: Reproducer for undefined shift in ASN1 parser 2020-01-07 14:50:47 +01:00
Priit Laes 295cf100a8 Bump minimum required openssl version to 1.0.1
Everything older than 1.0.2 is not longer supported by the OpenSSL team.
2020-01-06 15:47:07 +01:00
Frank Morgner e9957b9a92 include build-package-from-ci in autoconfig/automake 2019-12-02 16:54:32 +01:00
Frank Morgner 12218d4b0b prepare 0.20.0 2019-09-05 14:24:30 +02:00
Pierre-Louis Palant b0241eefa1 Integrated virt_CACard in CI jobs (#1757)
Was: "Implement OpenSC CI without HW cards" (https://github.com/OpenSC/OpenSC/pull/1757)
2019-08-20 15:17:14 +02:00
Frank Morgner 8f838bc1e0 fixed passing LIB_FUZZING_ENGINE 2019-08-19 16:44:54 +02:00
Frank Morgner 755ac78a02 added fuzzing with libFuzzer and OSS-Fuzz
makes cmocka detection not required for building tests
2019-07-26 15:23:02 +02:00
Frank Morgner 1423c6bb90 CI: integrate clang-tidy (disabled)
files that have warnings are currently excluded
2019-05-21 19:34:46 +02:00
Raul Metsma 3d22d04113 No need link to libssl
Signed-off-by: Raul Metsma <raul@metsma.ee>
2019-04-25 14:52:43 +02:00
Frank Morgner 6f9b58af72 added pkcs11-register 2019-04-08 11:16:13 +02:00
Frank Morgner f1e9108502 fix cygwin build
fixes https://github.com/OpenSC/OpenSC/issues/607
2019-04-01 12:54:06 +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 993f6f5cc6 Use opensc-pkcs11.so for static build of pkcs11-tool
Statically link opensc-pkcs11 into pkcs11-tool with --disable-shared
2019-01-30 21:57:59 +01:00
Jakub Jelen 8fb611bb1c Move the test into separate directory
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
2018-12-06 09:27:50 +01:00
Frank Morgner 027ccad439 allow specifying the size of OpenSSL secure memory
... and set it for builds where we're linking OpenSSL statically (i.e.
Windows and macOS)

fixes https://github.com/OpenSC/OpenSC/issues/1515
2018-11-13 15:50:17 +01:00
Priit Laes 1f06a76b1a openssl: Bump openssl requirement to 0.9.8 2018-09-14 08:21:40 +02:00
Priit Laes 9fa730bb95 openssl: PKG_CHECK_MODULES can take a list of packages. Use this for openssl 2018-09-14 08:21:40 +02:00
Priit Laes 9d16e6e177 openssl: Use define for openssl minimum version specification 2018-09-14 08:21:40 +02:00
asc 0ab5b92dc5 Allow building tests on Ubuntu 16.04, which has libcmocka 1.0.1 (#1405) 2018-08-30 13:27:36 +02:00
Frank Morgner b5a6f9aa6e prepare 0.19.0 2018-08-27 13:40:20 +02:00
Frank Morgner a0b6643fa7 Use hard coded default SM module (path)
- avoids the need to set this default in opensc.conf
- fixes loading of (unknown) local library
- removes some unused defines from config.h
2018-07-17 14:49:27 +02:00
Frank Morgner 47ee3a3978 added manual page opensc.conf(5)
splits the HTML documentation into files.html and tools.html
2018-07-17 14:49:27 +02:00
Frank Morgner 376de5bd4c make bash completion directory configurable 2018-07-11 21:55:05 +02:00
Jakub Jelen e9314adf4b Testsuite also depends on openssl, use correct variables for linking 2018-07-11 10:48:10 +02:00
Stanislav Brabec b0a20fa7ca Use correct bash-completion path
Recent versions of bash is leaving /etc/bash_completion.d. The correct
directory is specified by pkg-config --variable completionsdir
bash-completion.

Fixes https://github.com/OpenSC/OpenSC/issues/1403
2018-07-04 09:50:07 +02:00
Jakub Jelen f9f3bc3ae0 configure: Check for cmocka header file 2018-06-21 12:48:57 +02:00
Jakub Jelen 3998fffbdc configure: Use correct variables for testsuite 2018-06-21 12:48:57 +02:00
Peter Marschall cedc5a1cf6 configure.ac: remove references to help2man
Now that we have proper DocBook sources for all man pages formerly
generated using help2man, it is not needed anymore.
2018-06-06 22:43:46 +02:00
Peter Marschall 59a7478011 configure.ac: extend AC_INIT
Define macro PRODUCT_URL and use it as additional argument to AC_INIT().
2018-05-21 20:45:04 +02:00
Peter Marschall c57c743ed0 configure.ac: stop including version.m4
Do not blindly override already defined variables or macros with
outdated values by including version.m4

This makes sure the definitions of variables or macros defined earlier
in configure.ac remain intact; e.g. it keeps the macro PRODUCT_BUGREPORT
set to the GitHub URL instead of pointing to a SourceForge mail address.
2018-05-21 20:45:04 +02:00
Jakub Jelen 9858d05589 PKCS#11 testsuite (#1224)
* Initial version of pkcs11 testsuite

* Refactor test cases to several files, clean up awful and unused stuff

* Static mechanism list based on the actual token offer

* Get rid of magic numbers

* Documentation

* License update based on the original project

* Verbose readme

* Cleanup unused code, long lines and method order

* Typo; More verbose errors

* Use fallback mechanisms

* Refactor object allocation and certificate search

* PKCS11SPY mentioned, more TODO

* add SHA mechanisms

* Do not try to Finalize already finalized cryptoki

* Add more flags and mechanisms

* Do not list table for no results

* Logical order of the tests (regression last)

* read ALWAYS_AUTHENTICATE from correct place

* ALWAYS_AUTHENTICATE for decryption

* Test EC key length signature based on the actual key length

* Shorten CKM_ list output, add keygen types detection

* Skip decrypting on non-supported mechanisms

* Fail hard if the C_Login fails

* Reorganize local FLAGS_ constants

* Test RSA Digest mechanisms

* Correct mechanisms naming, typos

* Do not attempt to do signature using empty keys

* CKM_ECDSA_SHA1 support

* Correct type cast when getting attributes

* Report failures from all mechanisms

* Standardize return values, eliminate complete fails, documentation interface

* Wait for slot event test

* Add switch to allow interaction with a card (WaitForSlotEvent)

* At least try to verify using C_Verify, if it fails, fall back to openssl

* Get rid of function_pointers

* Get rid of additional newline

* Share always_authenticate() function between the test cases

* Refactor Encrypt&decrypt test to functions

* Do not overwrite bits if they are not provided by CKA, indentation

* Cleanup and Break to more functions Sign&Verify test

* CKM_RSA_X_509 sign and verify with openssl padding

* More TODO's

* Proper abstracted padding with RSA_X_509 mechanism

* Add ongoing tasks from different TODO list

* Update instructions. Another todo

* Variables naming

* Increase mechanism list size, use different static buffers for flags and mechanism names

* nonstandard mechanism CKM_SHA224_RSA_PKCS supported by some softotkens

* Get rid of loop initial declarations

* Loop initial declaration, typos, strict warnings

* Move the p11test to the new folder to avoid problems with dynamically linked opensc.so

* Update path in README

* Possibility to validate the testsuite agains software tokens

* Add possibility to select slot ID on command-line (when there are more cards present)

* Clean up readme to reflect current options and TODOs

* Do not attempt to use keys without advertised sign&verify bits to avoid false positives

* Get and present more object attributes in readonly test; refactor table

* New test checking if the set of attributes (usage flags) is reasonable

* Test multipart signatures. There is not reasonable mechanism supporting multipart encryption

* Use PKCS#11 encryption if possible (with openssl fallback)

* Identify few more mechanisms (PSS) in the lest

* Resize table to fit new mechanisms

* Remove initial loop declaration from multipart test

* Use pkcs11-tool instead of p11tool form most of the operations (master have most of the features)

* Preparation for machine readable results

* Refactor log variables out of the main context, try to export generic data

* Do not write to non-existing FD if not logging

* Export missing data into the log file in JSON

* Store database in json

* Sanity check

* Avoid uninitialized structure fields using in state structure

* Dump always_authenticate attribute too

* Manual selection of slots with possibility to use slots without tokens

* Do not free before finalizing

* Proper cleanup of message in all cases

* Proper allocation and deallocation of messages

* Sanitize missing cases (memory leaks)

* Suppressions for testing under valgrind

* Better handling message_lengt during sign&verify (avoid invalid access)

* Suppress another PCSC error

* Do not use default PIN. Fail if none specified

* Sanitize initialization. Skip incomplete key pairs

* Add missing newline in errors

* Fix condition for certificate search

* Avoid several calls for attributes of zero length

* Handle if the private key is not present on the card

* Improve memory handling, silent GCC warning of 'unused' variable

* Fail early with missing private key, cleanup the messages

* Use correct padding for encryption

* Cache if the card supports Verify/Encrypt and avoid trying over and over again

* Loosen the condition for the Usage flags

* OpenSSL 1.1.0 compatibility

* Add missing mechanisms

* Do not require certificates on the card and pass valid data for RSA_PKCS mechanisms

* Add missing PIN argument in runtest.sh

* Add OpenSSL < 1.1 comatible bits

* Add SHA2 ECDSA mechanisms handling

* Use public key from PKCS#11 if the certificate is missing (or compare it with certificate)

* Avoid long definitions in OpenSSL compat layer

* In older OpenSSL, the header file is ecdsa.h

* Add missing config.h to apply compat OpenSSL layer

* ASN1_STRING_get0_data() is also new in 1.1.0

* Return back RSA_X_509 mechanism

* Drop bogus CKM_* in the definitions

* Drop CKM_SHA224_RSA_PKCS as it is already in pkcs11.h

* Update documentation

* Use NDEBUG as intended

* typos, cleanup

* Typos, cleanup, update copyright

* Additional check for OpenCryptoki, generate more key types on soft tokens

* Prepare for RSA-PSS and RSA-OAEP

* Use usage&result flags for the tests, gracefully ignore PSS&OAEP

* pkcs11.h: Add missing definitions for PSS

* PSS and OAEP tests

readonly: Typos, reformat

* Working version, memory leak

* Tweak message lengths for OAEP and PSS

* Skip tests that are not aplicable for tokens

* configure.ac: New switch --enable-tests

Do not attempt to build tests if cmocka is not available or
--enable-tests is provided. It makes also more lightweight release
builds out of the box (or with --disable-tests).

* travis: Install cmocka if not available

* Do not build tests on Windows and make dist pass

* Try to install cmocka from apt and from brew

* Do not require sudo (cmocka from apt and brew works)
2018-05-18 12:31:55 +02:00
Frank Morgner b4bc6de81b prepare 0.18.0 2018-04-13 18:43:18 +02:00
Frank Morgner 74bdcad4e8 fixed description of --disable-strict 2018-04-06 12:20:32 +02:00
Igor Castañeda Ferreira 5d5caecfab Fix DNIe UI integration (#1280) 2018-03-09 14:37:38 +01:00
Frank Morgner 3f0d5ce336 opensc-notify: register a desktop menu entry
- fixes showing notifications in gnome-shell via gio2
- removes gdbus interface for notifications
- fixes https://github.com/OpenSC/OpenSC/issues/1186
2017-11-21 13:01:12 +01:00
Frank Morgner 7d0f05b247 removed unused compile options 2017-11-09 12:42:29 +01:00
Frank Morgner 08ca27197a treat warnings as errors 2017-11-09 12:42:29 +01:00
Frank Morgner 04a7075290 fixed compiler warnings 2017-11-09 12:42:29 +01:00