summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* actually include the prerequisite dependency for BIO instead of doing nastynessbeck2015-10-161-5/+2
|
* remove excessive brackets on pointer mathderaadt2015-09-281-8/+8
|
* Redo 1.25, without the NULL deref.miod2015-09-271-22/+31
| | | | ok sthen@ bcook@
* Revert bn_print.c:r1.25 ("handle negative-zero in BN_bn2dec() too") forsthen2015-09-181-31/+22
| | | | now, it has a NULL deref. Segfault reported by Mikolaj Kucharski, ok bcook
* Handle negative-zero in BN_bn2dec() too, just like in BN_print().deraadt2015-09-131-22/+31
| | | | ok miod
* BN does support negative-zero -- BN_print() sets the standard here.deraadt2015-09-131-3/+3
| | | | | | | BN_bn2hex() had a 1-byte overflow when creating "-0\0". Reported to me a while back by unknown person -- did not have enough experience to push this through then. advice from jsing, ok miod
* Remove workaround for old SIMICS toolchain.miod2015-09-121-45/+1
|
* Remove horribly old and outdated `documentation' for the assembly code.miod2015-09-121-27/+0
|
* Fixup inter-bank movq/movd operations, emit bytes for pclmulqdq again.bcook2015-09-112-12/+12
| | | | | | | | | | Fixes builds gcc + Apple's assembler, working on reenabling builds with older OpenBSD releases. based on OpenSSL commit: https://git.openssl.org/?p=openssl.git;a=commitdiff;h=902b30df193afc3417a96ba72a81ed390bd50de3 ok miod@
* Correct spelling of OPENSSL_cleanse.jsing2015-09-103-8/+9
| | | | ok miod@
* typosmiod2015-08-181-1/+1
|
* Avoid an infinite loop that can be triggered by parsing an ASN.1jsing2015-06-111-3/+8
| | | | | | | | | | | ECParameters structure that has a specially malformed binary polynomial field. Issue reported by Joseph Barr-Pixton and fix based on OpenSSL. Fixes CVE-2015-1788. ok doug@ miod@
* Add missing BN_CTX_end() calls.doug2015-04-293-11/+15
| | | | | | | | 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 indentation that incorrectly implies a different control flow.doug2015-03-212-6/+9
| | | | | | | | | | | | | The actual control flow is intentional while the indenting is incorrect. This is intended to be a cosmetic change. Verified that each of these was part of a KNF commit that wasn't intending to change behavior. Also, double checked against the history of changes in OpenSSL and BoringSSL. Addresses Coverity CIDs: 78842, 78859, 78863. ok tedu@
* Fix CVE-2014-3570: properly calculate the square of a BIGNUM value.bcook2015-02-253-654/+303
| | | | | | | | | | | See https://www.openssl.org/news/secadv_20150108.txt for a more detailed discussion. Original OpenSSL patch here: https://github.com/openssl/openssl/commit/a7a44ba55cb4f884c6bc9ceac90072dea38e66d0 The regression test is modified a little for KNF. ok miod@
* If BN_rand() or BN_pseudo_rand() are called with a NULL rnd argument,jsing2015-02-191-3/+8
| | | | | | | | | BN_bin2bn() will helpfully allocate a BN which is then leaked. Avoid this by explicitly checking for NULL at the start of the bnrand() function. Fixes Coverity ID 78831. ok miod@
* Potential NULL dereference in the error path; Coverity CID 21720miod2015-02-141-2/+2
| | | | ok doug@ jsing@
* Fix tests that got incorrectly inverted with the BN_CTX_get() return checkjsing2015-02-141-5/+5
| | | | | | diff. Spotted by miod@
* Remove unnecessary include of assert.hmiod2015-02-102-4/+2
|
* BN_CTX_get() can fail - consistently check its return value.jsing2015-02-0912-110/+140
| | | | | | | | | | | | | | | 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@
* Delete a lot of #if 0 code in libressl.doug2015-02-071-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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@
* deregister; no binary changejsg2014-10-286-23/+23
| | | | ok jsing@ miod@
* Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().jsing2014-10-222-22/+10
| | | | | | | | arc4random_buf() is guaranteed to always succeed - it is worth noting that a number of the replaced function calls were already missing return value checks. ok deraadt@
* None of these need to include <openssl/rand.h>jsing2014-10-182-6/+2
|
* if (x) FOO_free(x) -> FOO_free(x).miod2014-07-125-23/+14
| | | | | | | Improves readability, keeps the code smaller so that it is warmer in your cache. review & ok deraadt@
* typosmiod2014-07-121-1/+1
|
* Apparently better fix for OpenSSL PR #3397 (Joyent bug #7704), from OpenSSLmiod2014-07-111-2/+2
| | | | trunk
* Make sure BN_sqr never returns negative numbers.miod2014-07-111-1/+2
| | | | OpenSSL PR #3400 via OpenSSL trunk.
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-1125-57/+70
| | | | | | | | 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-1011-14/+44
| | | | | | | | | 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-108-13/+25
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* Remove leading underscore from _BYTE_ORDER and _{LITTLE,BIG}_ENDIAN, to bemiod2014-07-091-2/+2
| | | | | more friendly to systems where the underscore flavours may be defined as empty. Found the hard way be bcook@; joint brainstrom with bcook beck and guenther
* remove unused, private version strings except SSL_version_strbcook2014-07-091-3/+1
| | | | | | Also remove unused des_ver.h, which exports some of these strings, but is not installed. ok miod@ tedu@
* When building a BN on the stack in BN_div(), make sure to initialize all itsmiod2014-06-271-1/+2
| | | | | | fields (i.e. the flags field) before using it. This is currently harmless, but might not be if we end up invoking other BN functions checking for constant-time processing requirement in the future.
* hand-KNF macro the do { } while loopsderaadt2014-06-272-11/+16
|
* Fix incorrect bounds check in amd64 assembly version of bn_mul_mont();miod2014-06-202-4/+4
| | | | | noticed and fix by Fedor Indutny of Joyent ( https://github.com/joyent/node/issues/7704 )
* tags as requested by miod and teduderaadt2014-06-1232-30/+32
|
* malloc() result does not need a cast.deraadt2014-06-075-6/+6
| | | | ok miod
* s/assember/assembler/ before someone gets offended. At the lastderaadt2014-06-068-13/+13
| | | | | hackathon, just saying 'ass ember' was enough to start giggles. Unfortunately far more offensive stuff remains in here...
* Get the public headers from the official place with <openssl/ >deraadt2014-05-311-1/+1
| | | | from Brent Cook
* more: no need for null check before freederaadt2014-05-301-2/+1
| | | | ok tedu guenther
* ok, next pass after review: when possible, put the reallocarray argumentsderaadt2014-05-292-6/+6
| | | | in the "size_t nmemb, size_t size"
* convert 53 malloc(a*b) to reallocarray(NULL, a, b). that is 53deraadt2014-05-294-10/+10
| | | | | | | | | 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-251-2/+1
|
* Almost nothing actually needs to include <openssl/e_os2.h>, however byjsing2014-05-241-1/+2
| | | | | | | including it they get <openssl/opensslconf.h>. So instead of pulling in <openssl/e_os2.h>, just pull in <openssl/opensslconf.h>. "go ahead" miod@
* Replace (sometimes conditional) use of alloca with malloc, and clearingmiod2014-05-232-39/+16
| | | | | | through volatile pointers with explicit_bzero(). ok beck@ jsing@
* if (x) free(x) -> free(x); semantic patch generated with coccinelle, carefullymiod2014-05-222-12/+6
| | | | eyeballed before applying. Contributed by Cyril Roelandt on tech@
* Stop being a dummy... presumably these are left overs from pedantic modejsing2014-05-151-2/+0
| | | | | | that were not wrapped with #if PEDANTIC. ok miod@
* knfectomie.jsing2014-05-081-653/+818
|