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

20 Commits

Author SHA1 Message Date
Ingo Franzki
594f41b08b TOOLS: Fix ICSF mock server to handle too short output buffers for en/decypt
When the caller provides a too short output buffer, send back RSN_TOO_SHORT
to correctly indicate this situation.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2026-10-22 12:53:13 +02:00
Ingo Franzki
1fe94e4332 TOOLS: Enhance ICSF mock server to support wrap and unwrap of DH private keys
Add support for wrapping and unwrapping of DH private keys.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2026-10-19 13:52:53 +02:00
Ingo Franzki
9c3440a37d TOOLS: Fix ICSF mock server to handle sensitive attributes correctly
Don't include sensitive attributes in the result if the key has
CKA_SENSITIVE=TRUE.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2026-10-19 13:52:53 +02:00
Ingo Franzki
4640c3c730 TOOLS: Update ICSF mock server to generate and require complaint DH keys
Update ICSF mock server to behave like the real ICSF and generate as well
as require DH keys that are complaint per NIST SP 800-56A R3 5.6.2.1.2.
Fail the key derivation with 8 / 2116 if the used private key is not
compliant, just like ICSF is doing.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2026-10-08 12:37:09 +02:00
Ingo Franzki
ab92734d72 TOOLS: Add a ICSF mock server that simulates ICSF for testing
Add a self-contained Python 3 mock of the z/OS ICSF LDAP interface,
designed to let you run the openCryptoki ICSF token driver and the
pkcsicsf configuration tool without a real z/OS system.

Assisted-by: IBM Bob:2.1.0
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2026-09-25 08:49:36 +02:00
Vishnudatha Kanjur
2d0bed0820 EP11: Generate Key, Sign and Verify support for BLS 12 381 curve
The commit adds support for BLS 12 381 curve as part of CKM_IBM_ECDSA_OTHER
with CKM_IBM_BLS submechanism for EP11 token.

Signed-off-by: Vishnudatha Kanjur <kanjur@ibm.com>
2025-10-29 14:27:12 +01:00
Bernhard M. Wiedemann
ff6bb98b2e Drop timestamp from autogenerated files
for reproducible builds

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2024-12-12 16:00:32 +01:00
Bernhard M. Wiedemann
86dcf5ddd5 Avoid incorrect copyright claims
When building this in 2025, it claims Copyright 2025
without any copyright-worthy work happening in that year.

Also note that the number does not have to be updated every year
as copyright does not expire for 70+ years.

This patch was done while working on reproducible builds for openSUSE, sponsored by the NLnet NGI0 fund.

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
2024-12-12 11:40:29 +01:00
Ingo Franzki
a7ebee5a9c COMMON: Add aliases for CKM_SHA3_nnn_KEY_DERIVE
PKCS#11 v3.0 adds mechanisms like CKM_SHA3_nnn_KEY_DERIVE for SHA3 based key
derivation. For whatever reason, the SHA3 variants of those mechanisms are
called like ..._KEY_DERIVE while the SHA1 and SHA2 variants are called like
..._KEY_DERIVATION.

In PKCS#11 v3.1 this has been aligned and these mechanisms are now called
CKM_SHA3_nnn_KEY_DERIVATION, but there are aliases for the old mechanism
names like CKM_SHA3_nnn_KEY_DERIVE to map to the new names.

Update the code to use the new names, but also add the aliases so that
existing applications that use the old names continue to work. Also add
the aliases to the policy parser, to allow parsing existing policy files
that use the old names.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2024-06-17 13:18:42 +02:00
Ingo Franzki
97f95aa65e COMMON: Add support for *_SP800 KDFs for ECDH
The *_SP800 KDFs use the algorithm defined by FIPS SP800-56A/SP800-56C
instead of the algorithm defined by ANSI X9.63.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2024-06-10 13:42:10 +02:00
Ingo Franzki
ea45a74ae8 COMMON: Add SHA3 mechanisms to mechtable, policy, statistics, utilities
Ensure that the new SHA3 mechanisms, KDFs and MGFs are supported by all
common code utility functions, as well as policy and statistics code.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2024-06-10 13:42:10 +02:00
Akash Kulhalli
a402a405fa aix: Add missing code that is AIX-specific
AIX does not have any of the BSD's warnx and friends functions, and neither
does it have getopt_long. Both of these are included, sourced from a pool of
permissive licenses, with their license notices intact.

In an effort to preserve nativity, this code is not used on other platforms,
instead preferring to use the native behaviours available on respective
platforms.

Additionally, this commit also includes some changes that _removes_
platform-specificity for the Linux platform, setting the _GNU_SOURCE macro
once in autoconf, instead of duplicating that in every source file.

Signed-off-by: Akash Kulhalli <akash.kulhalli@ibm.com>
2024-04-24 09:48:07 +02:00
Ingo Franzki
1eeab07049 common: Fix compile error/warning when compiled with GCC 14
Fix various places where GCC 14 reports type inconsistencies with the size_t
and CK_ULONG (unsigned long) types.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2024-01-30 16:02:44 +01:00
Ingo Franzki
ff52d11160 Make pkcsslotd user and pkcs11 group configurable
Allow to specify the pkcsslotd user and the pkcs11 group during
configuration.

Use '--with-pkcsslotd-user=USER' and/or '--with-pkcs-group=GROUP'
to specify the user and group name. The defaults are 'pkcsslotd'
and 'pkcs11'.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2023-04-20 15:13:44 +02:00
Ingo Franzki
6b933ba425 POLICY/STATISTICS: Check for Kyber KEM KDFs and count KDF digest usage
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2023-01-24 14:52:11 +01:00
Ingo Franzki
8fc969b238 configure: Support cross compilation
Support cross compilation by making sure that the build tools are
built with a local compiler.

Note: This requires the AX_PROG_CC_FOR_BUILD` autoconf macro from
the autoconf archive.

Tested-by: Marc Hartmayer <marc@linux.ibm.com>
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2023-01-16 10:13:15 +01:00
Ingo Franzki
05aad790e5 TOOLS: Correct printf format string
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2022-11-16 13:34:31 +01:00
Ingo Franzki
1ea62406a4 policy: Correct config file names in comments: .conf instead of .cfg
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
2022-04-19 17:11:36 +02:00
Juergen Christ
6fd188cefb DOC: Add example policy and strength configurations
These files will also be installed automatically via autotools into the
correct doc folder (typically /usr/share/doc/opencryptoki).

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
2021-11-08 16:29:24 +01:00
Juergen Christ
c96f608763 API: Add Mechanism table
Add a single source mechanism table to be used by policy and other code.  This
should remove the various tables and switches over mechanisms in the code and
provide a common way to translate between numeric and string representation.

Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>
2021-11-08 16:29:24 +01:00