summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_kmeth.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Copyright year updatesMatt Caswell2023-09-071-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
* fix memory allocation and reference counting issuesPauli2023-07-051-4/+5
| | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Kurt Roeckx <kurt@roeckx.be> (Merged from https://github.com/openssl/openssl/pull/21341)
* ec: update to structure based atomicsPauli2023-07-011-5/+2
| | | | | | Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21260)
* Stop raising ERR_R_MALLOC_FAILURE in most placesRichard Levitte2022-10-051-7/+4
| | | | | | | | | | | | | | | | | | | | | | | Since OPENSSL_malloc() and friends report ERR_R_MALLOC_FAILURE, and at least handle the file name and line number they are called from, there's no need to report ERR_R_MALLOC_FAILURE where they are called directly, or when SSLfatal() and RLAYERfatal() is used, the reason `ERR_R_MALLOC_FAILURE` is changed to `ERR_R_CRYPTO_LIB`. There were a number of places where `ERR_R_MALLOC_FAILURE` was reported even though it was a function from a different sub-system that was called. Those places are changed to report ERR_R_{lib}_LIB, where {lib} is the name of that sub-system. Some of them are tricky to get right, as we have a lot of functions that belong in the ASN1 sub-system, and all the `sk_` calls or from the CRYPTO sub-system. Some extra adaptation was necessary where there were custom OPENSSL_malloc() wrappers, and some bugs are fixed alongside these changes. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19301)
* fips module header inclusion fine-tunningTomas Mraz2021-07-061-1/+3
| | | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15974)
* Update copyright yearMatt Caswell2021-03-111-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14512)
* Fix external symbols related to ec & sm2 keysShane Lontis2021-02-261-3/+3
| | | | | | | | | | | Partial fix for #12964 This adds ossl_ names for the following symbols: ec_*, ecx_*, ecdh_*, ecdsa_*, sm2_* Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14231)
* Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() callRichard Levitte2020-11-131-8/+8
| | | | | | | | | | This includes error reporting for libcrypto sub-libraries in surprising places. This was done using util/err-to-raise Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/13318)
* Rename OPENSSL_CTX prefix to OSSL_LIB_CTXDr. Matthias St. Pierre2020-10-151-1/+1
| | | | | | | | | | | | Many of the new types introduced by OpenSSL 3.0 have an OSSL_ prefix, e.g., OSSL_CALLBACK, OSSL_PARAM, OSSL_ALGORITHM, OSSL_SERIALIZER. The OPENSSL_CTX type stands out a little by using a different prefix. For consistency reasons, this type is renamed to OSSL_LIB_CTX. Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12621)
* Add more complete support for libctx/propq in the EC codeMatt Caswell2020-06-191-4/+11
| | | | | | | | Renames some "new_ex" functions to "new_with_libctx" and ensures that we pass around the libctx AND the propq everywhere. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12159)
* Rename FIPS_MODE to FIPS_MODULERichard Levitte2020-04-281-4/+4
| | | | | | | | | | This macro is used to determine if certain pieces of code should become part of the FIPS module or not. The old name was confusing. Fixes #11538 Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org> (Merged from https://github.com/openssl/openssl/pull/11539)
* Update copyright yearMatt Caswell2020-04-231-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11616)
* Deprecate the ECDH functions.Pauli2020-02-041-0/+6
| | | | | | | | Use of the low level ECDH functions has been informally discouraged for a long time. We now formally deprecate them. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10960)
* Reorganize local header filesDr. Matthias St. Pierre2019-09-281-1/+1
| | | | | | | | | | | | | Apart from public and internal header files, there is a third type called local header files, which are located next to source files in the source directory. Currently, they have different suffixes like '*_lcl.h', '*_local.h', or '*_int.h' This commit changes the different suffixes to '*_local.h' uniformly. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/9333)
* Make the EC code available from inside the FIPS providerMatt Caswell2019-08-061-8/+20
| | | | | Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/9380)
* Following the license change, modify the boilerplates in crypto/ec/Richard Levitte2018-12-061-1/+1
| | | | | | | [skip ci] Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7791)
* Update copyright yearMatt Caswell2018-09-111-1/+1
| | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7176)
* Harmonize the error handling codepathNicola Tuveri2018-09-051-1/+1
| | | | | | | | | Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Paul Dale <paul.dale@oracle.com> (Merged from https://github.com/openssl/openssl/pull/7121)
* Fix const correctness of EC_KEY_METHOD_get_*Johannes Bauer2017-07-231-5/+5
| | | | | | | | | | 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
* Fix and simplify error handling in (RSA/EC_kmeth)_new_method()FdaSilvaYY2016-05-231-17/+12
| | | | | | | | Inspired from PR #873. Nearly same as 2bbf0ba. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Copyright consolidation 06/10Rich Salz2016-05-171-49/+5
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* few missing allocation failure checks and releases on error pathsJ Mohan Rao Arisankala2016-05-091-0/+1
| | | | | | | | - Missing checks for allocation failure. - releasing memory in few missing error paths Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove #error from include files.Rich Salz2016-03-211-3/+1
| | | | | | | | Don't have #error statements in header files, but instead wrap the contents of that file in #ifndef OPENSSL_NO_xxx This means it is now always safe to include the header file. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Convert CRYPTO_LOCK_X509_* to new multi-threading APIAlessandro Ghedini2016-03-081-0/+2
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Convert CRYPTO_LOCK_EC_* to new multi-threading APIAlessandro Ghedini2016-03-081-1/+12
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Handle KDF internally.Dr. Stephen Henson2016-03-021-18/+28
| | | | | | | | Handle KDF in ECDH_compute_key instead of requiring each implementation support it. This modifies the compute_key method: now it allocates and populates a buffer containing the shared secret. Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH715: ENGINE_finish can take NULLRich Salz2016-02-251-4/+2
| | | | | | | Simplifies calling code. Also fixed up any !ptr tests that were nearby, turning them into NULL tests. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | This was done by the following find . -name '*.[ch]' | /tmp/pl where /tmp/pl is the following three-line script: print unless $. == 1 && m@/\* .*\.[ch] \*/@; close ARGV if eof; # Close file to reset $. And then some hand-editing of other files. Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
* Add CRYPTO_EX_DATA; remove EC_EXTRA_DATARich Salz2016-01-131-2/+32
| | | | | | | | | | | | Add CRYPTO_EX_DATA add EndC_KEY_[gs]et_method, From Roumen Petrov. Had to add various exdata calls to init/copy/free the exdata. Had to remove const from some EC functions because exdata isn't const-correct. :( Also remove EC_EXTRA_DATA and use a union to hold the possible pre-computed values and an enum to tell which value is in the union. (Rich Salz) Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Constify EC_KEY in ECDH_compute_key.Dr. Stephen Henson2015-12-161-3/+3
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* make default_ec_key_meth staticDr. Stephen Henson2015-12-101-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Use NULL comparisonDr. Stephen Henson2015-12-091-6/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* EC_KEY_METHOD accessors.Dr. Stephen Henson2015-12-091-0/+172
| | | | | | Set of accessors to set and get each field. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Top level ECDSA sign/verify redirection.Dr. Stephen Henson2015-12-091-0/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Engine EC_KEY_METHOD functionality.Dr. Stephen Henson2015-12-091-2/+2
| | | | | | | | Rename ENGINE _EC_KEY functions to _EC. Add support for EC_KEY_METHOD in ENGINE_set_default et al. Copy ec_meth. Reviewed-by: Richard Levitte <levitte@openssl.org>
* add sign/verify methodsDr. Stephen Henson2015-12-091-1/+4
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add set methods.Dr. Stephen Henson2015-12-091-1/+1
| | | | | | | | | | Add set_group, set_public and set_private methods. An EC_KEY_METHOD can use these to perform any appropriate operation when the key components are set, such as caching data in some more convenient ENGINE specific format or returning an error if the parameters are invalid or the operation is not supported. Reviewed-by: Richard Levitte <levitte@openssl.org>
* EC_KEY_METHOD copy supportDr. Stephen Henson2015-12-091-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* EC_KEY_METHOD init and finish supportDr. Stephen Henson2015-12-091-1/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* ENGINE fixesDr. Stephen Henson2015-12-091-1/+3
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add compute key support to EC_KEY_METHODDr. Stephen Henson2015-12-091-1/+13
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* EC_KEY_METHOD keygen support.Dr. Stephen Henson2015-12-091-1/+2
| | | | | | | Add keygen to EC_KEY_METHOD. Redirect EC_KEY_generate_key through method and set the current EC key generation function as the default. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Support for EC_KEY_METHOD.Dr. Stephen Henson2015-12-091-0/+120
Add EC_KEY_METHOD. This is part of the EC revision and will make EC behave more like other algorithms. Specifically: EC_KEY_METHOD is part of EC_KEY. It is part of ENGINE. Default or key specific implementations can be provided to redirect some or all operations. Reviewed-by: Richard Levitte <levitte@openssl.org>