summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bn (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Emergency knfectomie requested by tedu@.jsing2014-05-0830-6133/+6618
|
* with the first bug it uncovered fixed, clear all bignums again.tedu2014-05-071-17/+9
| | | | i've never worked on codebase so resistant to efforts to improve it.
* in BN_clear_free, don't cleanse the data if the static data flag is set.tedu2014-05-071-3/+2
| | | | | | | | much debugging work done by otto. ok miod otto. side note: BN_FLG_STATIC_DATA doesn't actually mean the data is static. it's also used to indicate the data may be secretly shared behind your back as a sort of poor man's refcounting, but without the refcounting.
* revert, thanks sthentedu2014-05-071-9/+17
|
* inspired by a cloudflare diff, cleanse old memory when expanding a bignum.tedu2014-05-051-17/+9
| | | | | | however, instead of trying to audit all the places where a secret bignum is used, apply the big hammer and clear all bignums when freed. ok deraadt miod
* typosmiod2014-05-031-2/+2
|
* More use of 64-bit registers which needs to be disabled under OpenBSD.miod2014-05-021-0/+2
|
* Do not output SOM-specific directives.miod2014-05-011-0/+6
|
* Fix include filename to get register name aliases under BSDmiod2014-05-011-6/+1
|
* Pass -Werror in the !BN_LLONG !BN_UMULT_LOHI !BN_UMULT_HIGH case.miod2014-05-011-4/+4
|
* dead meatmiod2014-05-012-2528/+0
|
* First pass at removing win64 support from the assembly generating Perljsing2014-04-302-286/+0
| | | | | | | scripts. We certainly do not need an identical copy of the win64 exception handler in each script (surely one copy would be sufficient). ok miod@
* Remove WIN32, WIN64 and MINGW32 tentacles.miod2014-04-282-10/+1
| | | | | | | | Also check for _LP64 rather than __arch64__ (the former being more reliable than __LP64__ or __arch64__) to tell 64-bit int platforms apart from 32-bit int platforms. Loosely based upon a diff from Martijn van Duren on tech@
* Try to clean the maze of <openssl/bn.h> defines regarding the BN internals.miod2014-04-2410-227/+25
| | | | | | | | | | | | | | | | | | | | | | | The intent of this change is to only keep support for two kind of architectures: - those with 32-bit int and long, and 64-bit long long, where ``long * long -> long long'' multiplication routines are available. - those with 64-bit int and long, and no 128-bit long long type. This gets rid of the SIXTY_FOUR_BIT_LONG, SIXTY_FOUR_BIT (not the same!), THIRTY_TWO_BIT, SIXTEEN_BIT and EIGHT_BIT defines. After this change, the types and defines are as follows: arch: 64bit 32bit rationale BN_LLONG undefined defined defined if l * l -> ll BN_ULLONG undefined u long long result of BN_LONG * BN_LONG BN_ULONG u long u int native register size BN_LONG long int the same, signed BN_BITS 128 64 size of 2*BN_ULONG in bits BN_BYTES 8 4 size of 2*BN_ULONG in bytes BN_BITS2 64 32 BN_BITS / 2 Tested on various 32-bit and 64-bit OpenBSD systems of various endianness.
* One last Dec C tentacle on alpha.miod2014-04-231-4/+1
|
* When I grow up, I want to write workaround for long long multiplicationsmiod2014-04-231-15/+0
| | | | under __TANDEM systems and compilers, using hardcoded octal numbers. NOT.
* Remove IRIX_CC_BUG workaround.miod2014-04-231-6/+0
|
* I'm glad to know that Ultrix CC has a bug optimizing switch() statementsmiod2014-04-231-5/+0
| | | | | lacking an explicit `case 0:' construct. But Ultrix has been dead for more than 15 years, really. Don't give it any reason to move out of its coffin.
* Unifdef -UPEDANTIC. ok beck@ tedu@miod2014-04-232-2/+2
|
* Remove meat which either duplicates code found in apps/, or is only of valuemiod2014-04-224-661/+0
| | | | for 20th century historians, and can be put in the Attic.
* theo found a file we don't seem to need, but just in case, i will pastetedu2014-04-201-3/+0
| | | | | | the contents below: #!/usr/local/bin/perl # x86 assember
* Lacking a proof that--for this implementation--exposure of Montgomeryguenther2014-04-192-7/+7
| | | | | | | | multiplication or RSA blinding parameters doesn't permit retroactive timing analysis of the secrets, we'll do the stupidly cheap thing and cleanse them before freeing them. ok deraadt@
* We'll interpret a (void) cast on snprintf() to mean it's been verified thatguenther2014-04-191-4/+4
| | | | | | truncation is either desirable, not an issue, or is detected and handled later ok deraadt@
* Do not ask the user to pass either -DB_ENDIAN or -DL_ENDIAN to the compiler,miod2014-04-181-1/+3
| | | | | | | but rather figure out the endianness from <machine/endian.h> automagically; help from guenther@ ok jca@ guenther@ beck@ and the rest of the `Buena SSL rampage club'
* Get rid of MS Visual C compiler and Intel C compiler specific defines.miod2014-04-171-9/+0
|
* Nuke BN_DEBUG_LEVITTEmiod2014-04-171-10/+0
|
* todo: do not leave 15 year old todo lists in the tree.miod2014-04-171-3/+0
|
* Use of OPENSSL_SYS_xxx defines in public header files considered harmful.miod2014-04-171-6/+1
|