1
0
mirror of https://github.com/opencryptoki/opencryptoki.git synced 2026-10-24 05:39:17 +03:00

1465 Commits

Author SHA1 Message Date
Eduardo Barretto
1d0e4b2896 Bumping up to version-3.8.2
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:27:28 -02:00
Eduardo Barretto
daed7cb281 Update pkcsep11_migrate man page
This man page was lacking the necessity of setting the PKCS11_USER_PIN
environment variable before executing the pkcsep11_migrate tool.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:27:11 -02:00
Ingo Franzki
a3e3e1daa2 Fix writing of trace messages
A recent change in commit ecf145ec74
causes that no trace messages are written into the trace file.
This commit fixes the problem.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2017-11-23 17:26:55 -02:00
Eduardo Barretto
1cb21e2f0a Adjust ock_tests to also test single testcases and in parallel
Modified ock_tests so it can run also on a specified testcase instead of running
all tests. Also made it possible to run testcases in different tokens in
parallel.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:26:43 -02:00
Ingo Tuchscherer
35553cc669 Updated opencryptoki.conf man page
Added 'tokname' description for opencryptoki.conf man page

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-11-23 17:26:32 -02:00
Ingo Franzki
6cd951e1ab Allow to find hidden HW-feature objects using C_FindObjectsInit
C_FindObjectsInit has special handling for objects with
CKA_CLASS = CKO_HW_FEATURE as well as CKA_HIDDEN = TRUE.
This fix allows to find hidden HW-feature objects.

Without this fix, when CKA_HIDDEN = TRUE is found first in
the template, then CKA_CLASS = CKO_HW_FEATURE is ignored.
Also when CKA_CLASS = CKO_HW_FEATURE is found first, then
CKA_HIDDEN = TRUE is ignored. This causes that either hidden
or HW-feature objects can be searched for, but not both
together.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2017-11-23 17:26:18 -02:00
Ingo Franzki
c4d6deb44c Allow vendor defined hardware features
Allow vendor defined hardware features (those where
CK_HW_FEATURE_TYPE is >= CKH_VENDOR_DEFINED) for object
class CKO_HW_FEATURE in several template checking routines.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2017-11-23 17:25:58 -02:00
Ingo Franzki
0420041570 Fix debug output in dump_shm()
The debug output in dump_shm() is missing \n at the end of the
lines. This causes unreadable debug output.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2017-11-23 17:24:48 -02:00
Eduardo Barretto
e2756a8047 Fix bunch of unresolved symbols
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:22:47 -02:00
Eduardo Barretto
256d499019 Use ld flags to detect unresolved symbols
This patch fixes #31

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:22:27 -02:00
Ingo Franzki
5bc5c22daf EP11: Fix unresolved symbols in EP11 token
Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2017-11-23 17:22:02 -02:00
Ingo Franzki
735f7e0458 Fix compile errors and warnings in mech_dsa.c
Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2017-11-23 17:21:27 -02:00
Ingo Franzki
3f954b6e5b Token private data field in STDLL_TokData_t for multi-instance-token support
Introduce a field private_data in structure STDLL_TokData_t that allows
a token to anchor a pointer to a private control block to store all its
variables that are supposed to be global on a per token instance basis.

Instead of adding token specific fields for this purpose to the STDLL_TokData_t
structure (which is part of common code), the private_data field provides a
token implementation independent way of storing information on a per token
instance basis.

This patch also removes the EP11 specific field target_list from STDLL_TokData_t
into a EP11 specific private data block to keep STDLL_TokData_t free from any
token implementation specific fields.

