summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Convert ECParameters_dup() from a macro that uses ASN1_dup_of() into anjsing2015-10-132-4/+19
| | | | | | actual function. This removes the last ASN1_dup_of usage from the tree. Feedback from doug@ and miod@
* Replace remaining M_ASN1_BIT_STRING_(new|free) macros with calls tojsing2015-09-291-2/+2
| | | | | | ASN1_BIT_STRING_(new|free). ok beck@ doug@
* Correct spelling of OPENSSL_cleanse.jsing2015-09-106-15/+15
| | | | ok miod@
* Replace remaining M_ASN1_STRING_* macros with calls to ASN1_STRING_*.jsing2015-09-101-5/+5
| | | | | | | This is not the same as the macro expansion, however the ASN1_STRING_* functions do match the macro expansions. ok doug@ miod@
* Expand obsolete M_ASN1.*(cmp|dup|print|set) macros - no change in generatedjsing2015-07-291-5/+5
| | | | | | assembly. ok bcook@
* Expand ASN.1 template macros - the generated assembly only differs byjsing2015-07-251-55/+351
| | | | changes to line numbers.
* Handle NIST curve names.jsing2015-06-201-2/+4
| | | | | | From OpenSSL. ok miod@ (a while ago)
* Have ECPKParameters_print() include the NIST curve name, if known.jsing2015-06-201-1/+10
| | | | | | From OpenSSL. ok miod@ (a while ago).
* Provide EC_curve_nid2nist() and EC_curve_nist2nid().jsing2015-06-202-2/+57
| | | | | | | | From OpenSSL. Rides libcrypto bump. ok miod@ (a while ago)
* No need to check the return value of memcpy() if you actually checked thismiod2015-05-201-3/+2
| | | | pointer for NULL the line above; ok doug@
* Add missing BN_CTX_end() calls.doug2015-04-291-7/+3
| | | | | | | | After calling BN_CTX_start(), there must be a BN_CTX_end() before returning. There were missing BN_CTX_end() calls in error paths. One diff chunk was simply removing redundant code related to this. ok deraadt@
* Fix a memory leak in an error path.doug2015-03-201-1/+3
| | | | | | From OpenSSL commit 5e5d53d341fd9a9b9cc0a58eb3690832ca7a511f. ok guenther@, logan@
* Fix several crash causing defects from OpenSSL.tedu2015-03-191-21/+20
| | | | | | | | | | | | | These include: CVE-2015-0209 - Use After Free following d2i_ECPrivatekey error CVE-2015-0286 - Segmentation fault in ASN1_TYPE_cmp CVE-2015-0287 - ASN.1 structure reuse memory corruption CVE-2015-0289 - PKCS7 NULL pointer dereferences Several other issues did not apply or were already fixed. Refer to https://www.openssl.org/news/secadv_20150319.txt joint work with beck, doug, guenther, jsing, miod
* In ec_wNAF_mul(), move the declaration of tmp_wNAF higher in scope, so thatmiod2015-02-151-6/+5
| | | | | all the function's exit paths can make sure it gets freed. Coverity CID 78861 tweaks & ok doug@ jsing@
* fix leaking of bn, coverity issue 105351beck2015-02-131-1/+2
| | | | ok doug@
* Guenther has plans for OPENSSL_NO_CMS, so revert this for the moment.beck2015-02-111-1/+22
|
* get rid of OPENSSL_NO_CMS code we do not use.beck2015-02-111-22/+1
| | | | ok miod@
* Expand the IMPLEMENT_ASN1_ALLOC_FUNCTIONS macro so that the code is visiblejsing2015-02-101-4/+37
| | | | | | | | | 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@
* Expand the IMPLEMENT_ASN1_FUNCTIONS_{const,fname,name} macros so that thejsing2015-02-101-3/+51
| | | | | | | | | 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@
* BN_CTX_get() can fail - consistently check its return value.jsing2015-02-098-127/+165
| | | | | | | | | | | | | | | There are currently cases where the return from each call is checked, the return from only the last call is checked and cases where it is not checked at all (including code in bn, ec and engine). Checking the last return value is valid as once the function fails it will continue to return NULL. However, in order to be consistent check each call with the same idiom. This makes it easy to verify. Note there are still a handful of cases that do not follow the idiom - these will be handled separately. ok beck@ doug@
* Remove unused GOST test that prevents clang from building libcrypto.doug2015-02-091-55/+1
| | | | | | | | | | clang warns that it is unused and we have -Werror enabled. This test isn't hooked up to anything yet. We can add it back with a future GOST update. clang 3.5 can now build libssl and libcrypto as long as you use CFLAGS=-Wno-pointer-sign. "seems reasonable" bcook@, miod@
* Use `> 0' instead of `!= 0' as a successful condition formiod2015-02-0810-44/+44
| | | | | | EC_POINT_is_at_infinity() and EC_POINT_is_on_curve(), for they may return -1 should an error arise. ok doug@ jsing@
* Delete a lot of #if 0 code in libressl.doug2015-02-072-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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@
* handle the (impossible) situation of a size_t - 1 buffer fromderaadt2014-12-031-2/+2
| | | | | EC_POINT_point2oct so that later allocation does not overflow with miod
* Spotted another opportunity to use reallocarray().deraadt2014-12-031-2/+2
| | | | ok miod
* Fix GOST TC26-B curve description.miod2014-11-121-2/+2
|
* Don't free garbage in ec_wNAF_mul() if wNAF could be allocated butguenther2014-11-111-5/+11
| | | | | | | other allocations in the same block couldn't. problem pointed out by David Ramos on the openssl-dev list ok miod@ doug@
* GOST crypto algorithms (well, most of them), ported from the removed GOSTmiod2014-11-091-2/+322
| | | | | | | | | | | | engine to regular EVP citizens, contributed by Dmitry Eremin-Solenikov; libcrypto bits only for now. This is a verbatim import of Dmitry's work, and does not compile in this state; the forthcoming commits will address these issues. None of the GOST code is enabled in libcrypto yet, for it still gets compiled with OPENSSL_NO_GOST defined. However, the public header gost.h will be installed.
* EC_KEY_set_group() does an EC_GROUP_dup() of its argument, so we don'tmiod2014-10-071-8/+2
| | | | | need to do it in ec_copy_parameters() prior to invoking EC_KEY_set_group(). ok doug@ jsing@
* Fix memory leak.logan2014-07-131-1/+2
| | | | OK from beck@ and miod@
* if (x) FOO_free(x) -> FOO_free(x).miod2014-07-1219-276/+151
| | | | | | | Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-113-11/+14
| | | | | | | | Remove the openssl public includes from cryptlib.h and add a small number of includes into the source files that actually need them. While here, also sort/group/tidy the includes. ok beck@ miod@
* Explicitly include <openssl/opensslconf.h> in every file that referencesjsing2014-07-1016-29/+59
| | | | | | | | | 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.
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-102-2/+6
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* remove unused, private version strings except SSL_version_strbcook2014-07-091-4/+1
| | | | | | Also remove unused des_ver.h, which exports some of these strings, but is not installed. ok miod@ tedu@
* Avoid a NULL deref in i2d_ECPrivateKey() when an EC_KEY lacks the public keymiod2014-07-011-2/+2
| | | | | | member (which is perfectly acceptable). From BoringSSL (Adam Langley), commit f71a27920a903c9c36bcb31e68781b17674d3fd2
* tags as requested by miod and teduderaadt2014-06-1226-24/+26
|
* malloc() result does not need a cast.deraadt2014-06-077-7/+7
| | | | ok miod
* copy a comment placed in other files; req from miodderaadt2014-05-311-1/+3
|
* more: no need for null check before freederaadt2014-05-307-32/+15
| | | | ok tedu guenther
* no need for null check before free. from Brendan MacDonelltedu2014-05-301-6/+3
|
* ok, next pass after review: when possible, put the reallocarray argumentsderaadt2014-05-291-1/+1
| | | | in the "size_t nmemb, size_t size"
* convert 53 malloc(a*b) to reallocarray(NULL, a, b). that is 53deraadt2014-05-295-13/+20
| | | | | | | | | potential integer overflows easily changed into an allocation return of NULL, with errno nicely set if need be. checks for an allocations returning NULL are commonplace, or if the object is dereferenced (quite normal) will result in a nice fault which can be detected & repaired properly. ok tedu
* Everything sane has stdio, and FILE *. we don't need ifdefs for this.beck2014-05-292-6/+0
| | | | ok to firebomb from tedu@
* calloc instead of malloc/memset. from Benjamin Baiertedu2014-05-253-12/+6
|
* if (x) free(x) -> free(x); semantic patch generated with coccinelle, carefullymiod2014-05-222-10/+5
| | | | eyeballed before applying. Contributed by Cyril Roelandt on tech@
* Stop being a dummy... presumably these are left overs from pedantic modejsing2014-05-154-8/+0
| | | | | | that were not wrapped with #if PEDANTIC. ok miod@
* Typo in C99 field initializer introduced in r1.3;miod2014-05-091-1/+1
| | | | reported by Steven Chamberlain
* Replace Apache v2 license with ISC license.matthew2014-05-094-50/+50
| | | | | Thanks to Google for agreeing to offer the code under more agreeable licensing terms!
* kill some more VMS ifdefsgiovanni2014-05-083-12/+0
| | | | ok miod@