aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-05-20Update INSTALL.mdopenssl_1_1_1Dmitry Belyavskiy1-1/+0
Remove CRYPT_PARAMS mentioning to avoid confusion
2021-08-27Checking CMAKE_SKIP_INSTALL in install stepskartaris1-11/+13
2021-08-27TRY_RUN should not be run when compiling cmake in CROSS_COMPILEkartaris1-25/+29
2021-08-20gost_omac included into gost_core there is no need to include it ingo ↵kartaris1-2/+0
gost_engine
2021-08-20test_keyexpimp, test_grasshopper, test_context and test_curves need ↵kartaris1-4/+4
OpenSSL::Crypto
2021-08-20VERBOSE=1kartaris1-1/+1
2021-08-20Dropped unnecessary libskartaris1-4/+4
2021-08-20Increased minimum version for CMakekartaris1-1/+1
2021-08-20Switch to using OpenSSL target names in CMakeLists.txtRichard Levitte1-8/+8
Cmake 3.0 was a switch to using targets and properties rather than variables when linking different components together. We follow that philosophy by dropping ${OPENSSL_CRYPTO_LIBRARIES} and ${OPENSSL_SSL_LIBRARIES} in favor of OpenSSL::Crypto and OpenSSL::SSL. (cherry picked from commit 36c50fa58c3cc1c5a30fd94aad77490e44abf022) # Conflicts: # CMakeLists.txt
2021-08-20Reduce the repeated library dependence informationRichard Levitte1-8/+9
Cmake is generally good at tracking specified dependencies between libraries. All that we need to do is to establish a dependency on OpenSSL's libcrypto for 'gost_core', and then we can reduce the amount of repeated dependencies for everything that links against 'gost_core'. (cherry picked from commit 7ca9b827135b90cfc2567058b56325a518a3d57a) # Conflicts: # CMakeLists.txt
2021-08-20Make CMakeLists.txt work better with static OpenSSL librariesRichard Levitte1-13/+13
The static OpenSSL libraries have some dependencies that need to be recorded fofr everything that's linked against it. To achieve this, we use ${OPENSSL_CRYPTO_LIBRARIES} and ${OPENSSL_SSL_LIBRARIES} instead of ${OPENSSL_CRYPTO_LIBRARY} and ${OPENSSL_SSL_LIBRARY}. (cherry picked from commit 3df647770ff9aa8bd3b08c6ff8200da1ee69565c) # Conflicts: # CMakeLists.txt
2021-08-20WIP: Made changes to be able to build gost-engine as static library. Added ↵kartaris3-15/+34
gost-engine.h to be able to load engine as static engine for openssl. Made gost_core library independent. Corrected openssl version in cirrus.yml Related issue: #340
2021-02-26Avoid some buffer overflowsDmitry Belyavskiy1-0/+15
2020-12-11magma consts changedAleksey Terentyev1-2/+2
2020-12-06backport commit 2dd3a2f from master (#301)igrkir2-22/+43
* backport commit 2dd3a2f from master update magma cipher ctr_acpkm mode encrypting Fixed bug when acpkm key meshing didn't apply at appropriate time during TLS secure exchange. Unify usage of 'num' variable of EVP_CIPHER_CTX for kuznetchik and magma. * correct define variable dependency add optional compiling setting for EVP_CTRL_TLS1_2_TLSTREE variable Co-authored-by: Igor Kirillov <i.kirillov@kryptonite.ru>
2020-12-06gost_crypt: process full available block in CFB and CNT modeAlexei A. Smekalkine1-2/+2
If at the input of the encryption function in the CFB mode we have an integer number of blocks, then in the main loop all blocks will be processed, except for the last one due to an incorrect border check. The last block will be fully processed as a "partial" remainder, but the initialization vector will not be updated. And, thus, the value of IV will always be incorrect in this case. This breaks stateless protocols due to an invalid initialization vector: all messages except the first cannot be decrypted. (Naturally, we are talking about a case with disabled key meshing, which does not allow context recovery due to an erroneous implementation.) It is worth noting here that the code for processing partial blocks (both at the input of the encryption functions and at the output) is a historically unnecessary artifact, since we do not set the EVP_CIPH_FLAG_CUSTOM_CIPHER flag and, as a result, OpenSSL processes partial blocks for us. This patch corrects the checking of the main loop boundary. A similar error is present in the code for the CNT mode, but there it does not manifest itself in any way, because the restoration of the state in this mode is impossible: even after disabling key meshing, we still have the state-dependent transformation of the IV. As an extra result of this fix, the code for processing partial blocks can be completely removed now. (cherry picked from commit cf402dd4d89271d5b1ca4ea938ce7a2f13a44d58)
2020-11-28Tests updated to support GOST2001DHDmitry Belyavskiy2-2/+2
2020-11-28Add explicit support for NID_id_GostR3410_2001DH (GOST R 34.10-2001 DH)Dmitry Timoshkov4-1/+22
(cherry picked from commit e1afd2a137a0a4cab89260202fdc1828263d098d)
2020-10-31fix_cbc_281Wolfgang Beck1-1/+3
2020-10-29CMakeLists.txt: Fix warning on gcc-9Vitaly Chikunov1-2/+2
/root/rpmbuild/BUILD/openssl-gost-engine-1.1.1/CMakeFiles/CMakeTmp/src.c:4:14: warning: initialization of 'int *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types] 4 | int *p = buf + 1; | ^~~ /root/rpmbuild/BUILD/openssl-gost-engine-1.1.1/CMakeFiles/CMakeTmp/src.c:5:14: warning: initialization of 'int *' from incompatible pointer type 'char *' [-Wincompatible-pointer-types] 5 | int *q = buf + 2; | ^~~ Reported-by: Ilya Shipitsin <https://github.com/chipitsine> Fixes: #288 (cherry picked from commit 6c7addf78b7fe7c8841d4cda6c9d710e4992c7a6)
2020-09-18KDF Tree fix for BIG_ENDIANDmitry Belyavskiy1-8/+1
(cherry picked from commit 47be42da87cb9bf9bad6f415c442b586ce0752ef)
2020-09-18Strict alignment Kuznyechik bugfixDmitry Belyavskiy1-0/+6
(cherry picked from commit 1997dd99db27383a89d1f91bd4d7091b553ca6ee)
2020-09-18Provide cmake test if alignment requirement is strictVitaly Chikunov1-0/+12
This is based on AX_CHECK_ALIGNED_ACCESS_REQUIRED from autoconf-archive. Note, that on some arches unaligned access behavior could be changed at runtime via prctl(1). Also, unaligned memory access is still slower (and very slow on some arches) even if it's not strictly required. (cherry picked from commit d2810d23a9f30ae885f9bf0783f0847a12972ff3)
2020-09-18Endianess bugfixDmitry Belyavskiy1-0/+5
(cherry picked from commit f1f47c6c7710291157aa863768d9048aaeaa9530)
2020-08-07Edwards map fixBilly Brumley2-33/+33
ECCKiila Changes from https://gitlab.com/nisec/ecckiila/-/issues/2 https://gitlab.com/nisec/ecckiila/-/commit/7445ecabef77965743e0ae8d39d7433b07820be6 * X3 -> X1 * eliminate a temp variable X3 = X1 as pointers is the reason this was still passing unit tests. But that might not hold in future versions of ECCKiila, so fix it now. (cherry picked from commit 259301a5adf2ef51b8f380b27fcead313669206e)
2020-08-07GOST EC armv7 aarch64 fixesBilly Brumley8-142/+158
char defaults to signed on x86/x64, but unsigned on ARM. (cherry picked from commit 409a1c2b76ac1d783bef6d35542e338d3777b5ac)
2020-08-07GOST ECC optimizations (#263)Billy Brumley12-12/+103730
Standalone EC implementations from ECCKiila. https://gitlab.com/nisec/ecckiila (cherry picked from commit bc346202fbb3bc838a19af8c3b0e449926589c7b)
2020-08-07GOST key agreement cofactor fix (#265)Billy Brumley2-35/+55
* GOST key agreement cofactor fix (cherry picked from commit dbc8f4780fa78d66a68174f78f9ae9aa9cdad53c)
2020-08-07[test] ECC: KATs for the curves in RFC4357 and RFC7836Billy Brumley1-26/+191
* 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.) (cherry picked from commit 95dd55b1152cc51bbd50d5eb09b459840971d68d)
2020-05-03gost_eng: Make it use arrays instead of repeatable codeVitaly Chikunov1-300/+295
2020-05-02Free memoryDmitry Belyavskiy1-0/+1
2020-05-01Fix code aligningDmitry Belyavskiy1-18/+18
2020-05-01Rebuild error files to avoid build failuresDmitry Belyavskiy3-69/+137
2020-05-01pkeyutl -derive supportDmitry Belyavskiy5-135/+97
Support of pkeyutl -pkeyopt ukmhex:0102030405060708 syntax
2020-03-01test_digest: Test all block sizes and alignmentsVitaly Chikunov1-1/+129
There need to be more tests than 2 constant fixed size blocks. Final digest values are generated from the first run. Test description in comments.
2020-02-29cppcheck: Variable is reassigned a value before the old one has been used.Nikolay Morozov7-17/+12
Plus some minor chnages - function defenition doen't match function declaration - Consecutive break statement is unnecessary. - Type missmatch in format string
2020-02-27cppcheck: The scope of the variable can be reduced.Nikolay Morozov8-39/+32
2020-02-26keyx: Add OPENSSL_cleanse for internal buffersVitaly Chikunov1-0/+5
Only stack buffers are considered.
2020-02-26Replace RAND_bytes with RAND_priv_bytesVitaly Chikunov3-4/+4
`RAND_priv_bytes' is supposed to be used for private data.
2020-02-26ec: Use BN_{CTX_,}secure_new memory API for priv keysVitaly Chikunov4-35/+17
OpenSSL suggests to use (and internally itself uses) `BN_{CTX_,}secure_new' primitives to work with private keys. These are using `OPENSSL_secure_malloc' et al. calls, which use special 'secure heap' memory. Along, optimize out `hashsum2bn' with `BN_lebin2bn'.
2020-02-22No need for special OFB contextDmitry Belyavskiy2-29/+10
2020-02-17CMakeLists.txt: Skip perl tests if there is no Test2::V0Vitaly Chikunov1-6/+13
`Test2::V0' is non standard and rarely present on systems, making `make test' unnecessarily fail.
2020-02-17cppcheck: function defenition doen't match function declarationNikolay Morozov3-16/+16
2020-02-14GOST89 key maskingNikolay Morozov2-105/+111
2020-02-14Destroy GOST key data with OPENSSL_cleanse()Nikolay Morozov2-5/+9
2020-02-10elbrus: Treat __e2k__ as __x86_64__ for StreebogVitaly Chikunov2-2/+2
lcc emulates x86_64 SIMD intrinsics, so SSE2 code will work as is. Even though in benchmarks it is slightly slower than regular implementation
2020-02-10elbrus: Workaround `-Werror=assign-where-compare-meant'Vitaly Chikunov1-4/+7
This is lcc bug. Curiously, it is not triggered in `test_context.c' and `test_grasshopper.c'. "lcc: "/usr/src/gost-engine/test_curves.c", строка 32: ошибка: вероятное использование "=" вместо "==" [-Werror=assign-where-compare-meant] #define TEST_ASSERT(e) {if ((test = (e))) \ ^ в раскрытие макроса "TEST_ASSERT" на строке 217 TEST_ASSERT(0);"
2020-02-10elbrus: Workaround '#pragma message' [-Werror=unknown-pragmas]Vitaly Chikunov1-1/+1
"lcc: "/usr/src/gost-engine/gosthash2012_ref.h", строка 15: ошибка: нераспознанная #pragma [-Werror=unknown-pragmas] # pragma message "Use regular implementation" ^" Also, cmake does not detect lcc.
2020-02-10gosthash2012: Properly ifdef '_mm_empty' callVitaly Chikunov1-1/+1
There is other architectures besides __x86_64__, so EMMS should be issued on IA-32 only where we are using MMX.
2020-02-06gosthash2012_const: Remove unused arrays with constantsVitaly Chikunov1-98/+0
This probably would reduce size of the library. And remove some 'not used' warnings (-Wunused-const-variable). Previously `Ax' is generated dynamically from `A` and `Pi` in `GOST3411Init', but in 2013 it is moved into `gosthash2012_precalc.h`. `Tau' is unrolled and eliminated in 2013 too.