]> www.wagner.pp.ru Git - openssl-gost/engine.git/log
openssl-gost/engine.git
4 years agoMerge branch 'master' of https://github.com/gost-engine/engine
Dmitry Belyavskiy [Tue, 19 May 2020 14:55:17 +0000 (17:55 +0300)]
Merge branch 'master' of https://github.com/gost-engine/engine

4 years agoFix misleading indentation
Nikolay Morozov [Tue, 19 May 2020 14:12:27 +0000 (17:12 +0300)]
Fix misleading indentation

4 years agoBuild fix
Dmitry Belyavskiy [Tue, 19 May 2020 14:36:37 +0000 (17:36 +0300)]
Build fix

4 years agoFix code formating.
Nikolay Morozov [Mon, 18 May 2020 13:40:43 +0000 (16:40 +0300)]
Fix code formating.

All tabs replcaded with spaces. One file was 2 tabs fornating.

4 years agoSwitch to alpha2
Dmitry Belyavskiy [Mon, 18 May 2020 16:17:07 +0000 (19:17 +0300)]
Switch to alpha2

4 years agoAdd static to functions that not need to be exported
Vitaly Chikunov [Wed, 13 May 2020 02:10:57 +0000 (05:10 +0300)]
Add static to functions that not need to be exported

After registration rework many callbacks not need to be exported. Also,
some functions inconsistently declared static in headers and non-static
in the code. Finally, some functions just not need to be exported.

4 years agoRemove unneeded declarations after registration rework
Vitaly Chikunov [Wed, 13 May 2020 01:41:13 +0000 (04:41 +0300)]
Remove unneeded declarations after registration rework

4 years agoUpdate Copyright lines after registration rework
Vitaly Chikunov [Tue, 12 May 2020 23:24:07 +0000 (02:24 +0300)]
Update Copyright lines after registration rework

- Add year 2020 to old lines.
- Some files did not have original Copyright line - added "Update
  at 2020" to show that I'm not original contributor.
- Some files did not have License line - added reference to OpenSSL
  license.

4 years agogost_eng: Simplify digest registration
Vitaly Chikunov [Tue, 12 May 2020 22:57:27 +0000 (01:57 +0300)]
gost_eng: Simplify digest registration

Now only simple array of `GOST_digest's. No need to care about aliases
anymore.

4 years agogost_md: Rework alias support in digest registration
Vitaly Chikunov [Tue, 12 May 2020 22:55:49 +0000 (01:55 +0300)]
gost_md: Rework alias support in digest registration

4 years agogost_omac_acpkm: Rework registration of kuznyechik_ctracpkm_omac
Vitaly Chikunov [Tue, 12 May 2020 22:17:10 +0000 (01:17 +0300)]
gost_omac_acpkm: Rework registration of kuznyechik_ctracpkm_omac

4 years agogost_omac: Rework registration of magma/kuznyechik OMAC digests
Vitaly Chikunov [Tue, 12 May 2020 22:10:51 +0000 (01:10 +0300)]
gost_omac: Rework registration of magma/kuznyechik OMAC digests

Convert to a table method.

4 years agogost_md2012: Add registration using GostR3411_2012_{256,512}_digest
Vitaly Chikunov [Tue, 12 May 2020 22:02:13 +0000 (01:02 +0300)]
gost_md2012: Add registration using GostR3411_2012_{256,512}_digest

4 years agogost_crypt: Add Gost28147_89_MAC_digest, Gost28147_89_mac_12_digest
Vitaly Chikunov [Tue, 12 May 2020 21:53:01 +0000 (00:53 +0300)]
gost_crypt: Add Gost28147_89_MAC_digest, Gost28147_89_mac_12_digest

Covert their registration to table method.

4 years agogost_md: Rework digest registration, add GostR3411_94_digest
Vitaly Chikunov [Tue, 12 May 2020 21:25:35 +0000 (00:25 +0300)]
gost_md: Rework digest registration, add GostR3411_94_digest

Introduce `GOST_digest' to hold digest registration data, and
`GOST_init_digest'/`GOST_deinit_digest` helpers to handle it.

It's single-level templatized.

4 years agogost_crypt: Add some sanity checking to GOST_init_cipher
Vitaly Chikunov [Tue, 12 May 2020 09:26:01 +0000 (12:26 +0300)]
gost_crypt: Add some sanity checking to GOST_init_cipher

- Stream cipher should have block_size 1, other should not.
- Stream cipher should not have padding.
- If IV is specified Custom IV flag should be set.

4 years agogost_eng: Rework (simplify) cipher registration
Vitaly Chikunov [Tue, 12 May 2020 03:01:41 +0000 (06:01 +0300)]
gost_eng: Rework (simplify) cipher registration

Now we don't need a struct to hold cipher list. And can use simple array
of pointers to `GOST_cipher'.

