aboutsummaryrefslogtreecommitdiff
path: root/gost_ec_keyx.c
AgeCommit message (Collapse)AuthorFilesLines
2022-12-02Implementation of the MGM mode for magma/kuznyechikigrkir1-1/+1
first implemented in ossl_patched branch uses dynamic NIDs Signed-off-by: Sergei Ianovich <sergei.ianovich@ya.ru>
2022-05-23On unpacking key blob output buffer size should be fixedv3.0.1Dmitry Belyavskiy1-9/+14
Related: CVE-2022-29242
2022-05-23Fix buffer overrun in creating key transport blob according to RFC 9189, 4.2.4.2Dmitry Belyavskiy1-1/+21
Resolves: CVE-2022-29242
2022-05-23Fix buffer overrun in creating key transport blob according to RFC 9189, 4.2.4.1Dmitry Belyavskiy1-1/+20
Resolves: CVE-2022-29242
2022-01-09gost_ec_keyx: Check CTX data before it's really usedVitaly Chikunov1-4/+12
This should fix Coverity warning: *** CID 345243: Null pointer dereferences (REVERSE_INULL) /gost_ec_keyx.c: 681 in pkey_gost2018_decrypt() 675 o Q_eph is on the same curve as server public key; 676 677 o Q_eph is not equal to zero point; 678 679 o q * Q_eph is not equal to zero point. 680 */ >>> CID 345243: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "data" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 681 if (eph_key == NULL || priv == NULL || data == NULL) { 682 GOSTerr(GOST_F_PKEY_GOST2018_DECRYPT, 683 GOST_R_ERROR_COMPUTING_EXPORT_KEYS); 684 ret = 0; 685 goto err; 686 } Signed-off-by: Vitaly Chikunov <vt@altlinux.org> Issue: #380
2021-08-11push VKO cofactor clearing into ECCKiilaBilly Brumley1-1/+7
2021-04-02Update gost_ec_keyx.cse-prok1-0/+7
It's not right to have segmentation faults.
2020-11-28Add explicit support for NID_id_GostR3410_2001DH (GOST R 34.10-2001 DH)Dmitry Timoshkov1-1/+1
2020-07-09Allow to use raw VKO in EVP_PKEY_deriveVitaly Chikunov1-2/+22
Suitable for tests. Use EVP_PKEY_CTRL_SET_VKO ctrl with appropriate digest nid to enable VKO mode.
2020-07-03GOST ECC optimizations (#263)Billy Brumley1-1/+1
Standalone EC implementations from ECCKiila. https://gitlab.com/nisec/ecckiila
2020-06-10gost_ec_keyx: Update header plate with copyrights and description (#266)Vitalio1-1/+7
2020-06-08GOST key agreement cofactor fix (#265)Billy Brumley1-30/+32
* GOST key agreement cofactor fix
2020-05-18Fix code formating.Nikolay Morozov1-20/+20
All tabs replcaded with spaces. One file was 2 tabs fornating.
2020-05-10GOST CMS encryption implementation.Dmitry Belyavskiy1-28/+37
2020-05-04Fix coverity issue 300458Dmitry Belyavskiy1-4/+9
2020-05-04UKM must be setDmitry Belyavskiy1-0/+13
2020-05-04Updated decrypt selection logicDmitry Belyavskiy1-1/+16
2020-02-29cppcheck: Variable is reassigned a value before the old one has been used.Nikolay Morozov1-1/+0
Plus some minor chnages - function defenition doen't match function declaration - Consecutive break statement is unnecessary. - Type missmatch in format string
2020-02-26keyx: Add OPENSSL_cleanse for internal buffersVitaly Chikunov1-0/+5
Only stack buffers are considered.
2020-02-26ec: Use BN_{CTX_,}secure_new memory API for priv keysVitaly Chikunov1-2/+2
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'.
2019-10-15gost_ec_keyx: Remove redundant codeVitaly Chikunov1-4/+0
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'.
2019-10-15gost_ec_keyx: Fix CID 253282 Dereference null return valueVitaly Chikunov1-0/+2
`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.
2019-09-26gost_ec_keyx: Fix CID 253283 Unchecked return value in VKO_compute_keyVitaly Chikunov1-2/+5
Calling EC_POINT_get_affine_coordinates() without checking return value. Some fixes for Coverity Scan from issue #174.
2019-09-05Make VKO_compute_key public.Dmitry Timoshkov1-4/+4
2019-04-04Cofactor should be taken into account in VKODmitry Belyavskiy1-1/+4
2018-12-29Some PVS Studio nitsDmitry Belyavskiy1-2/+1
2018-12-25Avoid double-free, restore ephemeral mode self-compatibilityDmitry Belyavskiy1-2/+7
2018-12-25Non-ephemeral sec_key, more on TLS 1.2, remove extra params from VKODmitry Belyavskiy1-18/+27
2018-12-18Errors adjustedDmitry Belyavskiy1-1/+1
2018-12-06New master API versioning.Dmitry Belyavskiy1-1/+1
2018-09-07We should get key nid from our private key, not from peer's ephemeralDmitry Belyavskiy1-1/+1
2018-09-06One more TODODmitry Belyavskiy1-0/+10
2018-09-04Let's wrap old and new key enncryption togetherDmitry Belyavskiy1-4/+32
2018-09-04GOST key transport 2018 - decrypt as separate functionDmitry Belyavskiy1-19/+91
2018-09-04GOST key export, separate functionDmitry Belyavskiy1-1/+92
2018-09-03KDF TREE + testDmitry Belyavskiy1-15/+96
2018-09-03Refactoring of VKODmitry Belyavskiy1-16/+24
2018-08-30IndentationDmitry Belyavskiy1-10/+9
2017-06-27Fix compiler warningsMouse1-1/+0
2016-12-15Some cleanupDmitry Belyavskiy1-17/+15
2016-12-11Fix return value of gost_ec_deriveDmitry Belyavskiy1-1/+1
2016-03-26Opaquization fixes + sources formatting.Dmitry Belyavskiy1-2/+2
2016-01-04Correct initializing the contextDmitry Belyavskiy1-5/+11
2016-01-03openssl 1.1.0 compatibilityDmitry Belyavskiy1-7/+7
2016-01-02Formatting fixDmitry Belyavskiy1-2/+3
2015-10-06Build fixDmitry Belyavskiy1-0/+1
2015-10-03Fixes of error codes. Check result of EC_POINT_mulDmitry Belyavskiy1-5/+7
2015-08-21Bugfix.Dmitry Belyavskiy1-1/+1
2015-08-15Merge branch 'no_gost94_sig' into gost12_algsDmitry Belyavskiy1-6/+4
Conflicts: Makefile e_gost_err.c e_gost_err.h gost2001.c gost94_keyx.c gost_ameth.c gost_asn1.c gost_eng.c gost_lcl.h gost_params.c gost_params.h gost_pmeth.c gost_sign.c
2015-08-14Initial commit providing GOST 2012 algorithms.Dmitry Belyavskiy1-0/+339