aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/rand
Commit message (Collapse)AuthorAgeFilesLines
* Remove /* foo.c */ commentsRich Salz2016-01-2611-11/+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>
* Remove update tagsRich Salz2016-01-201-2/+0
| | | | | Also remove depend/local_depend. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove some old makefile targetsRich Salz2016-01-171-12/+0
| | | | | | | | Remove lint, tags, dclean, tests. This is prep for a new makedepend scheme. This is temporary pending unified makefile, and might help it. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add a no-egd option to disable EGD-related codeBenjamin Kaduk2016-01-142-43/+51
| | | | | | | | The entropy-gathering daemon is used only on a small number of machines. Provide a configure knob so that EGD support can be disabled by default but re-enabled on those systems that do need it. Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Move Makefiles to Makefile.inRich Salz2016-01-122-158/+63
| | | | | | | | | | Create Makefile's from Makefile.in Rename Makefile.org to Makefile.in Rename Makefiles to Makefile.in Address review feedback from Viktor and Richard Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* make updateRichard Levitte2016-01-121-41/+47
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Backwards-compatibility subject to OPENSSL_API_COMPATViktor Dukhovni2016-01-072-4/+6
| | | | | | | | | Provide backwards-compatiblity for functions, macros and include files if OPENSSL_API_COMPAT is either not defined or defined less than the version number of the release in which the feature was deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Remove more (rest?) of FIPS build stuff.Rich Salz2016-01-061-89/+0
| | | | Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Remove the "eay" c-file-style indicatorsRichard Levitte2015-12-181-1/+1
| | | | | | | Since we don't use the eay style any more, there's no point tryint to tell emacs to use it. Reviewed-by: Matt Caswell <matt@openssl.org>
* Rename some BUF_xxx to OPENSSL_xxxRich Salz2015-12-163-10/+12
| | | | | | | | | Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
* make updateDr. Stephen Henson2015-12-091-2/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Cleanup: fix all sources that used EVP_MD_CTX_(create|init|destroy)Richard Levitte2015-12-071-6/+6
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Adjust all accesses to EVP_MD_CTX to use accessor functions.Richard Levitte2015-12-071-31/+41
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* "make update" after async merge.Rich Salz2015-11-231-9/+9
| | | | Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
* Fix async deadlock problemMatt Caswell2015-11-201-0/+17
| | | | | | | | | The rand code can aquire locks and then attempt crypto operations. This can end up in a deadlock if we are using an async engine, because control returns back to the user code whilst still holding the lock. We need to force synchronous operation for these sections of code. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Continue standardising malloc style for libcryptoMatt Caswell2015-11-093-3/+3
| | | | | | | Continuing from previous commit ensure our style is consistent for malloc return checks. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Replace "SSLeay" in API with OpenSSLRich Salz2015-10-303-39/+39
| | | | | | | All instances of SSLeay (any combination of case) were replaced with the case-equivalent OpenSSL. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Fix -Wshadow warnings in mingw builds.Andy Polyakov2015-09-291-3/+3
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* RT3969: Add OPENSSL_SYS_UEFIDavid Woodhouse2015-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This provides support for building in the EDK II reference implementation of UEFI. Most UEFI firmware in existence uses OpenSSL for implementing the core cryptographic functionality needed for Secure Boot. This has always previously been handled with external patches to OpenSSL but we are now making a concerted effort to eliminate those. In this mode, we don't actually use the OpenSSL makefiles; we process the MINFO file generated by 'make files' and incorporate it into the EDK2 build system. Since EDK II builds for various targets with varying word size and we need to have a single prepackaged configuration, we deliberately don't hard-code the setting of SIXTY_FOUR_BIT vs. THIRTY_TWO_BIT in opensslconf.h. We bypass that for OPENSSL_SYS_UEFI and allow EDK II itself to set those, depending on the architecture. For x86_64, EDK II sets SIXTY_FOUR_BIT and thus uses 'long long' for the 64-bit type, even when building with GCC where 'long' is also 64-bit. We do this because the Microsoft toolchain has 32-bit 'long'. Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
* Add UEFI flag for rand buildLong, Qin2015-09-031-2/+2
| | | | | | | Add OPENSSL_SYS_UEFI flag for RAND handling; Signed-off-by: Rich Salz <rsalz@akamai.com> Reviewed-by: Tim Hudson <tjh@openssl.org>
* RT3999: Remove sub-component version stringsRich Salz2015-08-101-2/+0
| | | | | | Especially since after the #ifdef cleanups this is not useful. Reviewed-by: Matt Caswell <matt@openssl.org>
* Fix the update target and remove duplicate file updatesRichard Levitte2015-05-221-0/+2
| | | | | | | | | | | | | | | 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>
* make dependRichard Levitte2015-05-141-8/+9
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-145-5/+5
| | | | | | | | | | | | | There are header files in crypto/ that are used by a number of crypto/ submodules. Move those to crypto/include/internal and adapt the affected source code and Makefiles. The header files that got moved are: crypto/cryptolib.h crypto/md32_common.h Reviewed-by: Rich Salz <rsalz@openssl.org>
* Add OSSL_NELEM macro.Dr. Stephen Henson2015-05-031-3/+2
| | | | | | | Add OSSL_NELEM macro to e_os.h to determine the number of elements in an array. Reviewed-by: Tim Hudson <tjh@openssl.org>
* free cleanup almost the finaleRich Salz2015-04-301-4/+1
| | | | | | | | | | Add OPENSSL_clear_free which merges cleanse and free. (Names was picked to be similar to BN_clear_free, etc.) Removed OPENSSL_freeFunc macro. Fixed the small simple ones that are left: CRYPTO_free CRYPTO_free_locked OPENSSL_free_locked Reviewed-by: Richard Levitte <levitte@openssl.org>
* Code style: space after 'if'Viktor Dukhovni2015-04-161-1/+1
| | | | Reviewed-by: Matt Caswell <matt@openssl.org>
* Remove EXHEADER, TEST, APPS, links:, install: and uninstall: where relevantRichard Levitte2015-03-311-17/+1
| | | | | | | | | | | | With no more symlinks, there's no need for those variables, or the links target. This also goes for all install: and uninstall: targets that do nothing but copy $(EXHEADER) files, since that's now taken care of by the top Makefile. Also, removed METHTEST from test/Makefile. It looks like an old test that's forgotten... Reviewed-by: Rich Salz <rsalz@openssl.org>
* Stop symlinking, move files to intended directoryRichard Levitte2015-03-312-351/+0
| | | | | | | | | | | | | Rather than making include/openssl/foo.h a symlink to crypto/foo/foo.h, this change moves the file to include/openssl/foo.h once and for all. Likewise, move crypto/foo/footest.c to test/footest.c, instead of symlinking it there. Originally-by: Geoff Thorpe <geoff@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
* Deprecate RAND_pseudo_bytesMatt Caswell2015-03-253-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The justification for RAND_pseudo_bytes is somewhat dubious, and the reality is that it is frequently being misused. RAND_bytes and RAND_pseudo_bytes in the default implementation both end up calling ssleay_rand_bytes. Both may return -1 in an error condition. If there is insufficient entropy then both will return 0, but RAND_bytes will additionally add an error to the error queue. They both return 1 on success. Therefore the fundamental difference between the two is that one will add an error to the error queue with insufficient entory whilst the other will not. Frequently there are constructions of this form: if(RAND_pseudo_bytes(...) <= 1) goto err; In the above form insufficient entropy is treated as an error anyway, so RAND_bytes is probably the better form to use. This form is also seen: if(!RAND_pseudo_bytes(...)) goto err; This is technically not correct at all since a -1 return value is incorrectly handled - but this form will also treat insufficient entropy as an error. Within libssl it is required that you have correctly seeded your entropy pool and so there seems little benefit in using RAND_pseudo_bytes. Similarly in libcrypto many operations also require a correctly seeded entropy pool and so in most interesting cases you would be better off using RAND_bytes anyway. There is a significant risk of RAND_pseudo_bytes being incorrectly used in scenarios where security can be compromised by insufficient entropy. If you are not using the default implementation, then most engines use the same function to implement RAND_bytes and RAND_pseudo_bytes in any case. Given its misuse, limited benefit, and potential to compromise security, RAND_pseudo_bytes has been deprecated. Reviewed-by: Richard Levitte <levitte@openssl.org>
* RAND_bytes updatesMatt Caswell2015-03-251-2/+2
| | | | | | | Ensure RAND_bytes return value is checked correctly, and that we no longer use RAND_pseudo_bytes. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Unchecked malloc fixesMatt Caswell2015-03-051-0/+3
| | | | | | | Miscellaneous unchecked malloc fixes. Also fixed some mem leaks on error paths as I spotted them along the way. Reviewed-by: Tim Hudson <tjh@openssl.org>
* RT3684: rand_egd needs stddef.hClang via Jeffrey Walton2015-02-121-4/+1
| | | | | | And remove backup definition of offsetof. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Live code cleanup: remove #if 1 stuffRich Salz2015-02-061-2/+0
| | | | | | | For code bracketed by "#if 1" then remove the alternate "#else .. #endif" lines. Reviewed-by: Andy Polyakov <appro@openssl.org>
* Dead code removal: #if 0 bio, comp, randRich Salz2015-01-291-10/+0
| | | | | | | The start of removing dead code. A remaining #if 0 in bss_conn.c needs more thought. Reviewed-by: Richard Levitte <levitte@openssl.org>
* clang on Linux x86_64 complains about unreachable code.Richard Levitte2015-01-291-1/+0
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* OPENSSL_NO_xxx cleanup: SHARich Salz2015-01-271-11/+1
| | | | | | | | | | | | | | | Remove support for SHA0 and DSS0 (they were broken), and remove the ability to attempt to build without SHA (it didn't work). For simplicity, remove the option of not building various SHA algorithms; you could argue that SHA_224/256/384/512 should be kept, since they're like crypto algorithms, but I decided to go the other way. So these options are gone: GENUINE_DSA OPENSSL_NO_SHA0 OPENSSL_NO_SHA OPENSSL_NO_SHA1 OPENSSL_NO_SHA224 OPENSSL_NO_SHA256 OPENSSL_NO_SHA384 OPENSSL_NO_SHA512 Reviewed-by: Richard Levitte <levitte@openssl.org>
* ifdef cleanup, part 4a: '#ifdef undef'Rich Salz2015-01-241-10/+0
| | | | | | | | | | | This removes all code surrounded by '#ifdef undef' One case is left: memmove() replaced by open-coded for loop, in crypto/stack/stack.c That needs further review. Also removed a couple of instances of /* dead code */ if I saw them while doing the main removal. Reviewed-by: Matt Caswell <matt@openssl.org>
* ifdef cleanup part 3: OPENSSL_SYSNAMERich Salz2015-01-232-3/+3
| | | | | | | | Rename OPENSSL_SYSNAME_xxx to OPENSSL_SYS_xxx Remove MS_STATIC; it's a relic from platforms <32 bits. Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
* ifdef cleanup, 2 remove OPENSSL_NO_SETVBUF_IONBFRich Salz2015-01-221-3/+1
| | | | | | | Use setbuf(fp, NULL) instead of setvbuf(). This removes some ifdef complexity because all of our platforms support setbuf. Reviewed-by: Richard Levitte <levitte@openssl.org>
* More comment realignmentmaster-post-reformatMatt Caswell2015-01-221-4/+4
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-2213-2384/+2374
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Move more comments that confuse indentMatt Caswell2015-01-221-2/+4
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* indent has problems with comments that are on the right hand side of a line.Matt Caswell2015-01-221-6/+7
| | | | | | | Sometimes it fails to format them very well, and sometimes it corrupts them! This commit moves some particularly problematic ones. Reviewed-by: Tim Hudson <tjh@openssl.org>
* Further comment changes for reformat (master)Matt Caswell2015-01-221-2/+4
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Avoid deprecation problems in Visual Studio 13Matt Caswell2015-01-131-59/+2
| | | | Reviewed-by: Andy Polyakov <appro@openssl.org>
* Further comment amendments to preserve formatting prior to source reformatMatt Caswell2015-01-061-1/+2
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* mark all block comments that need format preserving so thatTim Hudson2014-12-301-1/+1
| | | | | | | indent will not alter them when reformatting comments Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* RT3548: Remove some obsolete platformsRich Salz2014-12-172-19/+2
| | | | | | This commit removes BEOS. Reviewed-by: Richard Levitte <levitte@openssl.org>
* RT3544: Restore MWERKS for NetWareRich Salz2014-12-171-1/+7
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>