Test the PKCS#7 padding and unpadding functions to behave correctly
on various valid and invalid inputs.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Produce a PKCS#8 and SPKI encoding using OpenSSL and test if the ASN.1 routines
can decode that key and also if the round trip produces the exact same encoded data.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Add tests that checks if wrong AlgorithmIdentifier are detected, i.e.
cases where the OID is too short or too long, or invalid by other means.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
The use of liblber has been eliminated for most of the cases already.
The only leftover cases are in RSA, DSA, and DH public key encoding
functions for encoding BIT STRINGs.
Update these leftover places and use the already existing
ber_encode_BIT_STRING() function instead.
With this, '-lber' can be removed from the make files for most of
the tokens and tools. The ICSF token still requires liblber for its
LDAP communication.
Also adjust the configure script and example RPM spec accordingly.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Add unit tests for the basic BER encoding and decoding functions in asn1.c.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Assisted-by: IBM Bob: 1.0.1
`random` returns a number within a range that includes 0; but the code does not
always handle that, leading to misleading error messages ("malloc failed" but
it was a request for a memory buffer of size 0) on test run. Those should now
be fixed.
The `ock_tests.sh.in` file has been slightly tweaked to account for some flags
that are not available on AIX. No functional differences expected across all
supported platforms.
On Linux, a null pointer is printed as "(null)", whereas on AIX nothing is
printed. Since this is only for tests, AIX now also prints the same string as
Linux when a nullptr is attempted to be printed.
Signed-off-by: Akash Kulhalli <akash.kulhalli@ibm.com>
Headers not specified either in xxx_SOURCES or noinst_HEADERS will not
be included for 'make dist', and will cause compile errors during
'make distcheck'. Also include several extra files into EXTRA_DIST to
make sure they are distributed as well.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Only reference the .y and .l files in SOURCES, but not the generated .c
files.
Building the configuration parser requires own rules for yacc and lex.
Avoid automake target override warning using Wno-override.
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Make use of mechanism table to translate between string and numeric format of
mechanisms. Remove duplicated code dealing with mechanism translations.
Signed-off-by: Juergen Christ <jchrist@linux.ibm.com>