summaryrefslogtreecommitdiffstats
path: root/crypto/ec
AgeCommit message (Collapse)Author
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>
2016-06-23Make x25519_compute_key() return a booleanhuangqinjin
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-06-23Make ossl_ecdh_compute_key() return a booleanhuangqinjin
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-06-20Make DSA_SIG and ECDSA_SIG getters const.Emilia Kasper
Reorder arguments to follow convention. Also allow r/s to be NULL in DSA_SIG_get0, similarly to ECDSA_SIG_get0. This complements GH1193 which adds non-const setters. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-18Useless includesFdaSilvaYY
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1168)
2016-06-13Ensure that NULL r and s parameters cannot be set on DSA_SIG/ECDSA_SIGs.TJ Saunders
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1193)
2016-06-13Reorder the setter arguments to more consistently match that of other APIs,TJ Saunders
per review comments. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1193)
2016-06-13Implement DSA_SIG_set0() and ECDSA_SIG_set0(), for setting signature values.TJ Saunders
SSH2 implementations which use DSA_do_verify() and ECDSA_do_verify() are given the R and S values, and the data to be signed, by the client. Thus in order to validate these signatures, SSH2 implementations will digest and sign the data -- and then pass in properly provisioned DSA_SIG and ECDSA_SIG objects. Unfortunately, the existing OpenSSL-1.1.0 APIs do not allow for directly setting those R and S values in these objects, which makes using OpenSSL for such SSH2 implementations much more difficult. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1193)
2016-06-09RT 4242: reject invalid EC point coordinatesEmilia Kasper
We already test in EC_POINT_oct2point that points are on the curve. To be on the safe side, move this check to EC_POINT_set_affine_coordinates_* so as to also check point coordinates received through some other method. We do not check projective coordinates, though, as - it's unlikely that applications would be receiving this primarily internal representation from untrusted sources, and - it's possible that the projective setters are used in a setting where performance matters. Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-01Free tempory data on error in ec_wNAF_mul()Matt Caswell
The ec_wNAF_mul() function allocates some temporary storage that it doesn't always free on an error condition. Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-31Parameter copy sanity checks.Dr. Stephen Henson
Don't copy parameters is they're already present in the destination. Return error if an attempt is made to copy different parameters to destination. Update documentation. If key type is not initialised return missing parameters RT#4149 Reviewed-by: Richard Levitte <levitte@openssl.org>