4 years agogost_keyexpimp: Rework cipher registration
Vitaly Chikunov [Tue, 12 May 2020 02:40:00 +0000 (05:40 +0300)]
gost_keyexpimp: Rework cipher registration

4 years agogost_grasshopper_cipher: Remove redundant code
Vitaly Chikunov [Tue, 12 May 2020 02:26:53 +0000 (05:26 +0300)]
gost_grasshopper_cipher: Remove redundant code

Not needed after cipher registration converted into table way.

4 years agogost_grasshopper_cipher: Rework cipher registration
Vitaly Chikunov [Tue, 12 May 2020 01:58:03 +0000 (04:58 +0300)]
gost_grasshopper_cipher: Rework cipher registration

This only adds registering via tables, but not removing obsolete code.

4 years agogost_crypt: Allow templates in GOST_cipher
Vitaly Chikunov [Tue, 12 May 2020 00:55:39 +0000 (03:55 +0300)]
gost_crypt: Allow templates in GOST_cipher

Avoid duplication of struct values with help of 1-level templates.

4 years agogost_crypt: Add magma_cbc_cipher
Vitaly Chikunov [Mon, 11 May 2020 23:34:54 +0000 (02:34 +0300)]
gost_crypt: Add magma_cbc_cipher

4 years agogost_crypt: Add magma_ctr_acpkm_omac_cipher
Vitaly Chikunov [Mon, 11 May 2020 23:32:00 +0000 (02:32 +0300)]
gost_crypt: Add magma_ctr_acpkm_omac_cipher

4 years agogost_crypt: Add magma_ctr_acpkm_cipher
Vitaly Chikunov [Mon, 11 May 2020 23:27:45 +0000 (02:27 +0300)]
gost_crypt: Add magma_ctr_acpkm_cipher

4 years agogost_crypt: Add magma_ctr_cipher
Vitaly Chikunov [Mon, 11 May 2020 23:23:34 +0000 (02:23 +0300)]
gost_crypt: Add magma_ctr_cipher

4 years agogost_crypt: Add Gost28147_89_cnt_12_cipher
Vitaly Chikunov [Mon, 11 May 2020 23:19:45 +0000 (02:19 +0300)]
gost_crypt: Add Gost28147_89_cnt_12_cipher

4 years agogost_crypt: Add Gost28147_89_cnt_cipher
Vitaly Chikunov [Mon, 11 May 2020 23:16:25 +0000 (02:16 +0300)]
gost_crypt: Add Gost28147_89_cnt_cipher

4 years agogost_crypt: Add Gost28147_89_cbc_cipher
Vitaly Chikunov [Mon, 11 May 2020 23:10:07 +0000 (02:10 +0300)]
gost_crypt: Add Gost28147_89_cbc_cipher

4 years agogost_crypt: Rework cipher registration, add Gost28147_89_cipher
Vitaly Chikunov [Mon, 11 May 2020 22:28:04 +0000 (01:28 +0300)]
gost_crypt: Rework cipher registration, add Gost28147_89_cipher

4 years agoAllow skipping perl tests
Dmitry Belyavskiy [Mon, 11 May 2020 13:55:47 +0000 (16:55 +0300)]
Allow skipping perl tests

