summaryrefslogtreecommitdiffstats
path: root/crypto/ec
AgeCommit message (Collapse)Author
2017-12-08Standardize syntax of sizeof(foo)Rich Salz
Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4876)
2017-11-01Address a timing side channel whereby it is possible to determine somePauli
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) (cherry picked from commit 4a089bbdf11f9e231cc68f42bba934c954d81a49)
2017-10-02Fix the return type of felem_is_zero_int which should be int.Bernd Edlinger
Change argument type of xxxelem_is_zero_int to const void* to avoid the need of type casts. Fixes #4413 Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4450) (cherry picked from commit c55b786a8911cef41f890735ba5fde79e116e055)
2017-08-25Clear secret stack values after use in curve25519.cBernd Edlinger
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4242) (cherry picked from commit 78f1e4d0b063e17c9700f2aceecaca03bfa434f3)
2017-07-29Implement the CRYPTO_secure_clear_free function.Bernd Edlinger
Use OPENSSL_secure_clear_free for secure mem BIOs and X25519 private keys. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4048)
2017-07-23Fix const correctness of EC_KEY_METHOD_get_*Johannes Bauer
Changes the EC_KEY_METHOD_get_* family to not need a EC_KEY_METHOD* as its first parameter, but a const EC_KEY_METHOD*, which is entirely sufficient. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Paul Dale <paul.dale@oracle.com> GH: #3985 (cherry picked from commit 4e9b720e90ec154c9708139e96ec0ff8e2796c82)
2017-06-20Address some -Wold-style-declaration warningsBenjamin Kaduk
gcc's -Wextra pulls in -Wold-style-declaration, which triggers when a declaration has a storage-class specifier as a non-initial qualifier. The ISO C formal grammar requires the storage-class to be the first component of the declaration, if present. Seeint as the register storage-class specifier does not really have any effect anymore with modern compilers, remove it entirely while we're here, instead of fixing up the order. Interestingly, the gcc devteam warnings do not pull in -Wextra, though the clang ones do. [extended tests] Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3239) (cherry picked from commit f44903a428cc63ce88bfba26e8e4e2e9b21f058d)
2017-06-14Fix crash in ecdh_simple_compute_key.Bernd Edlinger
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3671) (cherry picked from commit abea494cf75061650deecf584adc2cd293ce322d)
2017-06-13Fix a memleak in ec_copy_parameters.Bernd Edlinger
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3666) (cherry picked from commit 188a9bd950837c70661aa6849894e4e02d129031)
2017-06-05ec/asm/ecp_nistz256-x86_64.pl: minor sqr_montx cleanup.Andy Polyakov
Drop some redundant instructions in reduction in ecp_nistz256_sqr_montx. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 8fc063dcc9668589fd95533d25932396d60987f9)
2017-05-11Cleanup - use e_os2.h rather than stdint.hRichard Levitte
Not exactly everywhere, but in those source files where stdint.h is included conditionally, or where it will be eventually Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3447) (cherry picked from commit 74a011ebb5e9028ef18982d737a434a8ff926a95)
2017-05-02Fix URL links in commentRich Salz
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3365) (cherry picked from commit dea0eb2c5452cd4c2160a64a6868e79efeca6e9d)
2017-02-24Increase the size of the stack buffer to prevent an overflow.Pauli
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2721) (cherry picked from commit 8fce04ee3540ba3039bb66df34ea3f076a599ab9)
2017-02-22Fix typo, should be && rather than &Richard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2689) (cherry picked from commit 50799f3558981eac0482d3ea77b21c58b56d4871)
2017-02-22Iterate over EC_GROUP's poly array in a safe wayRich Salz
Prevent that memory beyond the last element is accessed if every element of group->poly[] is non-zero Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2689) (cherry picked from commit 57f48f939ed5d3119e3c691ea0a8a3ac2f4a1a9e)
2017-02-14mem leak on error path and error propagation fixYuchi
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2559) (cherry picked from commit e0670973d5c0b837eb5a9f1670e47107f466fbc7)
2016-11-15Check return value of some BN functions.Rich Salz
Factorise multiple bn_get_top(group->field) calls Add missing checks on some conditional BN_copy return value Add missing checks on some BN_copy return value Add missing checks on a few bn_wexpand return value Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1626) (cherry picked from commit 78e09b53a40729f5e99829ccc733b592bd22fea1)
2016-09-10Fix EC_KEY_print so it prints out private key informationTim Hudson
even when the public key is not present in an EC_KEY Reviewed-by: Stephen Henson <steve@openssl.org> (cherry picked from commit 82f52631b21b021787f344733e08bb53f1e7f0ec)
2016-09-07Avoid EVP_PKEY_cmp() crash on EC keys without public componentDavid Woodhouse
Some hardware devices don't provide the public EC_POINT data. The only way for X509_check_private_key() to validate that the key matches a given certificate is to actually perform a sign operation and then verify it using the public key in the certificate. Maybe that can come later, as discussed in issue 1532. But for now let's at least make it fail gracefully and not crash. GH: 1532 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1547)
2016-08-29Remove comment tags from structs (coding style)Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit d196305aa0de1fc38837c27cb1ea6e60af9dd98d)
2016-08-29Use uppercase name for PCT_ enumRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 66117ab0f6c21a7c123becd58bd38a736e551c43)
2016-08-24ec/asm/ecp_nistz256-x86_64.pl: /cmovb/cmovc/ as nasm doesn't recognize cmovb.Andy Polyakov
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-24ec/ecp_nistz256: harmonize is_infinity with ec_GFp_simple_is_at_infinity.Andy Polyakov
RT#4625 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-24ec/ecp_nistz256: harmonize is_infinity with ec_GFp_simple_is_at_infinity.Andy Polyakov
RT#4625 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-24ec/asm/ecp_nistz256-*.pl: addition to perform stricter reduction.Andy Polyakov
Addition was not preserving inputs' property of being fully reduced. Thanks to Brian Smith for reporting this. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-24ec/asm/ecp_nistz256-x86_64.pl: addition to perform stricter reduction.Andy Polyakov
Addition was not preserving inputs' property of being fully reduced. Thanks to Brian Smith for reporting this. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-22Fix a memory leak in EC_GROUP_get_ecparameters()Kazuki Yamaguchi
The variable 'buffer', allocated by EC_POINT_point2buf(), isn't free'd on the success path. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-21ecp_nistz256.c: get is_one on 32-bit platforms right.Andy Polyakov
Thanks to Brian Smith for reporting this. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-19constify i2o_ECPublicKeyDr. Stephen Henson
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-08-17Constify private key decode.Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-08-17constify X509_ALGOR_get0()Dr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-08-16Add ASN1_STRING_get0_data(), deprecate ASN1_STRING_data().Dr. Stephen Henson
Deprecate the function ASN1_STRING_data() and replace with a new function ASN1_STRING_get0_data() which returns a constant pointer. Update library to use new function. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-13Remove old EC based X25519 code.Dr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-13Add encoded points to other EC curves too.Dr. Stephen Henson
Add encoded point ctrl support for other curves: this makes it possible to handle X25519 and other EC curve point encoding in a similar way for TLS. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-13Add point ctrls to X25519Dr. Stephen Henson
Add ctrl operations to set or retrieve encoded point in EVP_PKEY structures containing X25519 keys. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-13add to build.infoDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-13make errorsDr. Stephen Henson
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-13X25519 public key methodsDr. Stephen Henson
Add X25519 methods to match current key format defined in draft-ietf-curdle-pkix-02 Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-08-05spelling fixes, just comments and readme.klemens
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1413)
2016-08-02Fix some style issues...FdaSilvaYY
extra spacing and 80 cols Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1366)
2016-08-01Const EC_KEY_dupRichard J. Moore
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-25Constify EC_KEY_*_oct2priv() input bufferFdaSilvaYY
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1300)
2016-07-20Check for errors allocating the error strings.Kurt Roeckx
Reviewed-by: Richard Levitte <levitte@openssl.org> GH: #1330
2016-07-20Don't allocate r/s in DSA_SIG and ECDSA_SIGDr. Stephen Henson
To avoid having to immediately free up r/s when setting them don't allocate them automatically in DSA_SIG_new() and ECDSA_SIG_new(). RT#4590 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-16fix memory leaksMiroslav Franc
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1313)
2016-07-15Fix ASN.1 private encode of EC_KEY to not change the input keyRichard Levitte
RT#4611 Reviewed-by: Stephen Henson <steve@openssl.org>
2016-07-15check return values for EVP_Digest*() APIsDr. Stephen Henson
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-01Fix printing private EC_KEYAlessandro Ghedini
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1273)
2016-06-29Whitespace cleanup in cryptoFdaSilvaYY
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1264)
2016-06-26RT2680: Public EC key is shown as privateRich Salz
Re-implemented as suggested by Steve Henson. Also change ECParameters_print the same way. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>