Vitaly Chikunov [Wed, 13 Nov 2019 21:40:18 +0000 (00:40 +0300)]
tcl_tests: Fix and update enc test
- Set expected default value for CRYPT_PARAMS.
- Disable `RIC 1' params tests.
- Disable `Magma-ACPKM' test.
- Update test descriptions to include cipher name.
Vitaly Chikunov [Sun, 10 Nov 2019 01:34:01 +0000 (04:34 +0300)]
tcl_tests: Make utf-8 encoding work
- Remove emacs coding: cp1251 tag
- Change stats file encoding to utf-8
- Change packages source to have -encoding utf-8
- Run tclsh with -encoding utf-8
- Make `proc rus' noop.
This will make Tcl automatically translate scripts output from utf-8 to
system encoding.
ameth: fill digestParamSet for the sake of backwards compatibility
Even though it is not recommended by R 1323565.1.023-2018 fill
digestParamSet field for 512-bit curves Test, TC26-A, TC26-B because old
cryptoproviders expect this field to be present.
Vitaly Chikunov [Tue, 15 Oct 2019 16:22:45 +0000 (19:22 +0300)]
gost_ec_keyx: Fix CID 253282 Dereference null return value
`param' is used unconditionally in pkey_GOST_ECcp_encrypt() so we can
unconditionally check (vs in any particular `if' branch) for it's being
non-NULL. This is similar to how pkey_GOST_ECcp_decrypt() works with
`param'.
Richard Levitte [Wed, 4 Sep 2019 14:22:26 +0000 (16:22 +0200)]
For Grasshopper OMAC_ACPKM, OMAC and MAGMA, support XOF
XOF (eXtendable-Output Function) is supported in OpenSSL since version
1.1.1. Unfortunately, that support is limited, as it requires calling
EVP_DigestFinalXOF(). However, the grasshopper code wasn't compatible.
This changeset adds XOF support in grasshopper
This changeset removes the _meth_ calls from test_grasshopper.c (they
should never have been there, but considering support for XOF came so
late in OpenSSL, their presence is understandable) and uses supported
functionality for this sort of thing instead.
Richard Levitte [Wed, 28 Aug 2019 08:23:57 +0000 (10:23 +0200)]
test/*.t: Don't check OPENSSL_ENGINES
It's set correctly when these tests are started with ctest, and
otherwise, we leave it to the user to decide. Either way, we set it
to a bogus value when it isn't previously set...
Richard Levitte [Sat, 24 Aug 2019 08:36:39 +0000 (10:36 +0200)]
test/run_tests: Always set paths when OPENSSL_ROOT_DIR is defined
When the environment variable OPENSSL_ROOT_DIR is defined, we need to
ensure that PATH and LD_LIBRARY_PATH are properly affected.
This is a little bit complicated, since OPENSSL_ROOT_DIR could point
at an OpenSSL build directory as well as an OpenSSL installation
tree. Fortunately, it's easy to detect the difference; if it's a
build tree, there's a sub-directory 'apps'.
For installation trees, it's further complicated by OpenSSL's
'multilib' target attribute, which exists for platforms that support
directory separated libraries for differing bitness (typically 32-bit
and 64-bit libraries). We trust pkg-config to give us the answer.
Binaries are easier, they live in $OPENSL_ROOT_DIR/bin.
Richard Levitte [Fri, 23 Aug 2019 16:55:42 +0000 (18:55 +0200)]
gost_pmeth.c: mitigate for constness difference in copy function
The second argument for the pkey_copy function has been constified in
OpenSSL to be 3.0. This is normally not a problem, but when passing a
pointer to such a function, the compiler does complain.
This change solves the issue by looking at the macros
OPENSSL_VERSION_MAJOR, which is new in OpenSSL to be 3.0, and set
constness based on that.
Some architectures in some circumstances do not allow unaligned
memory access (such as ARM, MIPS) triggering SIGBUS. This patch
very crudely fixes this issue.
The issue is found and original fix is proposed by Eric Biggers:
At least Fedora 30 will have no Test::More anymore. Test::More is
deprecated, as well as Test::Stream and Test2 is a recommended
replacement.
Luckily, gost-engine's use of Test::More is limited to functions which
are compatible with implementations in Test2, so only module import and
test plan announcement need to change.
Also, on Fedora 29 perl 5.28 is very picky on undefined variables.
Vitaly Chikunov [Fri, 15 Feb 2019 19:18:08 +0000 (22:18 +0300)]
tests: Load just built engine from the output directory
Define ENGINE_DIR for all binary tests. Instead of auto-loading engine
using `example.conf' load it directly from the OUTPUT_DIRECTORY for
curves tests.