4 years agoFinally normally passing MAC tests
Dmitry Belyavskiy [Sun, 10 May 2020 15:22:10 +0000 (18:22 +0300)]
Finally normally passing MAC tests

4 years agoRestore kuznyechik-mac test
Dmitry Belyavskiy [Sun, 10 May 2020 15:00:03 +0000 (18:00 +0300)]
Restore kuznyechik-mac test

4 years agoReenable some hmac tests
Dmitry Belyavskiy [Sun, 10 May 2020 14:44:03 +0000 (17:44 +0300)]
Reenable some hmac tests

4 years agoUpdate the HMAC calculation example
Dmitry Belyavskiy [Sun, 10 May 2020 14:37:49 +0000 (17:37 +0300)]
Update the HMAC calculation example

Fix #244

4 years agoMerge branch 'master' of https://github.com/gost-engine/engine
Dmitry Belyavskiy [Sun, 10 May 2020 14:15:45 +0000 (17:15 +0300)]
Merge branch 'master' of https://github.com/gost-engine/engine

4 years agoCoverity issue #300971
Dmitry Belyavskiy [Sun, 10 May 2020 14:15:00 +0000 (17:15 +0300)]
Coverity issue #300971

4 years agotest_ciphers: Enable Magma CBC test
Vitaly Chikunov [Sat, 9 May 2020 22:26:35 +0000 (01:26 +0300)]
test_ciphers: Enable Magma CBC test

Since it's fixed in previous commit.

4 years agogost_crypt: Fix Magma CBC in-place decryption
Vitaly Chikunov [Sat, 9 May 2020 22:20:40 +0000 (01:20 +0300)]
gost_crypt: Fix Magma CBC in-place decryption

Simplest fix not concerned with performance, still should not impact it
too much.

4 years agotest_digest: Add another carry test vector, also test GOST94
Vitaly Chikunov [Sat, 9 May 2020 21:54:25 +0000 (00:54 +0300)]
test_digest: Add another carry test vector, also test GOST94

This vector triggers so much bugs in different implementations.

4 years agotest_digest: Reduce arguments to tests, make concise logging
Vitaly Chikunov [Sat, 9 May 2020 21:29:57 +0000 (00:29 +0300)]
test_digest: Reduce arguments to tests, make concise logging

- Less arguments - less scary function calls.
- Better screen output: all tests now shown.
- Some typo corrections.

4 years agotest_digest: Test CMAC using EVP_MAC (provider) API
Vitaly Chikunov [Sat, 9 May 2020 21:13:11 +0000 (00:13 +0300)]
test_digest: Test CMAC using EVP_MAC (provider) API

Use chance of having CMAC test vector to test CMAC provider.

4 years agotest_digest: Test old and new APIs
Vitaly Chikunov [Sat, 9 May 2020 20:02:25 +0000 (23:02 +0300)]
test_digest: Test old and new APIs

Both HMAC (deprecated) and EVP_MAC (since 3.0).
Also, remove redundant test iteration in do_digest().

4 years agotest: List untested digests and ciphers
Vitaly Chikunov [Sat, 9 May 2020 19:47:24 +0000 (22:47 +0300)]
test: List untested digests and ciphers

It's good to know what needs to be done.

4 years agoGOST CMS encryption implementation.
Dmitry Belyavskiy [Sun, 10 May 2020 12:14:48 +0000 (15:14 +0300)]
GOST CMS encryption implementation.

4 years agoError regeneration
Dmitry Belyavskiy [Sat, 9 May 2020 17:20:22 +0000 (20:20 +0300)]
Error regeneration

4 years agoUseful wrap script
Dmitry Belyavskiy [Sat, 9 May 2020 16:37:46 +0000 (19:37 +0300)]
Useful wrap script

4 years agoEnabling TC26 CMS tests
Dmitry Belyavskiy [Sat, 9 May 2020 16:36:12 +0000 (19:36 +0300)]
Enabling TC26 CMS tests

4 years agoUpdate INSTALL.md according to actual standards
Dmitry Belyavskiy [Sat, 9 May 2020 16:00:33 +0000 (19:00 +0300)]
Update INSTALL.md according to actual standards

