summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/ecdsa
AgeCommit message (Collapse)AuthorFilesLines
2019-06-04Readability tweak in a comment.tb1-2/+2
2019-06-04Remove the blinding later to avoid leaking information on the lengthtb1-3/+3
of ckinv. Pointed out and fix suggested by David Schrammel and Samuel Weiser ok jsing
2019-01-19Partial port of EC_KEY_METHOD from OpenSSL 1.1.tb1-3/+3
Pass const method to EC_KEY_METHOD_get_*() to get rid of an XXX. from markus
2019-01-19Partial port of EC_KEY_METHOD from OpenSSL 1.1.tb3-30/+64
This commit adds missing API for ECDH/ECDSA_verify. from markus
2019-01-19Partial port of EC_KEY_METHOD from OpenSSL 1.1.tb4-25/+84
This commit adds init/free, support for signing, setting and getting the method, engine support as well as extra data. from markus
2018-07-10Factor out a bit of ugly code that truncates the digest to the order_bitstb1-32/+32
leftmost bits of a longer digest, according to FIPS 183-6, 6.4. Eliminate a microoptimization that only converts the relevant part of the digest to a bignum. ok beck, jsing
2018-06-16Tiny tweak to the blinding comment.tb1-2/+4
2018-06-15Basic cleanup. Handle the possibly NULL ctx_in in ecdsa_sign_setup() withtb1-66/+61
the usual idiom. All the allocations are now handled inside conditionals as is usually done in this part of the tree. Turn a few comments into actual sentences and remove a few self-evident ones. Change outdated or cryptic comments into more helpful annotations. In ecdsa_do_verify(), start calculating only after properly truncating the message digest. More consistent variable names: prefer 'order_bits' and 'point' over 'i' and 'tmp_point'. ok jsing
2018-06-15Clean up some whitespace and polish a few comments. Reduces noise intb1-24/+21
an upcoming diff.
2018-06-14Use a blinding value when generating an ECDSA signature, in order totb1-14/+65
reduce the possibility of a side-channel attack leaking the private key. Suggested by Keegan Ryan at NCC Group. With input from and ok jsing
2018-06-13Avoid a timing side-channel leak when generating DSA and ECDSA signatures.jsing1-2/+2
This is caused by an attempt to do fast modular arithmetic, which introduces branches that leak information regarding secret values. Issue identified and reported by Keegan Ryan of NCC Group. ok beck@ tb@
2018-04-28Fix a small timing side channel in ecdsa_sign_setup(). Up to whitespacetb1-8/+25
this is OpennSSL commit 4a089bbdf11f9e231cc68f42bba934c954d81a49. ok beck, jsing Original commit message: commit 4a089bbdf11f9e231cc68f42bba934c954d81a49 Author: Pauli <paul.dale@oracle.com> Date: Wed Nov 1 06:58:39 2017 +1000 Address a timing side channel whereby it is possible to determine some information about the length of the scalar used in ECDSA operations from a large number (2^32) of signatures. This doesn't rate as a CVE because: * For the non-constant time code, there are easier ways to extract more information. * For the constant time code, it requires a significant number of signatures to leak a small amount of information. Thanks to Neals Fournaise, Eliane Jaulmes and Jean-Rene Reinhard for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4576)]
2018-04-14make ENGINE_finish() succeed on NULL and simplify callers as intb1-8/+5
OpenSSL commit 7c96dbcdab9 by Rich Salz. This cleans up the caller side quite a bit and reduces the number of lines enclosed in #ifndef OPENSSL_NO_ENGINE. codesearch.debian.net shows that almost nothing checks the return value of ENGINE_finish(). While there, replace a few nearby 'if (!ptr)' with 'if (ptr == NULL)'. ok jsing, tested by & ok inoguchi
2018-03-17Provide ECDSA_SIG_{g,s}et0().tb2-2/+38
ok jsing
2017-05-02use freezero() instead of memset/explicit_bzero + free. Substantiallyderaadt2-9/+4
reduces conditional logic (-218, +82). MOD_EXP_CTIME_MIN_CACHE_LINE_WIDTH cache alignment calculation bn/bn_exp.c wasn'tt quite right. Two other tricky bits with ASN1_STRING_FLAG_NDEF and BN_FLG_STATIC_DATA where the condition cannot be collapsed completely. Passes regress. ok beck
2017-01-29Send the function codes from the error functions to the bit bucket,beck3-56/+44
as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
2017-01-21Add ct and nonct versions of BN_mod_inverse for internal usebeck1-4/+6
ok jsing@
2017-01-05Avoid a side-channel cache-timing attack that can leak the ECDSA privatejsing1-1/+3
keys when signing. This is due to BN_mod_inverse() being used without the constant time flag being set. This issue was reported by Cesar Pereida Garcia and Billy Brumley (Tampere University of Technology). The fix was developed by Cesar Pereida Garcia.
2016-12-21Explicitly export a list of symbols from libcrypto.jsing1-7/+3
Move the "internal" BN functions from bn.h to bn_lcl.h and stop exporting the bn_* symbols. These are documented as only being intended for internal use, so why they were placed in a public header is beyond me... This hides 363 previously exported symbols, most of which exist in headers that are not installed and were never intended to be public. This also removes a few crusty old things that should have died long ago (like _ossl_old_des_read_pw). But don't worry... there are still 3451 symbols exported from the library. With input and testing from inoguchi@. ok beck@ inoguchi@
2015-10-16Remove pointless externs - the structs are declared in the same files ajsing1-2/+1
few lines above.
2015-10-16Expand DECLARE_ASN1_ALLOC_FUNCTIONS and DECLARE_ASN1_FUNCTIONS_constjsing1-2/+6
macros. The only change in the generated assembly is due to line numbering.
2015-10-16Remove pointless uses of DECLARE_ASN1_ENCODE_FUNCTIONS_const.jsing1-2/+1
DECLARE_ASN1_FUNCTIONS_const already includes this macro so using both means we end up with duplicate function prototypes and externs.
2015-09-10Correct spelling of OPENSSL_cleanse.jsing1-2/+2
ok miod@
2015-07-24Expand ASN.1 template macros - no change in generated assembly.jsing1-5/+27
2015-02-10Expand the IMPLEMENT_ASN1_FUNCTIONS_{const,fname,name} macros so that thejsing1-2/+26
code is visible and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
2015-02-08Lob a KNF grenade into the ecdsa code.jsing8-312/+288
2015-02-07Delete a lot of #if 0 code in libressl.doug1-9/+1
There are a few instances where #if 1 is removed but the code remains. Based on the following OpenSSL commits. Some of the commits weren't strictly deletions so they are going to be split up into separate commits. 6f91b017bbb7140f816721141ac156d1b828a6b3 3d47c1d331fdc7574d2275cda1a630ccdb624b08 dfb56425b68314b2b57e17c82c1df42e7a015132 c8fa2356a00cbaada8963f739e5570298311a060 f16a64d11f55c01f56baa62ebf1dec7f8fe718cb 9ccc00ef6ea65567622e40c49aca43f2c6d79cdb 02a938c953b3e1ced71d9a832de1618f907eb96d 75d0ebef2aef7a2c77b27575b8da898e22f3ccd5 d6fbb194095312f4722c81c9362dbd0de66cb656 6f1a93ad111c7dfe36a09a976c4c009079b19ea1 1a5adcfb5edfe23908b350f8757df405b0f5f71f 8de24b792743d11e1d5a0dcd336a49368750c577 a2b18e657ea1a932d125154f4e13ab2258796d90 8e964419603d2478dfb391c66e7ccb2dcc9776b4 32dfde107636ac9bc62a5b3233fe2a54dbc27008 input + ok jsing@, miod@, tedu@
2015-01-28Fix a number of issues relating to algorithms in signatures, Mostlybeck1-2/+14
from OpenSSL with a hint of boring and some things done here. Addresses CVE-2014-8275 for OpenSSL fully ok miod@ doug@
2014-11-17Make the ECDSA_SIG bowels public. This matches RSA_SIG and DSA_SIG, and wemiod2-30/+30
expect a good use for this knowledge in the tree in the near future. Contributed by Vincent Gross, thanks!
2014-10-18None of these need to include <openssl/rand.h>jsing1-2/+1
2014-07-12if (x) FOO_free(x) -> FOO_free(x).miod1-27/+15
Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
2014-07-10Explicitly include <openssl/opensslconf.h> in every file that referencesjsing5-5/+17
an OPENSSL_NO_* define. This avoids relying on something else pulling it in for us, plus it fixes several cases where the #ifndef OPENSSL_NO_XYZ is never going to do anything, since OPENSSL_NO_XYZ will never defined, due to the fact that opensslconf.h has not been included. This also includes some miscellaneous sorting/tidying of headers.
2014-07-09remove unused, private version strings except SSL_version_strbcook1-3/+1
Also remove unused des_ver.h, which exports some of these strings, but is not installed. ok miod@ tedu@
2014-06-12tags as requested by miod and teduderaadt8-8/+8
2014-06-07malloc() result does not need a cast.deraadt1-1/+1
ok miod
2014-04-27Use C99 initializers for the various FOO_METHOD structs. More readable, andmiod1-10/+4
avoid unreadable/unmaintainable constructs like that: const EVP_PKEY_ASN1_METHOD cmac_asn1_meth = { EVP_PKEY_CMAC, EVP_PKEY_CMAC, 0, "CMAC", "OpenSSL CMAC method", 0,0,0,0, 0,0,0, cmac_size, 0, 0,0,0,0,0,0,0, cmac_key_free, 0, 0,0 }; ok matthew@ deraadt@
2014-04-17Change library to use intrinsic memory allocation functions instead ofbeck1-4/+4
OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free
2014-04-171. RAND_seed is now DEPRECATEDderaadt1-1/+0
2. Even passing a digest in as entropy is sloppy. But apparently the OpenSSL guys could find no objects of lesser value to pass to the pluggable random subsystem, and had to resort to private keys and digests. Classy. ok djm
2014-04-15we don't use these files for buildingtedu1-76/+0
2014-04-15remove FIPS mode support. people who require FIPS can buy something thattedu1-18/+0
meets their needs, but dumping it in here only penalizes the rest of us. ok beck deraadt
2014-04-15Moved to regress/lib/libcrypto.miod1-572/+0
2014-04-14remove auto-generated dependencies from the old unused build system, soderaadt1-64/+0
that it is easier to find code pieces. They are getting in the way. ok miod
2014-04-13Import OpenSSL 1.0.1gmiod1-2/+9
2012-10-13import OpenSSL-1.0.1cdjm6-9/+45
2012-01-05OpenSSL 1.0.0f: import upstream sourcedjm1-7/+78
2011-11-03import OpenSSL 1.0.0edjm3-5/+10
2010-10-01resolve conflicts, fix local changesdjm1-24/+22
2010-10-01import OpenSSL-1.0.0adjm5-135/+118
2009-01-09resolve conflictsdjm1-17/+20
2009-01-05update to openssl-0.9.8i; tested by several, especially krw@djm1-17/+31