]> wagner.pp.ru Git - openssl-gost/engine.git/log
openssl-gost/engine.git
4 years agogosthash2012_ref: Optimize XLPS for speed
Vitaly Chikunov [Tue, 4 Feb 2020 02:47:15 +0000 (05:47 +0300)]
gosthash2012_ref: Optimize XLPS for speed

This results in ~20% improvement for reference implementation on my
Xeon E5630.

`openssl speed -evp streebog256' results (before and after):

   16 bytes    64 bytes   256 bytes  1024 bytes  8192 bytes  16384 bytes
 3815.25k   12874.41k   31497.81k   49823.06k   59932.67k    57021.78k
 4361.29k   14933.06k   37091.67k   59001.86k   71360.51k    72488.28k

4 years agogosthash2012: Provide cmake test for _addcarry_u64
Vitaly Chikunov [Tue, 4 Feb 2020 02:41:53 +0000 (05:41 +0300)]
gosthash2012: Provide cmake test for _addcarry_u64

Also, simple check if `_addcarry_u64' works correctly.

4 years agotravis-ci: adjust osx linker options
Ilya Shipitsin [Mon, 3 Feb 2020 06:18:33 +0000 (11:18 +0500)]
travis-ci: adjust osx linker options

4 years agotravis-ci: Optimize and rearrange .travis.yml
Vitaly Chikunov [Sun, 2 Feb 2020 18:23:04 +0000 (21:23 +0300)]
travis-ci: Optimize and rearrange .travis.yml

- Remove redundant 'os: linux', 'compiler: gcc' tags.
- Order jobs: x86_64 builds, analysers, other arches, other OSes.
- Mark openssl-master build as 'allow_failures' for PRs.
- Build all jobs against 'OpenSSL_1_1_1-stable' by default.
- Do not include 'linux/arch' in the job name, because Travis show
  them already.
- Split name by ' | ' instead of '/' so it's easier to understand.

4 years agotravis-ci: Fix build on 'OpenSSL_1_1_1-stable'
Vitaly Chikunov [Sun, 2 Feb 2020 19:04:45 +0000 (22:04 +0300)]
travis-ci: Fix build on 'OpenSSL_1_1_1-stable'

It's turned out that 'OpenSSL_1_1_1-stable' does not have 'build_sw'
make target. But both 'OpenSSL_1_1_1-stable' and 'master' have
'build_libs' and 'build_programs'.

Fixes: cb1b5ff ("travis-ci: Speed-up openssl build")
4 years agogosthash2012: Improve SIMD implementation
dmitry dulesov [Fri, 31 Jan 2020 23:59:07 +0000 (02:59 +0300)]
gosthash2012: Improve SIMD implementation

Allow aligned/unaligned access. Use better intrinsics and other
small optimizations.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Enable building with SIMD implementation
Vitaly Chikunov [Fri, 31 Jan 2020 23:57:15 +0000 (02:57 +0300)]
gosthash2012: Enable building with SIMD implementation

Also, add compile time notice message to show which implementation is
selected.

4 years agogosthash2012: Optimize `add512` on x86_64 using Intel intrinsics
dmitry dulesov [Fri, 31 Jan 2020 17:22:19 +0000 (20:22 +0300)]
gosthash2012: Optimize `add512` on x86_64 using Intel intrinsics