Signed-off-by: Ingo Franzki <ifranzki@linux.vnet.ibm.com>
2017-11-23 17:20:34 -02:00
Eduardo Barretto
687bf9de53 Remove tmpfiles.conf from install and fix doc names
During install the tmpfiles.conf is copied together with pkcsslotd.service into
the usr/lib/systemd/system/. But we already have tmpfiles.conf as
opencryptoki.conf in the correct folder usr/lib/tmpfiles.d/. So we can remove
it.
Also fixed some documents name in spec file.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:19:22 -02:00
Eduardo Barretto
2885b75afb Remove some pkcs11_startup leftovers
The old (previous version 3) pkcs11_startup configuration script was still being
called and mentioned in some of the code. Removed it to fix.
There is still mentioning of pkcs11_startup in some documents, those should be
maintained.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:18:47 -02:00
Eduardo Barretto
0c7a1d00ac Remove unnecessary executable permission
Some files had a legacy executable permission that in not necessary. So, removed
it.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:08:05 -02:00
Eduardo Barretto
1819cbc27b Update rpm file to keep up with Fedora
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 17:05:01 -02:00
Paulo Vital
04c7426428 Fix spelling errors.
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-11-23 16:42:13 -02:00
Paulo Vital
fc93ae3762 Make sure the creation of tmpfiles.d
Add rule in Makefile to create the /usr/lib/tmpfiles.d directory
during the installation step.

Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-11-23 16:41:49 -02:00
Eduardo Barretto
6a849582f1 Bumping up to version-3.8.1
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 16:38:15 -02:00
Paulo Vital
4be158d9be Update travis.yml
Add packages to be installed to enable token build by default.
Now, with this configuration, the CCA, Software, ICSF and TPM
tokens will be built by default.

Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-11-23 16:37:41 -02:00
Paulo Vital
0f098053e7 Update configure.ac
Update checkings to build tokens. Now, CCA and Software tokens
are enabled by default. The others, when checked the dependencies
and requested to build, will be enabled.

Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-11-23 16:20:29 -02:00
Paulo Vital
943f3383ac Fix TPM data-structure reset function.
After the implementation of the Multi Token Instances (MTI) some
of the function signatures have changed and old patches provided
by the distros were not reflected.

This patch removes the call of the function
object_mgr_purge_private_token_objects() from the
clear_internal_structures(), since it has being called by the TPM
functions that calls clear_internal_structures().

Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-11-23 16:19:18 -02:00
Eduardo Barretto
1508e23d77 Fix error message when dlsym fails
This patch fixes #4

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-11-23 16:18:26 -02:00
Eduardo Barretto
2eeaefdd2f Bumping up to version-3.8.0
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
v3.8.0
2017-10-27 10:16:36 -02:00
David Smith
ee10a1cb26 Reset TPM datastructures on init, not just logout.
The TPM token code uses some global variables to track the storage
root key, root public & private keys, and leaf public & private keys
from the TPM. These variables are not properly reinitialized during
unload and reload of the module.

Patch applied from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=603104

This patch fixes #2

Signed-off-by: David Smith <dds@google.com>
Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com>
2017-10-26 11:29:56 -02:00
Eduardo Barretto
ecf145ec74 Fix some warnings regarding unused results
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-10-19 15:53:39 -02:00
Eduardo Barretto
fa389097e9 Fix needed so locks can make use of MTI
This changes were missing to make the implementation using locks to be able to
make use of MTI.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-10-17 17:01:36 -02:00
Ingo Tuchscherer
8d0b563658 Fix CKA_ALWAYS_AUTHENTICATE attribute for priv. keys
The PKCS#11 standard requires the CKA_ALWAYS_AUTHENTICATE attribute
to be present in private key objects. Actually this attribute is not
set as one of the default attributes. Further, it will be rejected
when it's declared within the application defined key template.

This fix will add the CKA_ALWAYS_AUTHENTICATE attribute by default
to any private key object. The value is set to 'false'. The calling
application is free to overrule by setting the attribute value
within the key template to 'true'.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-17 13:55:39 -02:00
Eduardo Barretto
a3d5f9e261 Add locking mechanism as alternative to transactional memory
As an alternative solution to transactional memory, the user can specify during
build time if he wants to make use of read/write locks implementation. Just
include --enable-locks in configure step.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-10-16 16:43:44 -02:00
Ingo Tuchscherer
6863ffdf9c Added check for duplicate token directories
Added some verification code to check that the opencryptoki
configuration file doesn't contain duplicate token names and
therefore overlapping token directories.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-16 14:31:43 -02:00
Ingo Tuchscherer
b7a11e34c7 Reorganize location of master_key [PATCH 03/03]
The TOKEN_DATA structure size has been increased due to additional
information. This will break the migrate path when trying to load
older NVTOK.DAT files into shared memory.

