Commit Graph

87 Commits

Author SHA1 Message Date
Frank Morgner 991bb8a141 add CPDK include flags 2021-04-08 15:15:46 +02:00
Frank Morgner b91cfa8cd7 reverted accidental change of default flags 2020-03-10 12:20:31 +01:00
Frank Morgner f1bcadfbe9 pkcs11: don't try to allocate 0 byte with calloc
fixes #1978
2020-03-10 12:15:04 +01:00
Frank Morgner fe24707c00 win32: recognize WiX libs for VS2017/2019 2020-03-05 12:04:58 +01:00
Frank Morgner b89fbce9f2 make OPENSSL_DIR configurable 2020-03-05 12:04:58 +01:00
Raul Metsma 7fb0696a29 Upgrade OpenSSL to 1.1.1
Version 1.0.2 is deprecated

Signed-off-by: Raul Metsma <raul@metsma.ee>
2020-03-05 12:04:58 +01:00
opensignature 84f0a88edb Remove postecert and infocamere support because no longer issued (#1584)
* Remove postecert and infocamere support because no longer issued

* Remove wrong changes

* reset NEWS

* EC_POINT_set_affine_coordinates_GFp and EC_POINT_get_affine_coordinates_GFp are
deprecated, use EC_POINT_set_affine_coordinates and EC_POINT_get_affine_coordinates

* If OPENSSL API version is < 3 use old functions EC_POINT_[sg]et_affine_coordinates_GFp

* Move the OpenSSL compatibility stuff to src/libopensc/sc-ossl-compat.h
2019-01-30 22:01:24 +01: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
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 4444d24f59 win32: generate PDB files for releases
https://msdn.microsoft.com/fsk896zz.aspx

fixes https://github.com/OpenSC/OpenSC/issues/1191
2017-11-21 10:54:48 +01:00
Frank Morgner 08ca27197a treat warnings as errors 2017-11-09 12:42:29 +01:00
Frank Morgner 19d9ec7d5d msvc: don't warn about deprecated crt functions
See https://msdn.microsoft.com/de-de/library/ms235384.aspx
2017-10-27 19:48:22 +02:00
Frank Morgner 498aedd165 Merge remote-tracking branch 'upstream/master' into winui 2017-10-16 15:16:34 +02:00
Frank Morgner 9b772ebdc4 win32: switch back to OpenSSL 1.0.2 as default
AppVeyor changed the default version back to 1.0.2, see
https://github.com/appveyor/ci/issues/1671
2017-08-04 08:44:41 +02:00
Frank Morgner b2cde0f7fb Windows: Added support for notifications 2017-08-02 19:03:16 +02:00
Frank Morgner c57c9c36bf md: added themable PIN-pad dialog
- themable in the sense of using OS native design
- user messages on PIN pad dialog are identical to Base CSP, which still displays the dialog for PIN entry if no PIN pad is available
- adds progress bar to dialog
- Uses Smartcard icon extracted from DDORes.dll
- requires windows vista/windows server 2008 or above
2017-08-02 19:00:07 +02:00
Frank Morgner 7a39d6d058 build against OpenSSL 1.1.0 on Windows, by default
- build with AppVeyor's OpenSSL 1.1.0
- updates AppVeyor version of OpenPACE

Fixes https://github.com/OpenSC/OpenSC/issues/1108
2017-07-24 21:39:01 +02:00
Frank Morgner fb8fccd7ba AppVeyor: cache openpace build 2017-06-05 00:09:33 +02:00
Frank Morgner ad451bd201 AppVeyor: cache zlib build 2017-06-05 00:09:33 +02:00
Frank Morgner 2536365d79 removed BUILD_ON/BUILD_FOR variable
- guess the system architecture based on %PROCESSOR_ARCHITECTURE%
- guess the target system based on %PLATFORM%
2017-06-05 00:09:33 +02:00
Frank Morgner eb19691efe added compatibility with WiX 3.11 2017-06-05 00:09:33 +02:00
Frank Morgner 74ec7b04ff sc-hsm: Add support for SoC
- eac: allow CA without EF.CardSecurity
- sc-hsm: implemented CA based on document PKI
- sc-hsm: adds receive limit for SoC card
- introduces dedicated card type for SoC card
- md: integrate card's PIN pad capabilities
- installer: added SC-HSM SoC card to registry
- pkcs15-tool: Added support for PIN entry on card
- change/unblock PIN: add support for PIN entry on card
- added OpenPACE to macOS build
- travis-ci: install gengetopt/help2man via brew
- sc-hsm: Cache EF.C_DevAut
- sc-hsm: Prevent unnecessary applet selection and state resets
- sc-hsm: added support for session pin
- sc-hsm: avoid multiple AID selection
- sc-hsm: Use the information from match_card for all subsequent selections of the applet
- sc-hsm: cache optional files as empty files (Decoding the files will reveal that they were not existing prior caching. This avoids selecting the file though we have already tried to cache the file before.)
- use dedicated directory for CVC trust anchors
- appveyor: added OpenPACE to windows build
2017-05-22 16:25:08 +02:00
Frank Morgner a4f64d9439 Added (external) card driver for German ID card
(Imported libcardnpa from https://github.com/frankmorgner/vsmartcard)

- Added generic SM implementation of ISO/IEC 7816-8
- Added implementation of extended access control as defined by
  - BSI TR-03110
  - ICAO Doc 9303
  - ISO/IEC 7501
- Added tool for German ID card (and other EAC tokens)
- renamed folder libsm to sm
2017-03-20 21:28:48 +01:00
Frank Morgner 0898d06944 fixed and cleaned up nmake Makefiles 2016-06-23 07:35:53 +02:00
LE TOUX Vincent 6a243449a0 First support for GIDS card
- minidriver included by default in Windows
- GIDS Applet is available here https://github.com/vletoux/GidsApplet
- some informative technical information is available here
  http://www.mysmartlogon.com/knowledge-base/generic-identity-device-specification-gids-kb/

closes https://github.com/OpenSC/OpenSC/pull/651
2016-02-19 00:12:16 +01:00
Viktor Tarasov aa8ad8d5b2 build: restore build on Win32 2016-01-22 17:32:40 +01:00
LE TOUX Vincent 40440e70f4 add zlib compilation into the appveyor built process
zlib feature now available for x64
2015-12-26 18:44:57 +01:00
LE TOUX Vincent 48782e768d appveyor: fix wix lib not found 2015-12-23 18:52:49 +01:00
LE TOUX Vincent 9a6e11e28a appveyor: fix wcautil.h not found 2015-12-23 18:46:30 +01:00
vletoux 8a47f238de win32: link OpenSSL statically again 2015-11-01 13:35:05 +01:00
Frank Morgner 90fb40f65e include zlib1.dll and libeay32.dll in installer 2015-09-30 07:13:59 +02:00
Frank Morgner a7bd14c77f Builds lightweight Windows binaries by default
... without OpenSSL and zlib
2015-09-25 10:58:53 +02:00
Frank Morgner 97f8731402 Properly describe OpenSSL dependencies in WiX installer 2015-09-24 09:40:52 +02:00
Frank Morgner e14e028453 Properly describe OpenSSL dependencies in .mak files 2015-09-23 08:23:28 +02:00
Frank Morgner 428385d8b4 adjust Make.rules.mak to work with AppVeyor
- The AppVeyor configuration of VS2014/VS2015 does not currently work
  with this script
- We are using the pre-built zlib binaries. As consequence, we can build
  the 32 bit installer only. Also, we can't use static linking anymore
- The current pre-built binaries of OpenSSL from
  https://slproweb.com/products/Win32OpenSSL.html include security
  measures (https://blogs.microsoft.com/cybertrust/2012/01/26/enhancements-to-gs-in-visual-studio-11/)
  that are not compatible with our version of VS `(error LNK2001:
  unresolved external symbol ___report_rangecheckfailure)`. That's why
  we can't use static linking anymore

works with
- OpenSSL 1.0.2
- zlib 2.1.8
- WiX 3.10
2015-09-14 10:52:31 +02:00
vletoux 0b683472b0 win32 setup: add basic minidriver card registration and unregistration via a custom action 2015-05-10 15:04:44 +02:00
vletoux 9e07a75968 detect the wix components installed on the build machine 2015-05-10 15:04:44 +02:00
vletoux 5a1ca44c11 custom action skeleton (without actions) - help welcome ... 2015-05-10 15:04:44 +02:00
Viktor Tarasov 53ed5dc502 win32: build: 'version-info' resource for each target 2013-12-29 22:00:29 +01:00
Viktor Tarasov 7c05e8ce21 win32: build debug version, updates to MSI
Build with debug options,
include profiles and SM module into MSI.
2012-06-08 20:17:36 +02:00
Viktor Tarasov 6bddab7417 win32: 'Minimal Size' code optimization 2011-06-14 11:34:25 +02:00
martin 7c17247446 WindowsInstaller: enable zlib by default.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5330 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 07:48:53 +00:00
martin 44cf3d06ae MiniDriver: rename cardmod to minidriver in source.
Also change some grammar, whitespace (reported by git) and wording (Opensc->OpenSC) issues.
Add some comments here and there.

See http://www.opensc-project.org/pipermail/opensc-devel/2011-April/016261.html

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5329 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-12 07:40:12 +00:00
martin 639ca655b6 WindowsInstaller: Correct support for x64 builds
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5327 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-11 14:42:48 +00:00
martin 25c2d497b2 WindowsInstaller: reduce the warning level, parsing error output on level 4 takes Jenkins warnings plugin 25 minutes.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5295 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-06 08:10:25 +00:00
martin 2c5583513b WindowsInstaller: Using /Wall was a bad idea, use /W4 instead.
http://stackoverflow.com/questions/4001736/what-with-the-thousands-of-warnings-in-standard-headers-in-msvc-wall

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5290 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-04 08:04:10 +00:00
martin 282f6dc6db Enable all warnings on MSVC
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5289 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-04 07:44:19 +00:00
martin d0639e0776 WindowsInstaller: Separate makefile changes for building for x64 and building on x64.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5287 c6295689-39f2-0310-b995-f0e70906c6a9
2011-04-03 07:41:56 +00: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
martin 5ab9919610 WindowsInstaller: link against crypt32.lib
libeay32MT.lib(e_capi.obj) : error LNK2019: unresolved external symbol __imp__CertFreeCertificateContext@4 referenced in function _capi_free_key

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5285 c6295689-39f2-0310-b995-f0e70906c6a9
2011-03-31 12:04:57 +00:00