`_addcarry_u64' is using `ADC' and does not require ADX extensions
(`-madx').

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Optimize out temporary `buf' from `stage3'
dmitry dulesov [Thu, 30 Jan 2020 02:49:50 +0000 (05:49 +0300)]
gosthash2012: Optimize out temporary `buf' from `stage3'

On-stack `buf' is replaced by manipulation directly on `CTX->buffer'.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Optimize `gost2012_hash_block' loop
dmitry dulesov [Thu, 30 Jan 2020 02:41:36 +0000 (05:41 +0300)]
gosthash2012: Optimize `gost2012_hash_block' loop

Some simple optimizations.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Change some byte (pointers) to union uint512_u
dmitry dulesov [Thu, 30 Jan 2020 02:30:49 +0000 (05:30 +0300)]
gosthash2012: Change some byte (pointers) to union uint512_u

Introduce byte `.B' union type to `union uint512_u'.
Change `CTX.buffer' type from `unsigned char' to `union uint512_u'.
Change `data' argument of `stage2()' to `union uint512_u *'.
Change `g()' arguments to `union uint512_u *' with `RESTRICT'
allowing compiler to optimize more.

No code changes, only type changes here.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Remove temporary variable from `stage2'
dmitry dulesov [Thu, 30 Jan 2020 02:21:31 +0000 (05:21 +0300)]
gosthash2012: Remove temporary variable from `stage2'

Now `stage2' will always get aligned data which is prepared in
`gost2012_hash_block' by copying into `CTX->buffer'.

This will allow to change `data' argument of `stage2' from `unsigned
char *' pointer to `union uint512_u *'.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Make `add512' to work in-place
dmitry dulesov [Thu, 30 Jan 2020 01:20:58 +0000 (04:20 +0300)]
gosthash2012: Make `add512' to work in-place

This allows to use `RESTRICT' which allows compiler optimize more.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Simpler version of add512
Vitaly Chikunov [Thu, 30 Jan 2020 01:05:10 +0000 (04:05 +0300)]
gosthash2012: Simpler version of add512

Similar to my commit into adegtyarev/streebog@432d5de.

4 years agogosthash2012: Simplify `pad'
dmitry dulesov [Thu, 30 Jan 2020 00:50:54 +0000 (03:50 +0300)]
gosthash2012: Simplify `pad'

`pad' does not need this complicated  memory movements using stack
buffer.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Remove redundant `memset' form `init_gost2012_hash_ctx'
dmitry dulesov [Thu, 30 Jan 2020 00:42:48 +0000 (03:42 +0300)]
gosthash2012: Remove redundant `memset' form `init_gost2012_hash_ctx'

`CTX' is already fully zeroed at the beginning of
`init_gost2012_hash_ctx'.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agogosthash2012: Remove unreachable code from `pad'
Vitaly Chikunov [Thu, 30 Jan 2020 00:41:01 +0000 (03:41 +0300)]
gosthash2012: Remove unreachable code from `pad'

`CTX->bufsize' cannot be 64 ever.

4 years agogosthash2012: Remove redundant `hash' field from `struct gost2012_hash_ctx'
dmitry dulesov [Thu, 30 Jan 2020 00:36:45 +0000 (03:36 +0300)]
gosthash2012: Remove redundant `hash' field from `struct gost2012_hash_ctx'

And save 64 bytes.

Committed-by: Vitaly Chikunov <vt@altlinux.org>
4 years agotravis-ci: Add 32-bit build (i386)
Vitaly Chikunov [Fri, 31 Jan 2020 21:58:19 +0000 (00:58 +0300)]
travis-ci: Add 32-bit build (i386)

Make sure everything is OK on 32-bit platform.

4 years agotravis-ci: Speed-up openssl build
Vitaly Chikunov [Fri, 31 Jan 2020 21:55:44 +0000 (00:55 +0300)]
travis-ci: Speed-up openssl build

Do not build openssl documentation.
Also, split build line into several lines.

4 years agotravis-ci: Add (big-endian) s390x build
Vitaly Chikunov [Fri, 31 Jan 2020 17:47:02 +0000 (20:47 +0300)]
travis-ci: Add (big-endian) s390x build

s390x is big-endian which is different from any other arch we build.
We have endianness dependent code, thus this is useful to test.

4 years agotravis-ci: Add clang build for linux/x86_64/openssl-master
Vitaly Chikunov [Fri, 31 Jan 2020 17:41:46 +0000 (20:41 +0300)]
travis-ci: Add clang build for linux/x86_64/openssl-master

Previously Clang is only used for OSX build.

4 years agotravis-ci: Always describe openssl branch
Vitaly Chikunov [Fri, 31 Jan 2020 17:35:33 +0000 (20:35 +0300)]
travis-ci: Always describe openssl branch

Log full commit id that we build OpenSSL against, because `master' is
moving target. That should be useful for old logs to reproduce these
builds.

4 years agoRemove unset local buffer meshing. This removes valgrind errors.
Nikolay Morozov [Thu, 26 Dec 2019 06:17:06 +0000 (09:17 +0300)]
Remove unset local buffer meshing. This removes valgrind errors.

4 years agoCMakeLists.txt: Workaround openssl deprecation of HMAC and CMAC primitives
Vitaly Chikunov [Thu, 30 Jan 2020 23:24:47 +0000 (02:24 +0300)]
CMakeLists.txt: Workaround openssl deprecation of HMAC and CMAC primitives

Following commits mark CMAC and HMAC primitives deprecated:

  commit a6d572e60120e0ffb42aece17a085f0fed1b8f6f
  Author: Pauli <paul.dale@oracle.com>
  Date:   Tue Jan 14 10:59:11 2020 +1000

      Deprecate the low level CMAC functions

  commit dbde4726889a19af0a718fe9c5542f39c81acbd3
  Author: Pauli <paul.dale@oracle.com>
  Date:   Tue Jan 14 12:11:50 2020 +1000

      Deprecate the low level HMAC functions

Add `-Wno-error=deprecated-declarations' to appropriate targets.

References:
  https://github.com/openssl/openssl/commit/a6d572e601
  https://github.com/openssl/openssl/commit/dbde472688

4 years agotravis-ci: adjust names
Ilya Shipitsin [Tue, 28 Jan 2020 13:19:18 +0000 (18:19 +0500)]
travis-ci: adjust names

4 years agotravis-ci: add PR testing for OpenSSL-1.1.1 branch
Ilya Shipitsin [Tue, 28 Jan 2020 12:51:15 +0000 (17:51 +0500)]
travis-ci: add PR testing for OpenSSL-1.1.1 branch

4 years agoCI: do not use LD_BIRARY_PATH anymore
Ilya Shipitsin [Sun, 12 Jan 2020 18:39:17 +0000 (23:39 +0500)]
CI: do not use LD_BIRARY_PATH anymore

4 years agotravis-ci: remove redundant cpanminus installation, remove cmake compile from source
Ilya Shipitsin [Mon, 6 Jan 2020 04:08:43 +0000 (09:08 +0500)]
travis-ci: remove redundant cpanminus installation, remove cmake compile from source

4 years agotravis-ci: Add descriptive names to the tests
Vitaly Chikunov [Sun, 5 Jan 2020 21:06:21 +0000 (00:06 +0300)]
travis-ci: Add descriptive names to the tests

Format is `os/compiler[+env]/arch'.

4 years agotravis-ci: Fix quietness of building of openssl
Vitaly Chikunov [Sun, 5 Jan 2020 20:24:50 +0000 (23:24 +0300)]
travis-ci: Fix quietness of building of openssl

No need for `build.log' as `make -s' will output any failure.

Also, redirection was broken anyway since splitting make into two makes
with separate `-j' and install phase.

Add `travis_wait' to make traves not time-out on slow arches. Reference:
  https://docs.travis-ci.com/user/common-build-problems/#build-times-out-because-no-output-was-received

Fixes: c38ec7587 ("travis: speed up Travis build")
4 years agotcl_tests: Abbreviate output when run under CI
Vitaly Chikunov [Sun, 5 Jan 2020 20:51:09 +0000 (23:51 +0300)]
tcl_tests: Abbreviate output when run under CI

To make CI output not too long - output only header of every test set
and output only relevant log entries on test failures.

When `CI' env is defined. Which should be defined for both Travis and
Cirrus. Reference:
  https://docs.travis-ci.com/user/environment-variables/
  https://cirrus-ci.org/guide/writing-tasks/#environment-variables

4 years agotcl_tests: Rearrange runtest.sh to run from dirrerent env
Vitaly Chikunov [Sun, 5 Jan 2020 20:14:29 +0000 (23:14 +0300)]
tcl_tests: Rearrange runtest.sh to run from dirrerent env

Add more debug output to fix Travis-CI issues. Move definition of
OPENSSL_CONF above first tcl test run. Define OPENSSL_ENGINES from
ENGINE_DIR by default.

4 years agotravis-ci: Add tcl_tests to the builds
Vitaly Chikunov [Sun, 5 Jan 2020 19:44:28 +0000 (22:44 +0300)]
travis-ci: Add tcl_tests to the builds

4 years agotravis-ci: Remove redundant linux/gcc test
Vitaly Chikunov [Sun, 5 Jan 2020 19:30:42 +0000 (22:30 +0300)]
travis-ci: Remove redundant linux/gcc test

Fis was same as the first test.

4 years agotcl_tests: Fix ocsp test by removing -md_gost94 option
Vitaly Chikunov [Wed, 13 Nov 2019 23:18:45 +0000 (02:18 +0300)]
tcl_tests: Fix ocsp test by removing -md_gost94 option

Otherwise you'll get:

  ocsp: Digest must be before -cert or -serial
  ocsp: Use -help for summary.

4 years agotcl_tests: Disable failing ssl tests and suites
Vitaly Chikunov [Wed, 13 Nov 2019 22:58:33 +0000 (01:58 +0300)]
tcl_tests: Disable failing ssl tests and suites

Remove GOST2012-MAGMA-MAGMAOMAC and GOST2012-KUZNYECHIK-KUZNYECHIKOMAC
suites from the test.

Disable handshake tests.

4 years agotcl_tests: Fix cms and smime_io tests by telling that signature is -binary
Vitaly Chikunov [Wed, 13 Nov 2019 22:44:32 +0000 (01:44 +0300)]
tcl_tests: Fix cms and smime_io tests by telling that signature is -binary

Verification failure
139891902039680:error:2E09A09E:CMS routines:CMS_SignerInfo_verify_content:verification failure:crypto/cms/cms_sd.c:848:
139891902039680:error:2E09D06D:CMS routines:CMS_verify:content verify error:crypto/cms/cms_smime.c:393:

4 years agotcl_tests: Fix smimeenc test by removing entries with empty params
Vitaly Chikunov [Wed, 13 Nov 2019 21:58:03 +0000 (00:58 +0300)]
tcl_tests: Fix smimeenc test by removing entries with empty params

This is not robust to have such tests.

4 years agotcl_tests: Fix and update enc test
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.

4 years agotcl_tests: Fix and extend ca test
Vitaly Chikunov [Wed, 13 Nov 2019 20:08:33 +0000 (23:08 +0300)]
tcl_tests: Fix and extend ca test

- Add more curves to test.
- Properly handle R 1323565.1.023-2018 (5.2.1.2) - absence of
  digestParamSet for some curves.

4 years agotcl_tests: Add more parameters to pkcs12 test
Vitaly Chikunov [Tue, 12 Nov 2019 17:07:15 +0000 (20:07 +0300)]
tcl_tests: Add more parameters to pkcs12 test

4 years agotcl_tests: Fix and extend req-newkey test (with TC26 parameters)
Vitaly Chikunov [Mon, 11 Nov 2019 04:23:30 +0000 (07:23 +0300)]
tcl_tests: Fix and extend req-newkey test (with TC26 parameters)

`gost2012_512:C' was reported as invalid but it's now valid parameter.
Also, add TC26 `TC{A,B,C,D}' parameters (note different OIDs).

4 years agotcl_tests: Fix req-genpkey test (show OID for gost2012_256:0)
Vitaly Chikunov [Mon, 11 Nov 2019 04:09:10 +0000 (07:09 +0300)]
tcl_tests: Fix req-genpkey test (show OID for gost2012_256:0)

4 years agotcl_tests: Fix pkcs8 test (showing public key)
Vitaly Chikunov [Mon, 11 Nov 2019 00:29:40 +0000 (03:29 +0300)]
tcl_tests: Fix pkcs8 test (showing public key)

4 years agotcl_tests: Allow running tests separately
Vitaly Chikunov [Mon, 11 Nov 2019 00:28:36 +0000 (03:28 +0300)]
tcl_tests: Allow running tests separately

For debug purposes.

Example:
  sh ./runtest.sh dgst pkcs8

4 years agotcl_tests: Fix engine.try (add more algos)
Vitaly Chikunov [Sun, 10 Nov 2019 16:56:10 +0000 (19:56 +0300)]
tcl_tests: Fix engine.try (add more algos)

4 years agotcl_tests: Integrate TCL tests into build system
Vitaly Chikunov [Sun, 10 Nov 2019 02:05:31 +0000 (05:05 +0300)]
tcl_tests: Integrate TCL tests into build system

Run `make tcl_tests' to run the tests. Tests report success state to
make. Tests aren't run by default because of too many failures, yet.

4 years agotcl_tests: Make utf-8 encoding work
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.

4 years agotcl_tests: Add TCL tests files
Dmitry Belyavskiy [Sun, 10 Nov 2019 01:30:14 +0000 (04:30 +0300)]
tcl_tests: Add TCL tests files

All source files are converted from cp1251 to utf-8.

4 years agoTests against master
Dmitry Belyavskiy [Sat, 11 Jan 2020 18:00:17 +0000 (21:00 +0300)]
Tests against master

4 years agocirrus-ci: switch to openssl-1.1.1 for a while
Ilya Shipitsin [Sat, 4 Jan 2020 16:20:52 +0000 (21:20 +0500)]
cirrus-ci: switch to openssl-1.1.1 for a while

4 years agomake tests against openssl-stable-1.1.x
dmitry dulesov [Sat, 28 Dec 2019 16:38:53 +0000 (19:38 +0300)]
make tests against openssl-stable-1.1.x

make tests against openssl-stable-1.1.1

5 years agotravis-ci: run coverity scan in separate cron task
Ilya Shipitsin [Sat, 9 Nov 2019 12:13:49 +0000 (17:13 +0500)]
travis-ci: run coverity scan in separate cron task

5 years agoameth: fill digestParamSet for the sake of backwards compatibility
Dmitry Eremin-Solenikov [Wed, 6 Nov 2019 17:11:21 +0000 (20:11 +0300)]
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.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agotravis-ci: enable ARM64 builds
Ilya Shipitsin [Thu, 31 Oct 2019 06:09:05 +0000 (11:09 +0500)]
travis-ci: enable ARM64 builds

5 years agoMerge branch 'master' of https://github.com/gost-engine/engine
Dmitry Belyavskiy [Sun, 27 Oct 2019 17:27:22 +0000 (20:27 +0300)]
Merge branch 'master' of https://github.com/gost-engine/engine

5 years agoLicense matching the openssl one
Dmitry Belyavskiy [Sun, 27 Oct 2019 17:26:43 +0000 (20:26 +0300)]
License matching the openssl one

5 years agoMerge pull request #183 from chipitsine/master
Dmitry Belyavskiy [Thu, 17 Oct 2019 13:51:13 +0000 (16:51 +0300)]
Merge pull request #183 from chipitsine/master

travis-ci: enable coverity scan

5 years agotravis-ci: enable coverity scan 183/head
Ilya Shipitsin [Thu, 17 Oct 2019 13:45:38 +0000 (18:45 +0500)]
travis-ci: enable coverity scan

5 years agoMerge pull request #182 from outspace/master
Dmitry Belyavskiy [Wed, 16 Oct 2019 19:13:27 +0000 (22:13 +0300)]
Merge pull request #182 from outspace/master

Fix leaks in priv_encode_gost()

5 years agoMerge pull request #181 from vt-alt/issues/174
Dmitry Belyavskiy [Wed, 16 Oct 2019 19:10:57 +0000 (22:10 +0300)]
Merge pull request #181 from vt-alt/issues/174

Issues/174

5 years agoFix leaks in priv_encode_gost() 182/head
Mykola Baibuz [Tue, 15 Oct 2019 18:09:17 +0000 (21:09 +0300)]
Fix leaks in priv_encode_gost()

5 years agogost_ec_keyx: Remove redundant code 181/head
Vitaly Chikunov [Tue, 15 Oct 2019 16:28:40 +0000 (19:28 +0300)]
gost_ec_keyx: Remove redundant code

This `if' statement is redundant since ce40d60 ("Bugfix.")

get_gost_engine_param() have no side effects and `param' is set to
`gost_cipher_list' only if already equal to `gost_cipher_list'.

5 years agogost_ec_keyx: Fix CID 253282 Dereference null return value
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'.

Closes #174.

5 years agoFix potential memory leak
Dmitry Belyavskiy [Mon, 14 Oct 2019 15:00:34 +0000 (18:00 +0300)]
Fix potential memory leak

Fixes #180

5 years agoMerge branch 'master' of https://github.com/gost-engine/engine
Dmitry Belyavskiy [Mon, 14 Oct 2019 14:29:29 +0000 (17:29 +0300)]
Merge branch 'master' of https://github.com/gost-engine/engine

5 years agoFix of potential memory leak
Dmitry Belyavskiy [Mon, 14 Oct 2019 14:28:41 +0000 (17:28 +0300)]
Fix of potential memory leak

Fixes #178

5 years agoMerge pull request #176 from lumag/gost512-test-param
Dmitry Belyavskiy [Tue, 8 Oct 2019 06:10:46 +0000 (09:10 +0300)]
Merge pull request #176 from lumag/gost512-test-param

Add support for NID_id_tc26_gost_3410_2012_512_paramSetTest

5 years agoAdd support for NID_id_tc26_gost_3410_2012_512_paramSetTest 176/head
Dmitry Eremin-Solenikov [Mon, 7 Oct 2019 22:32:38 +0000 (01:32 +0300)]
Add support for NID_id_tc26_gost_3410_2012_512_paramSetTest

Add support for 512-bit curve parameters.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
5 years agoMerge pull request #175 from vt-alt/scan20190918
Dmitry Belyavskiy [Thu, 26 Sep 2019 07:38:06 +0000 (10:38 +0300)]
Merge pull request #175 from vt-alt/scan20190918

Fixes for Scan 20190918

5 years agogost_ec_keyx: Fix CID 253283 Unchecked return value in VKO_compute_key 175/head
Vitaly Chikunov [Wed, 25 Sep 2019 23:19:36 +0000 (02:19 +0300)]
gost_ec_keyx: Fix CID 253283 Unchecked return value in VKO_compute_key

Calling EC_POINT_get_affine_coordinates() without checking
return value.
Some fixes for Coverity Scan from issue #174.

5 years agotest_grasshopper: Fix CIDs 253281, 253280, 253279, 253275
Vitaly Chikunov [Wed, 25 Sep 2019 22:57:32 +0000 (01:57 +0300)]
test_grasshopper: Fix CIDs 253281, 253280, 253279, 253275

Unchecked return value (CHECKED_RETURN)
Some fixes for Coverity Scan from issue #174.

5 years agoFix OOB read. CID 253274
Dmitry Belyavskiy [Sat, 21 Sep 2019 13:37:32 +0000 (16:37 +0300)]
Fix OOB read. CID 253274

5 years agoFix resource leak. CID 253277
Dmitry Belyavskiy [Sat, 21 Sep 2019 13:31:38 +0000 (16:31 +0300)]
Fix resource leak. CID 253277

5 years agoCoveruty CID253284
Dmitry Belyavskiy [Sat, 21 Sep 2019 13:23:11 +0000 (16:23 +0300)]
Coveruty CID253284

5 years agoFix fb infer complain
Dmitry Belyavskiy [Sat, 21 Sep 2019 13:03:30 +0000 (16:03 +0300)]
Fix fb infer complain

5 years agoFix fb infer complain
Dmitry Belyavskiy [Sat, 21 Sep 2019 12:59:45 +0000 (15:59 +0300)]
Fix fb infer complain

5 years agoMerge pull request #170 from hackomatic/wip
Dmitry Belyavskiy [Thu, 5 Sep 2019 07:55:40 +0000 (10:55 +0300)]
Merge pull request #170 from hackomatic/wip

Fix compilation with Microsoft Visual C.

5 years agoMake VKO_compute_key public. 170/head
Dmitry Timoshkov [Wed, 4 Sep 2019 03:45:42 +0000 (11:45 +0800)]
Make VKO_compute_key public.

5 years agoFix compilation with Microsoft Visual C.
Dmitry Timoshkov [Wed, 4 Sep 2019 03:42:59 +0000 (11:42 +0800)]
Fix compilation with Microsoft Visual C.

5 years agoGet rid of EVP_MD_CTRL_MAC_LEN
Dmitry Belyavskiy [Wed, 4 Sep 2019 19:45:37 +0000 (22:45 +0300)]
Get rid of EVP_MD_CTRL_MAC_LEN

5 years agoMerge pull request #169 from levitte/omac-ctx-size
Dmitry Belyavskiy [Wed, 4 Sep 2019 19:23:56 +0000 (22:23 +0300)]
Merge pull request #169 from levitte/omac-ctx-size

For Grasshopper OMAC_ACPKM, OMAC and MAGMA, support XOF

5 years agoFor Grasshopper OMAC_ACPKM, OMAC and MAGMA, support XOF 169/head
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.

5 years agoMerge pull request #166 from levitte/cleanup-tests
Dmitry Belyavskiy [Wed, 28 Aug 2019 09:10:51 +0000 (12:10 +0300)]
Merge pull request #166 from levitte/cleanup-tests

Cleanup tests

5 years agotest/*.t: Don't check OPENSSL_ENGINES 166/head
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...

5 years agoCMakeLists.txt: make sure the engine tests get OPENSSL_CONF too
Richard Levitte [Wed, 28 Aug 2019 08:23:01 +0000 (10:23 +0200)]
CMakeLists.txt: make sure the engine tests get OPENSSL_CONF too

An OPENSSL_CONF from the user may cause trouble

5 years agoMerge pull request #164 from levitte/run_tests-verbosity
Dmitry Belyavskiy [Tue, 27 Aug 2019 06:30:21 +0000 (09:30 +0300)]
Merge pull request #164 from levitte/run_tests-verbosity

test/run_tests: when ctest is verbose, make TAP::Harness verbose too

5 years agotest/run_tests: when ctest is verbose, make TAP::Harness verbose too 164/head
Richard Levitte [Tue, 27 Aug 2019 03:19:49 +0000 (05:19 +0200)]
test/run_tests: when ctest is verbose, make TAP::Harness verbose too

5 years agoMerge pull request #161 from levitte/fix-146-2
Dmitry Belyavskiy [Sun, 25 Aug 2019 18:24:06 +0000 (21:24 +0300)]
Merge pull request #161 from levitte/fix-146-2

test/run_tests: extend support for more operating systems

5 years agotest/run_tests: extend support for more operating systems 161/head
Richard Levitte [Sun, 25 Aug 2019 09:32:21 +0000 (11:32 +0200)]
test/run_tests: extend support for more operating systems

Not all systems recognise LD_LIBRARY_PATH, and we therefore need to
set other environment variables.

Currently set:

- LD_LIBRARY_PATH (Linux and ELF HP-UX)
- DYLD_LIBRARY_PATH (MacOS X)
- LIBPATH (AIX, OS/2)

More can be added as the need arises.

Fixes #146

5 years agoMerge pull request #160 from levitte/fix-146
Dmitry Belyavskiy [Sat, 24 Aug 2019 15:00:40 +0000 (18:00 +0300)]
Merge pull request #160 from levitte/fix-146

test/run_tests: Always set paths when OPENSSL_ROOT_DIR is defined

5 years ago.cirrus.yml: install pkgconf 160/head
Richard Levitte [Sat, 24 Aug 2019 12:35:39 +0000 (14:35 +0200)]
.cirrus.yml: install pkgconf

That will add the pkg-config on FreeBSD

5 years agotest/run_tests: Always set paths when OPENSSL_ROOT_DIR is defined
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.

Fixes #146

5 years agoMerge pull request #159 from levitte/fix-154
Dmitry Belyavskiy [Fri, 23 Aug 2019 17:22:28 +0000 (20:22 +0300)]
Merge pull request #159 from levitte/fix-154

gost_pmeth.c: mitigate for constness difference in copy function

5 years agogost_pmeth.c: mitigate for constness difference in copy function 159/head
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.

Fixes #154

5 years agoMerge pull request #141 from chipitsine/ppc64le
Dmitry Belyavskiy [Thu, 1 Aug 2019 08:07:26 +0000 (11:07 +0300)]
Merge pull request #141 from chipitsine/ppc64le

travis-ci: add linux-ppc64le build

5 years agotravis-ci: install cmake-3.15.1 on linux-ppc64le 141/head
Ilya Shipitsin [Sat, 27 Jul 2019 19:34:58 +0000 (00:34 +0500)]
travis-ci: install cmake-3.15.1 on linux-ppc64le

5 years agotravis-ci: add linux-ppc64le builds
Ilya Shipitsin [Sat, 27 Jul 2019 18:14:16 +0000 (23:14 +0500)]
travis-ci: add linux-ppc64le builds

5 years agoMerge pull request #152 from vt-alt/fix151
Dmitry Belyavskiy [Fri, 12 Jul 2019 09:32:14 +0000 (12:32 +0300)]
Merge pull request #152 from vt-alt/fix151

Fix test_grasshopper and test_keyexpimp engine init