Restore the old TOKEN_DATA layout and move master_key to
STDLL_TokData_t will solve the issue.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-16 14:31:43 -02:00
Ingo Tuchscherer
a4d70ff519 Reorganize location of so_pin_md5 [PATCH 02/03]
The TOKEN_DATA structure size has been increased due to additional
information. This will break the migrate path when trying to load
older NVTOK.DAT files into shared memory.

Restore the old TOKEN_DATA layout and move so_pin_md5 to
STDLL_TokData_t will solve the issue.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-16 14:31:43 -02:00
Ingo Tuchscherer
2774bb6195 Reorganize location of user_pin_md5 [PATCH 01/03]
The TOKEN_DATA structure size has been increased due to additional
information. This will break the migrate path when trying to load
older NVTOK.DAT files into shared memory.

Restore the old TOKEN_DATA layout and move user_pin_md5 to
STDLL_TokData_t will solve the issue.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-16 14:31:43 -02:00
Eduardo Barretto
306327391a Remove unnecessary SOURCE and include
Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-10-10 10:53:47 -03:00
Eduardo Barretto
38ef2cd9c3 Check glibc version as some distros still use _BSD_SOURCE
We had moved from the deprecated _BSD_SOURCE to _DEFAULT_SOURCE, but some
distros are still running on older versions of glibc, so to avoid
incompatibility we check for the glibc and define the necessary source.

Signed-off-by: Eduardo Barretto <ebarretto@linux.vnet.ibm.com>
2017-10-10 10:53:47 -03:00
Ingo Tuchscherer
37ddac38ec Token individual locking [PATCH 04/04]
Each token gets his own lockfile. The file handle is stored in
the token individual data structure. The locking functions are
called with token individual lockfiles.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 16:44:11 -03:00
Ingo Tuchscherer
abc200e1ed Token individual locking [PATCH 03/04]
Preparation: Move the lock_init, lock_creation functions
onto the right position, right after Tokdata instanciation.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 16:44:11 -03:00
Ingo Tuchscherer
28c9777103 Token individual locking [PATCH 02/04]
Preparation: Passing the Tokdata information into the login(),
destroy_object() function since it will be needed for the locking
mechanism.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 16:44:11 -03:00
Ingo Tuchscherer
94d87b11fc Token individual locking [PATCH 01/04]
Preparation: Passing the Tokdata information into the attach(),
detach() function since it will be needed for the locking mechanism.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 16:44:11 -03:00
Ingo Tuchscherer
76baa3ac72 Fix token directory access permissions
The access permissions of the token directories are not set correctly
under certain circumstances. Enforce correct permissions using umask
while creating token directories.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 16:44:11 -03:00
Ingo Tuchscherer
0cc62a6645 Multi token instances - description
Added a short description in the ep11 documentation with a
configuration example

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 16:44:11 -03:00
Ingo Tuchscherer
d6619af8ee MTI [PATCH 85/85]: Increase token number limit
Increase the number of tokens that can be plugged to opencryptoki.
The new maximum number is set to 1024.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
1aef8a0629 MTI [PATCH 84/85]: Adapt token library load count
Adapt the token library load count to consider multiple tokens that
are using the same shared token library.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
73af75fc61 MTI [PATCH 83/85]: Adapt TPM token helper functions
Adapt TPM token helper functions with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
1cf262a5ce MTI [PATCH 82/85]: Adapt ICSF token helper functions
Adapt ICSF token helper functions with respect to the newly
introduced token data storage.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
d9782105f5 MTI [PATCH 81/85]: Fix EP11 Makefile
Fix EP11 Makefile in order to pull in all required sources that are
required in case the EP11 token is the only token type at start time.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
88e075d267 MTI [PATCH 80/85]: Fix EP11 mechanism list compliance
Define dummy mech_list container in order to avoid build problems.
Internally the EP11 don't use a static mechanism list. It retrieves
the supported mechanisms from the crypto adapter directly.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
98c9dcd5fa MTI [PATCH 79/85]: EP11: Remove redundant token init check
Remove redundant check of correct token initialization in Finalize
function.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00
Ingo Tuchscherer
7732df4409 MTI [PATCH 78/85]: EP11: Remove mechanism list on init
Remove EP11 mechanism list at initializatin time since this will
decrease the performance when running with a large number of tokens.

Signed-off-by: Ingo Tuchscherer <ingo.tuchscherer@linux.vnet.ibm.com>
2017-10-06 15:39:43 -03:00