4 years agoImprove diagnostics
Dmitry Belyavskiy [Sat, 9 May 2020 14:24:09 +0000 (17:24 +0300)]
Improve diagnostics

4 years agomagma-ctr-acpkm + magma-ctr-acpkm-omac
Dmitry Belyavskiy [Sat, 9 May 2020 10:47:48 +0000 (13:47 +0300)]
magma-ctr-acpkm + magma-ctr-acpkm-omac

4 years agoRefactoring unprotected attributes processing
Dmitry Belyavskiy [Sat, 9 May 2020 10:18:32 +0000 (13:18 +0300)]
Refactoring unprotected attributes processing

4 years agotest_digest: Do HMAC using EVP_MAC API
Vitaly Chikunov [Sat, 9 May 2020 04:46:17 +0000 (07:46 +0300)]
test_digest: Do HMAC using EVP_MAC API

They say `HMAC' API is deprecated since 3.0, thus `EVP_MAC' API should
be used.
  https://www.openssl.org/docs/manmaster/man3/HMAC_CTX_free.html

4 years agotest_ciphers: Add Magma CTR (and CBC) test(s)
Vitaly Chikunov [Sat, 9 May 2020 03:57:12 +0000 (06:57 +0300)]
test_ciphers: Add Magma CTR (and CBC) test(s)

- CTR vector is from standard.
- CBC vector is generated by PR_GOSTR_bch_v9. CBC test fail in-place
  decryption, so it's disabled by `#if 0'.

4 years agogost_crypt: Fix IV length for Magma CTR mode
Vitaly Chikunov [Sat, 9 May 2020 03:15:32 +0000 (06:15 +0300)]
gost_crypt: Fix IV length for Magma CTR mode

It's 4, half of block size.

4 years agotest_digest: Add Magma OMAC1 test
Vitaly Chikunov [Sat, 9 May 2020 00:07:13 +0000 (03:07 +0300)]
test_digest: Add Magma OMAC1 test

From GOST R 34.13-2015 (А.2.6).

4 years agotest_digest: Add HMAC tests for Streebog
Vitaly Chikunov [Fri, 8 May 2020 23:49:47 +0000 (02:49 +0300)]
test_digest: Add HMAC tests for Streebog

From RFC 7836 (B) and R 50.1.113-2016 (A).

4 years agotest_digest: Add more test vectors for Streebog
Vitaly Chikunov [Fri, 8 May 2020 21:51:48 +0000 (00:51 +0300)]
test_digest: Add more test vectors for Streebog

Dumps from `etalon/' dir.

4 years agotest_digest: Move MAC tests from test_cipher to test_digest
Vitaly Chikunov [Fri, 8 May 2020 20:33:50 +0000 (23:33 +0300)]
test_digest: Move MAC tests from test_cipher to test_digest

Here is better place, because they all digests.

4 years agotest_ciphers: Rework cipher test
Vitaly Chikunov [Fri, 8 May 2020 18:53:30 +0000 (21:53 +0300)]
test_ciphers: Rework cipher test

- Use EVP API instead of direct calls to gost-engine;
- Remove MAC tests (they should go into test_digest);
- Expand `testcases' array to be more readable;
- Add some asserts of IV and block sizes.
- Remove noisy hex dumps if there is no errors;
- Note: no new cipers are added.

4 years agotest_ciphers: Rename test_grasshopper to test_ciphers
Vitaly Chikunov [Fri, 8 May 2020 17:24:31 +0000 (20:24 +0300)]
test_ciphers: Rename test_grasshopper to test_ciphers

Better name to add more ciphers to test. Also, move it up in the tests
just after digests.

4 years agotest_context: Test digests too
Vitaly Chikunov [Fri, 8 May 2020 17:08:50 +0000 (20:08 +0300)]
test_context: Test digests too

