This patch prevents linux from having 32bit and 64bit
apps on the same system. A more specific FreeBSD patch
is required instead.
This reverts commit f22421a0ad.
Signed-off-by: Joy Latten <jmlatten@users.sourceforge.net>
Due to a common function being used for unwrap, des and 3des key
unwrapping was looking for a specific template required only for AES keys,
and additionally were being unpacked into the CKA_VALUE attribute
instead of the CKA_IBM_OPAQUE attribute.
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
is identified with OPENCRYPTOKI_DEBUG_FILE environ variable
when debug is enabled. syslog messages are logged regardless.
Signed-off-by: Joy Latten <jmlatten@users.sourceforge.net>
corrupt on s390x. Fix memcpy's public exponent into a CK_ULONG
(size of the openssl RSA_generate_key argument) and call correct
endianess macro.
Signed-off-by: Kent Yoder <key@linux.vnet.ibm.com>
The memcpy can blow away the app's public exponent, so
reverting the patch.
Signed-off-by: Joy Latten <jmlatten@users.sourceforge.net>
This reverts commit 08fe158617.
The sources require an inclusion of <string.h> for memmove() and of
<stdio.h> for sprintf().
Implicit declarations both cannot be properly validated by the compiler and
will stop fortified sources in modern glibc from working.
* TPM token, contrary to other tokens, wasn't symlink PKCS11_TPM.so
to the library upon make install.
* Also added uninstall hooks for consistency
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
Hi Klaus.
According to BSSSD[*] folks, there are any problems on constructor
and destructor. I can't provide an exlanation of thus, but I think
this is significant.
[*] http://bsssd.sourceforge.net/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
For most C_Digest* functions (exception is C_DigestKey), the spec
specified the scenarios in which a digest operation should
terminate (either due to error or normal finalization).
This patch brings the digest_mgr_cleanup() function to be called
from *inside* the digest_mgr_* functions, so we can better manage
resources from a single place.
This patch is for the `common` part, and also fix at least one
memory leak in the software-fallback SHA1 code (where
ckm_sha1_init could continuously allocate contexts without
being properly cleaned-up)
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
There are functions which may return error conditions that are
not being checked on return, and others which are being checked
but always return the same value.
This patch probably covers only a small fraction of them, but
its a start.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
A set of fixes to some existing log messages, plus a bit of
suppressing messages if the lower-level function is already
logging error conditions in some way.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
remove_leading_zeros() was incorrectly using memcpy() for
overlapping memory segments. Replace it by a more-central
p11_attribute_trim() function in the p11util.c file, and
use memmove() instead.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
If there ever was a bug with dlclose() in 64 bit systems,
I dont see it happening anymore.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
Create p11_ahex_dump() in p11util.c, that could be used
elsewhere (for debugging purposes mostly).
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
Fix leakage that may cause the process to run out of FDs when
more than a certain number of sessions was opened.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
Libica might hang if we provide an even public exponent for
RSA keypair generation.
Convert to a local representation (long int) so we can check.
Also use p11_bignum_trim() to (possibly) trim-down the field
sizes for the generated key.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
The CCA token (as of Oct/2010, CCA library 4.0) can only support 3
and 65537 (0x010001) as public exponents. It also supports specifying
a 0x00 (zero) as a way to indicate that a random public exponent
should be used, but even then this is only possible for key modulus
lenghts up to 2048 bits.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
OpenSSL might loop indefinitely if we provide an even or
zero public exponent (e).
* Fix byte-order issue for Little-endian archs
* Explicitly fail with even numbers
* Generate random odd number when e=0
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
p11_bigint_trim() will trim a Big Integer (using the BIG ENDIAN
PKCS#11 representation), taking unnecessary leading zeros.
This function will be useful in properly converting PKCS#11
numbers to native formats so we can check their contents.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>
This reverts commit 8f19afe291, which is causing some
odd memory-corruption issues, probably related to updating the CKA_VALUE_LEN
attribute of the AES key template without being sure it where/if it was
allocated.
Will need to come back with a different strategy.
Signed-off-by: Klaus Heinrich Kiwi <klausk@linux.vnet.ibm.com>