summaryrefslogtreecommitdiffstats
path: root/crypto/ec
AgeCommit message (Collapse)Author
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) (cherry picked from commit 92ed7fa575a80955f3bb6efefca9bf576a953586)
2016-08-26ec/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> (cherry picked from commit d3034d31e7c04b334dd245504dd4f56e513ca115)
2016-08-26ec/ecp_nistz256: harmonize is_infinity with ec_GFp_simple_is_at_infinity.Andy Polyakov
RT#4625 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit e3057a57caf4274ea1fb074518e4714059dfcabf)
2016-08-26ec/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> (cherry picked from commit b62b2454fadfccaf5e055a1810d72174c2633b8f)
2016-08-21ec/ecp_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-16make update to have PEM_R_HEADER_TOO_LONG definedRichard Levitte
Reviewed-by: Rich Salz <rsalz@openssl.org>
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> (cherry picked from commit b8a7bd83e68405fdf595077973035ac6fe24cb97)
2016-07-06Fix compilation with CMS disabledOrgad Shaneh
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1293)
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> (cherry picked from commit f72f00d49549c6620d7101f5e9bf7963da6df9ee)
2016-05-11Adding missing BN_CTX_(start/end) in crypto/ec/ec_key.cSteven Valdez
RT#4363 Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org> (cherry picked from commit 2ab851b779a77d119e1677b2495b368a46d83eef) Conflicts: crypto/ec/ec_key.c
2016-02-23ec/asm/ecp_nistz256-x86_64.pl: get corner case logic right.Andy Polyakov
RT#4284 Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit d93753412b455907b4dc09427ccd2382209d9af2)
2016-01-29Add have_precompute_mult testsMatt Caswell
Add tests for have_precompute_mult for the optimised curves (nistp224, nistp256 and nistp521) if present Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 8ce4e7e605577cb5818de068e2c6da60901cddba)
2016-01-29Fix bug in nistp224/256/521 where have_precompute_mult always returns 0Matt Caswell
During precomputation if the group given is well known then we memcpy a well known precomputation. However we go the wrong label in the code and don't store the data properly. Consequently if we call have_precompute_mult the data isn't there and we return 0. RT#3600 Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 615614c8862fb89dcf1551a4e113be0789dddf5f)
2016-01-21RT3863 ECC: Add missing NULL check. Set a flagBilly Brumley
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit dd67493c344d9d98413d2ee7fd2b6fa9411d975c)
2015-12-19Fix URLs mangled by reformatMatt Caswell
Some URLs in the source code ended up getting mangled by indent. This fixes it. Based on a patch supplied by Arnaud Lacombe <al@aerilon.ca> Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-13x86_64 assembly pack: tune clang version detection even further.Andy Polyakov
RT#4171 Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit b9749432346f69b29d82070041e71b237d718ce7)
2015-12-10ec/ecp_nistz256_table.c: fix potential misalignment problem with Sun C.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-12-03Add cleanup of *.sRichard Levitte
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-11-30x86_64 assembly pack: tune clang version detection.Andy Polyakov
RT#4142 Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 76eba0d94bb418325be6409b272eac5e2bd4a0a9) Resolved conflicts: crypto/bn/asm/x86_64-mont.pl crypto/bn/asm/x86_64-mont5.pl Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2015-09-15RT4044: Remove .cvsignore files.Rich Salz
Reviewed-by: Matt Caswell <matt@openssl.org>
2015-09-15d2i: don't update input pointer on failureKurt Roeckx
Reviewed-by: Dr. Stephen Henson <steve@openssl.org> MR #1005 (cherry picked from commit a46c9789ce2aecedceef119e9883513c7a49f1ca)
2015-09-01Fix the comment for POINT_CONVERSION_UNCOMPRESSEDTim Zhang
The |z| value should be 0x04 not 0x02 RT#3838 Signed-off-by: Matt Caswell <matt@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 91d2728b38b1df930f337e163816a0fc9580b6a6)
2015-08-04Fix warning when compiling with no-ec2mMatt Caswell
EC_KEY_set_public_key_affine_coordinates was using some variables that only apply if OPENSSL_NO_EC2M is not defined. Reviewed-by: Viktor Dukhovni <viktor@openssl.org> (cherry picked from commit 8d11b7c7ee84ad0aa243476088285d15b22c5470)
2015-06-10EC_POINT_is_on_curve does not return a booleanMatt Caswell
The function EC_POINT_is_on_curve does not return a boolean value. It returns 1 if the point is on the curve, 0 if it is not, and -1 on error. Many usages within OpenSSL were incorrectly using this function and therefore not correctly handling error conditions. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Kurt Roeckx <kurt@openssl.org> (cherry picked from commit 68886be7e2cd395a759fcd41d2cede461b68843d)
2015-05-26fix copy paste error in ec_GF2m function prototypesBilly Brumley
RT#3858 Reviewed-by: Tim Hudson <tjh@openssl.org> (cherry picked from commit 71f6130b7a96bacbffae4611796ed98c2f724d96)
2015-05-23Fix the update target and remove duplicate file updatesRichard Levitte
We had updates of certain header files in both Makefile.org and the Makefile in the directory the header file lived in. This is error prone and also sometimes generates slightly different results (usually just a comment that differs) depending on which way the update was done. This removes the file update targets from the top level Makefile, adds an update: target in all Makefiles and has it depend on the depend: or local_depend: targets, whichever is appropriate, so we don't get a double run through the whole file tree. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 0f539dc1a2f45580435c39dada44dd276e79cb88) Conflicts: Makefile.org apps/Makefile test/Makefile
2015-04-30Add sanity check to print_bin functionMatt Caswell
Add a sanity check to the print_bin function to ensure that the |off| argument is positive. Thanks to Kevin Wojtysiak (Int3 Solutions) and Paramjot Oberoi (Int3 Solutions) for reporting this issue. Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 3deeeeb61b0c5b9b5f0993a67b7967d2f85186da)
2015-04-27NISTZ256: use EC_POINT API and check errors.Emilia Kasper
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 6038354cf8ca0792420c1ac0ce50d6d2f0aedebf)
2015-04-27NISTZ256: don't swallow malloc errorsEmilia Kasper
Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit a4d5269e6d0dba0c276c968448a3576f7604666a)
2015-04-27NISTZ256: set Z_is_one to boolean 0/1 as is customary.Emilia Kasper
Cosmetic, no real effect. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit 4446044a793a9103a4bc70c0214005e6a4463767)
2015-04-27Error checking and memory leak fixes in NISTZ256.Emilia Kasper
Thanks to Brian Smith for reporting these issues. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-24Fix error checking and memory leaks in NISTZ256 precomputation.Emilia Kasper
Thanks to Brian Smith for reporting these issues. Reviewed-by: Rich Salz <rsalz@openssl.org> (cherry picked from commit 53dd4ddf71ad79a64be934ca19445b1cf560adab)
2015-04-24Correctly set Z_is_one on the return value in the NISTZ256 implementation.Emilia Kasper
Also add a few comments about constant-timeness. Thanks to Brian Smith for reporting this issue. Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-03-31Ensure EC private keys retain leading zerosDouglas E Engert
RFC5915 requires the use of the I2OSP primitive as defined in RFC3447 for storing an EC Private Key. This converts the private key into an OCTETSTRING and retains any leading zeros. This commit ensures that those leading zeros are present if required. Reviewed-by: Andy Polyakov <appro@openssl.org> (cherry picked from commit 30cd4ff294252c4b6a4b69cbef6a5b4117705d22) Conflicts: crypto/ec/ec_asn1.c
2015-03-28ec/asm/ecp_nistz256-x86_64.pl: update commentary with before-after ↵Andy Polyakov
performance data. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit b06a6f7cc44baa0c17207a8f72c4ac360be7b555)
2015-03-19Fix a failure to NULL a pointer freed on error.Matt Caswell
Reported by the LibreSSL project as a follow on to CVE-2015-0209 Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-03-14Avoid reading an unused byte after the bufferAndy Polyakov
Other curves don't have this problem. Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Emilia Käsper <emilia@openssl.org> (cherry picked from commit 9fbbdd73c58c29dc46cc314f7165e45e6d43fd60)
2015-02-25Remove pointless free, and use preferred way of calling d2i_* functionsMatt Caswell
Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-02-25Fix a failure to NULL a pointer freed on error.Matt Caswell
Inspired by BoringSSL commit 517073cd4b by Eric Roman <eroman@chromium.org> CVE-2015-0209 Reviewed-by: Emilia Käsper <emilia@openssl.org>
2015-01-23FIPS build fixes.Dr. Stephen Henson
PR#3673 Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Re-align some comments after running the reformat script.OpenSSL_1_0_2-post-reformatMatt Caswell
This should be a one off operation (subsequent invokation of the script should not move them) This commit is for the 1.0.2 changes Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Rerun util/openssl-format-source -v -c .OpenSSL_1_0_2-post-auto-reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Move more comments that confuse indentMatt Caswell
Conflicts: crypto/dsa/dsa.h demos/engines/ibmca/hw_ibmca.c ssl/ssl_locl.h Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22ec/ecp_nistz256.c: further harmonization with latest rules.Andy Polyakov
Conflicts: crypto/ec/ecp_nistz256.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22ec/ecp_nistz256.c: harmonize with latest indent script.Andy Polyakov
Conflicts: crypto/ec/ecp_nistz256.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix strange formatting by indentMatt Caswell
Conflicts: crypto/hmac/hmac.h Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22indent has problems with comments that are on the right hand side of a line.Matt Caswell
Sometimes it fails to format them very well, and sometimes it corrupts them! This commit moves some particularly problematic ones. Conflicts: crypto/bn/bn.h crypto/ec/ec_lcl.h crypto/rsa/rsa.h demos/engines/ibmca/hw_ibmca.c ssl/ssl.h ssl/ssl3.h Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Fix source where indent will not be able to copeMatt Caswell
Conflicts: apps/ciphers.c ssl/s3_pkt.c Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Additional comment changes for reformat of 1.0.2Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>