Test if copying `EVP_MD_CTX' is working good for GOST digests.

4 years agotest_context: Instantiate ciphers using EVP API instead of direct calls
Vitaly Chikunov [Fri, 8 May 2020 14:49:15 +0000 (17:49 +0300)]
test_context: Instantiate ciphers using EVP API instead of direct calls

Also, use testcases table and add more ciphers.

4 years agoReverse travis experiments
Dmitry Belyavskiy [Fri, 8 May 2020 08:51:43 +0000 (11:51 +0300)]
Reverse travis experiments

4 years agoTry to use known good commit for tests
Dmitry Belyavskiy [Thu, 7 May 2020 20:13:05 +0000 (23:13 +0300)]
Try to use known good commit for tests

4 years agoIt does not work this way
Dmitry Belyavskiy [Thu, 7 May 2020 19:50:39 +0000 (22:50 +0300)]
It does not work this way

4 years agoTravis tuning - known good commit
Dmitry Belyavskiy [Thu, 7 May 2020 19:19:47 +0000 (22:19 +0300)]
Travis tuning - known good commit

4 years ago[test] ECC: KATs for the curves in RFC4357 and RFC7836
Billy Brumley [Thu, 7 May 2020 17:13:42 +0000 (20:13 +0300)]
[test] ECC: KATs for the curves in RFC4357 and RFC7836

* Tests that gost-engine correctly computes the public key from the
private key. (Twice -- Alice and Bob.)

* Tests that gost-engine correctly computes the derived shared key.
(Twice -- Alice and Bob, should be identical.)

4 years ago-debug_decrypt option
Dmitry Belyavskiy [Wed, 6 May 2020 17:47:27 +0000 (20:47 +0300)]
-debug_decrypt option

4 years agoAllow GOST 2001 CMS decryption
Dmitry Belyavskiy [Wed, 6 May 2020 17:45:02 +0000 (20:45 +0300)]
Allow GOST 2001 CMS decryption

4 years agoUpdate rsa cms/smime tests to avoid regression
Dmitry Belyavskiy [Wed, 6 May 2020 17:22:58 +0000 (20:22 +0300)]
Update rsa cms/smime tests to avoid regression

4 years agoAllow IANA ciphersuite
Dmitry Belyavskiy [Wed, 6 May 2020 16:39:48 +0000 (19:39 +0300)]
Allow IANA ciphersuite

4 years agoFix failing ssl tests
Dmitry Belyavskiy [Wed, 6 May 2020 16:34:05 +0000 (19:34 +0300)]
Fix failing ssl tests

4 years agoFix Coverity #300461
Dmitry Belyavskiy [Wed, 6 May 2020 15:12:10 +0000 (18:12 +0300)]
Fix Coverity #300461

4 years agoFix coverity issue 300458
Dmitry Belyavskiy [Mon, 4 May 2020 20:01:48 +0000 (23:01 +0300)]
Fix coverity issue 300458

4 years agoFix coverity issue 300457
Dmitry Belyavskiy [Mon, 4 May 2020 19:57:42 +0000 (22:57 +0300)]
Fix coverity issue 300457

4 years agoTesting against master to avoid known build bug in alpha1
Dmitry Belyavskiy [Mon, 4 May 2020 18:20:53 +0000 (21:20 +0300)]
Testing against master to avoid known build bug in alpha1

4 years agoUpdate CA verification test
Dmitry Belyavskiy [Mon, 4 May 2020 17:59:41 +0000 (20:59 +0300)]
Update CA verification test

4 years agoCTR encryption update
Dmitry Belyavskiy [Mon, 4 May 2020 17:55:31 +0000 (20:55 +0300)]
CTR encryption update

4 years agoTypo in CA verify command
Dmitry Belyavskiy [Mon, 4 May 2020 17:42:42 +0000 (20:42 +0300)]
Typo in CA verify command

4 years agoFixing ca cert verification
Dmitry Belyavskiy [Mon, 4 May 2020 17:31:33 +0000 (20:31 +0300)]
Fixing ca cert verification

4 years agoTemporary commented out weird failure
Dmitry Belyavskiy [Mon, 4 May 2020 17:19:08 +0000 (20:19 +0300)]
Temporary commented out weird failure

4 years agoTry to make mac test happy
Dmitry Belyavskiy [Mon, 4 May 2020 17:04:17 +0000 (20:04 +0300)]
Try to make mac test happy

4 years agoTemporary commented out the RSA test
Dmitry Belyavskiy [Mon, 4 May 2020 16:50:23 +0000 (19:50 +0300)]
Temporary commented out the RSA test

4 years agoTCL engine test updated
Dmitry Belyavskiy [Mon, 4 May 2020 16:42:56 +0000 (19:42 +0300)]
TCL engine test updated

4 years agoMake grasshopper_test happy
Dmitry Belyavskiy [Mon, 4 May 2020 16:27:24 +0000 (19:27 +0300)]
Make grasshopper_test happy

4 years agoMake engine test happier
Dmitry Belyavskiy [Mon, 4 May 2020 13:45:25 +0000 (16:45 +0300)]
Make engine test happier

4 years agoSwitching Travis to 3.0.0-alpha1, try 2
Dmitry Belyavskiy [Mon, 4 May 2020 13:29:37 +0000 (16:29 +0300)]
Switching Travis to 3.0.0-alpha1, try 2

4 years agoMerge branch 'master' of https://github.com/gost-engine/engine
Dmitry Belyavskiy [Mon, 4 May 2020 13:16:35 +0000 (16:16 +0300)]
Merge branch 'master' of https://github.com/gost-engine/engine

4 years agoSwitching Travis to 3.0.0-alpha1
Dmitry Belyavskiy [Mon, 4 May 2020 13:15:59 +0000 (16:15 +0300)]
Switching Travis to 3.0.0-alpha1

4 years agotest_tls: Fix test hanging on some OpenSSL errors
Vitaly Chikunov [Sun, 3 May 2020 20:12:47 +0000 (23:12 +0300)]
test_tls: Fix test hanging on some OpenSSL errors

Handle abnormal exit of s_client/s_server processes.

Fixes partially #230.

4 years agoOpenSSL 3.0 required
Dmitry Belyavskiy [Mon, 4 May 2020 12:48:39 +0000 (15:48 +0300)]
OpenSSL 3.0 required

4 years agoKUZNYECHIK-CTR_ACPKM-OMAC implementation
Dmitry Belyavskiy [Mon, 4 May 2020 11:14:19 +0000 (14:14 +0300)]
KUZNYECHIK-CTR_ACPKM-OMAC implementation

4 years agoKuznyechik ASN1 parameters parsing
Dmitry Belyavskiy [Sun, 3 May 2020 17:14:30 +0000 (20:14 +0300)]
Kuznyechik ASN1 parameters parsing

4 years agofixup! Magma/Kuznyechik ASN1 parameters and functions
Dmitry Belyavskiy [Sun, 3 May 2020 16:43:55 +0000 (19:43 +0300)]
fixup! Magma/Kuznyechik ASN1 parameters and functions

4 years agoMagma/Kuznyechik ASN1 parameters and functions
Dmitry Belyavskiy [Sun, 3 May 2020 16:42:05 +0000 (19:42 +0300)]
Magma/Kuznyechik ASN1 parameters and functions

4 years agoUKM must be set
Dmitry Belyavskiy [Sun, 3 May 2020 13:45:59 +0000 (16:45 +0300)]
UKM must be set

4 years agoPSKeyTransport_gost includes UKM
Dmitry Belyavskiy [Sun, 3 May 2020 13:45:26 +0000 (16:45 +0300)]
PSKeyTransport_gost includes UKM

4 years agoUpdated decrypt selection logic
Dmitry Belyavskiy [Sun, 3 May 2020 11:42:34 +0000 (14:42 +0300)]
Updated decrypt selection logic

4 years agoRestoring gost89 CMS support in gost engine for OpenSSL 3.0
Dmitry Belyavskiy [Sun, 3 May 2020 11:11:17 +0000 (14:11 +0300)]
Restoring gost89 CMS support in gost engine for OpenSSL 3.0

4 years agoNo deprecation-related warnings
Dmitry Belyavskiy [Sun, 3 May 2020 11:57:28 +0000 (14:57 +0300)]
No deprecation-related warnings