Commit Graph

30 Commits

Author SHA1 Message Date
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
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 bf828014e5 macOS: Added support for notifications
- adds framework for user defined message strings
- automatically determine the system's language
2017-08-02 19:02:05 +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
Viktor Tarasov 3f30e14087 sm: move SM common crypto procedures to the dedicated library
rename 'sm' source directory
2013-01-04 22:29:59 +01:00
Viktor Tarasov 2249cfde72 sm: loadable 'local' secure-messaging module
With loadable secure-messaging module the SM wrapping of APDUs is performed
by entity external to the running application.
So that the SM keysets

TODO: amend detailed description
2012-06-08 20:17:36 +02: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
dengert c5b2b021be opensc-cardmod.dll can now by built as "static"
using the VS. The dll will contain all of OpenSC,
OpenSSL and zlib in a single dll, and thus can
reside anywere. Without this, winlogin would require
it to reside in system32. 


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@5212 c6295689-39f2-0310-b995-f0e70906c6a9
2011-02-18 20:48:22 +00:00
vtarasov c8c291ea07 win32: build of MSI on checkouted trunk ...
is possible after 'bootstrap' and 'configure'


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4942 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-12 13:17:17 +00:00
vtarasov aed53df545 win32: test 'BUILD_MSI' condition and build MSI
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4934 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-09 09:21:57 +00:00
vtarasov 04c5cb955b win32: control from Make.rules.mak the including of 'cardmod'
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4920 c6295689-39f2-0310-b995-f0e70906c6a9
2010-12-06 15:47:03 +00:00
aj d22a2483c0 Header file cleanup.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@4081 c6295689-39f2-0310-b995-f0e70906c6a9
2010-03-04 08:14:36 +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
aj 4b2fe63ac2 build only one shared library instead of many.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@3971 c6295689-39f2-0310-b995-f0e70906c6a9
2010-02-01 15:12:53 +00:00
aj 21e3b71029 use ltdl not scdl.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2564 c6295689-39f2-0310-b995-f0e70906c6a9
2005-09-09 14:43:59 +00:00
aj 96519c6b72 stop building libp11 and the ssl engines.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2523 c6295689-39f2-0310-b995-f0e70906c6a9
2005-08-28 20:18:52 +00:00
sth e3b11a0aa4 Don't build libp11 if we don't have OpenSSL support
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2434 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-18 12:13:48 +00:00
aj 944904fac5 remove scrandom code. We will implement proper code to get random data
from the card itself.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2418 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-17 20:10:13 +00:00
aj 4818083938 move p11_* into a new library.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2387 c6295689-39f2-0310-b995-f0e70906c6a9
2005-07-10 17:01:03 +00:00
aet f2663f5d7c - Fixed a typo (Bernhard Froehlich)
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2185 c6295689-39f2-0310-b995-f0e70906c6a9
2005-02-13 11:41:45 +00:00
sth 08c3cc90fa Simplified the procedure to link with openssl on Windows: now you only need to slightly change Make.rules.mak instead of hacking in several Makefile.mak files
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2077 c6295689-39f2-0310-b995-f0e70906c6a9
2005-01-16 21:12:38 +00:00
aet bac2b601a9 Move scdl to it's own subdirectory, although it's merely
for internal purposes only.


git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1403 c6295689-39f2-0310-b995-f0e70906c6a9
2003-09-01 08:43:38 +00:00
sth 0cb9a18963 Some Windows fixes
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1233 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-27 12:32:57 +00:00
sth c0b8b08e9c Also compile the sslengines dir under Windows
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@1199 c6295689-39f2-0310-b995-f0e70906c6a9
2003-06-13 12:45:11 +00:00
okir 29dd06ba9f - more win32 fixes from Stef
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@779 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-17 16:00:40 +00:00
okir d997440546 - more Makefile.mak fixes from Stef
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@772 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-12 10:08:23 +00:00
okir 23158d7a96 - win32 patch from Stef Hoeben
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@769 c6295689-39f2-0310-b995-f0e70906c6a9
2002-12-10 17:47:19 +00:00
aet 9c4844ede7 Build PKCS#11 module for win32 port.
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@717 c6295689-39f2-0310-b995-f0e70906c6a9
2002-11-17 20:26:25 +00:00
fabled 7635468ed9 - Initial support for win32
git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@654 c6295689-39f2-0310-b995-f0e70906c6a9
2002-06-14 12:52:56 +00:00