aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/buffer/buffer.c
Commit message (Collapse)AuthorAgeFilesLines
* constify PACKETEmilia Kasper2016-02-011-1/+1
| | | | | | | | PACKET contents should be read-only. To achieve this, also - constify two user callbacks - constify BUF_reverse. Reviewed-by: Rich Salz <rsalz@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>
* Rename *_realloc_clean to *_clear_reallocRich Salz2015-12-221-1/+1
| | | | | | | Just like *_clear_free routines. Previously undocumented, used a half-dozen times within OpenSSL source. Reviewed-by: Richard Levitte <levitte@openssl.org>
* remove 0 assignments.Rich Salz2015-09-031-5/+1
| | | | | | | After openssl_zalloc, cleanup more "set to 0/NULL" assignments. Many are from github feedback. Reviewed-by: Tim Hudson <tjh@openssl.org>
* More secure storage of key material.Rich Salz2015-06-231-3/+39
| | | | | | | | | Add secure heap for storage of private keys (when possible). Add BIO_s_secmem(), CBIGNUM, etc. Add BIO_CTX_secure_new so all BIGNUM's in the context are secure. Contributed by Akamai Technologies under the Corporate CLA. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Replace memset with OPENSSL_clear_free()Matt Caswell2015-06-101-2/+1
| | | | | | | | | | BUF_MEM_free() attempts to cleanse memory using memset immediately prior to a free. This is at risk of being optimised away by the compiler, so replace with a call to OPENSSL_clear_free() instead. With thanks to the Open Crypto Audit Project for reporting this issue. Reviewed-by: Stephen Henson <steve@openssl.org>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-141-1/+1
| | | | | | | | | | | | | 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>
* Use safer sizeof variant in mallocRich Salz2015-05-041-1/+1
| | | | | | | | | | | | | For a local variable: TYPE *p; Allocations like this are "risky": p = OPENSSL_malloc(sizeof(TYPE)); if the type of p changes, and the malloc call isn't updated, you could get memory corruption. Instead do this: p = OPENSSL_malloc(sizeof(*p)); Also fixed a few memset() calls that I noticed while doing this. Reviewed-by: Richard Levitte <levitte@openssl.org>
* realloc of NULL is like mallocRich Salz2015-04-281-8/+2
| | | | | | ANSI C, and OpenSSL's malloc wrapper do this, also. Reviewed-by: Richard Levitte <levitte@openssl.org>
* size_t for buffer functions.Dr. Stephen Henson2015-02-131-2/+2
| | | | | Change BUF_MEM_grow and BUF_MEM_grow_clean to return size_t. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-221-132/+116
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Typo.Dr. Stephen Henson2013-07-171-1/+1
|
* correct error codeDr. Stephen Henson2012-04-221-1/+1
|
* Check for potentially exploitable overflows in asn1_d2i_read_bioDr. Stephen Henson2012-04-191-0/+17
| | | | | | | | BUF_mem_grow and BUF_mem_grow_clean. Refuse attempts to shrink buffer in CRYPTO_realloc_clean. Thanks to Tavis Ormandy, Google Security Team, for discovering this issue and to Adam Langley <agl@chromium.org> for fixing it. (CVE-2012-2110)
* move some string utilities to buf_str.c to reduce some dependencies (from ↵Dr. Stephen Henson2011-01-091-58/+0
| | | | 0.9.8 branch).
* size_t-fy crypto/buffer.Andy Polyakov2007-10-091-4/+4
|
* New utility function to reverse a buffer, either by copying or in-place.Dr. Stephen Henson2006-04-101-0/+23
|
* Fix various incorrect error function codes.Bodo Möller2005-04-261-1/+1
| | | | ("perl util/ck_errf.pl */*.c */*/*.c" still reports many more.)
* Add BUF_strndup() and BUF_memdup(). Not currently used, but I've codeRichard Levitte2003-04-291-5/+24
| | | | that uses them that I'll commit in a few days.
* Security fixes brought forward from 0.9.7.Ben Laurie2002-11-131-0/+57
|
* Consistency fix in BUF_MEM_grow: Initialise to zero when new memoryBodo Möller2001-10-261-1/+2
| | | | had to be allocated, not just when reusing the existing buffer.
* There have been a number of complaints from a number of sources that namesRichard Levitte2000-06-011-6/+6
| | | | | | | | | like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
* Change #include filenames from <foo.h> to <openssl.h>.Bodo Möller1999-04-231-1/+1
| | | | | | Submitted by: Reviewed by: PR:
* Work with -pedantic!Ben Laurie1999-04-231-4/+4
|
* Change functions to ANSI C.Ulf Möller1999-04-191-8/+4
|
* Massive constification.Ben Laurie1999-04-171-1/+1
|
* Accept NULL in *_free.Ben Laurie1999-01-071-0/+3
|
* Import of old SSLeay release: SSLeay 0.9.0bRalf S. Engelschall1998-12-211-2/+8
|
* Import of old SSLeay release: SSLeay 0.8.1bRalf S. Engelschall1998-12-211-0/+139