summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/malloc.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-05-29the comment says RAND_pseudo_bytes should be RAND_bytes. make it so.tedu2-12/+2
ok deraadt
2014-05-29we no longer care that these aren't used for ssl2tedu2-4/+4
2014-05-29ok, next pass after review: when possible, put the reallocarray argumentsderaadt17-27/+27
in the "size_t nmemb, size_t size"
2014-05-29convert 53 malloc(a*b) to reallocarray(NULL, a, b). that is 53deraadt51-93/+109
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
2014-05-29Everything sane has stdio, and FILE *. we don't need ifdefs for this.beck82-338/+0
ok to firebomb from tedu@
2014-05-29remove back compat that was already disabled back in 1998.tedu2-16/+0
from Alexander Schrijver
2014-05-29Make make includes work again without kssl.hbeck1-2/+2
2014-05-29Any sane platform has stdio. Stop pretending we will ever use a platformbeck18-64/+0
that does not. "fire bomb" tedu@
2014-05-29kssl is dead.tedu1-68/+0
2014-05-29no space before labeltedu4-54/+54
2014-05-29line up else bettertedu2-10/+4
2014-05-29define -DLIBRESSL_INTERNAL in here so we don't use nastiesbeck1-2/+2
ok deraadt@
2014-05-29consistent bracestedu2-26/+26
2014-05-29unidef DH, ECDH, and ECDSA. there's no purpose to a libssl without them.tedu26-434/+0
ok deraadt jsing
2014-05-29repair KNF indentderaadt2-2/+2
2014-05-29use calloc, from Benjamin Baiertedu2-10/+2
2014-05-29Make it substantially easier to identify protocol version requirementsjsing16-18/+164
by adding an enc_flags field to the ssl3_enc_method, specifying four flags that are used with this field and providing macros for evaluating these conditions. Currently the version requirements are identified by continually checking the version number and other criteria. This change also adds separate SSL3_ENC_METHOD data for TLS v1.1 and v1.2, since they have different enc_flags from TLS v1. Based on changes in OpenSSL head. No objection from miod@
2014-05-29When you have functions that perform specific functions, use them.jsing2-36/+18
EVP_CIPHER_CTX_free() does a NULL check, then calls EVP_CIPHER_CTX_cleanup() and frees the memory. COMP_CTX_free() also had its own NULL check, so there is no point in duplicating that here. ok beck@
2014-05-29Fix another two cases where the return value of ssl_replace_hash() isjsing2-16/+36
unchecked. In the case of tls1_change_cipher_state(), it is fairly pointless to use ssl_replace_hash(), since it does not initialise the hash and there is special handling required in the DTLS write case. Instead, just inline the part of ssl_replace_hash() that is needed and only ssl_clear_hash_ctx() the write hash in the non-DTLS case. Also add a detailed comment explaining why there needs to be specialised handling for DTLS write context and where the contexts are actually freed. ok miod@
2014-05-29Add missing NULL checks for calls to ssl_replace_hash(). This functionjsing1-2/+6
calls EVP_MD_CTX_create(), which will return NULL if it fails to allocate memory. ok miod@
2014-05-28More KNF.jsing2-22/+24
2014-05-28Refactor tls1_change_cipher_state() and split the compression handling outjsing2-64/+88
from the cipher and message digest handling, allowing for upcoming changes. Based on Adam Langley's chromium diffs. ok miod@
2014-05-28EVP_MD_CTX_create() calls malloc and can return NULL. However, only one ofjsing5-2/+16
the calls in libssl actually checks the return value before using it. Add NULL checks for the remaining three calls. ok miod@
2014-05-28There is no point in checking if a pointer is non-NULL before calling free,jsing26-320/+168
since free already does this for us. Also remove some pointless NULL assignments, where the result from malloc(3) is immediately assigned to the same variable. ok miod@
2014-05-28More KNF.jsing2-6/+4
2014-05-27Fix a Y2038 problem, by conversion of long to time_t.deraadt4-36/+16
The TS_RESP_CTX_set_time_cb() API gets removed. Nothing in the greater ecosystem ever calls it. This API needs to be removed, because if anyone ever calls on a BE 32 system assuming long rather than time_t, it will be dangerously incompatible. ok miod guenther
2014-05-27Remove unused defines.miod2-18/+0
2014-05-27Remove redundant test introduced in s3_pkt.c on 20001225, which got cargo-cultedmiod4-10/+8
(with an XXX comment, though) in d1_pkt.c in 2005.
2014-05-27Wrap some long lines.jsing2-8/+16
2014-05-27Remove MemCheck_{on,off} that escaped last time around.jsing2-8/+0
2014-05-27More KNF.jsing3-5/+6
2014-05-27Fix ia64 cross-gcc target.tobiasu2-0/+6
opensslconf.h is just a dummy, we're lightyears away from working userspace. ok deraadt@
2014-05-26Replace the following logic:miod4-68/+98
if (nothing to allocate) ptr = malloc(1) else { if ((ptr = malloc(size to allocate)) memcpy(ptr, data to copy, size to allocate) } if (ptr == NULL) OMG ERROR with a saner logic where the NULL pointer check if moved to the actual malloc branch, so that we do not need to malloc a single byte, just to avoid having a NULL pointer. Whoever thought allocating a single byte was a smart idea was obviously not taking his meds. ok beck@ guenther@
2014-05-26Unchecked malloc() return value in SSL_COMP_add_compression_method(), in themiod2-0/+8
!OPENSSL_NO_COMP case. Does not affect OpenBSD as we compile the opposite code path.
2014-05-26We don't really to keep history in constructs such as:miod4-24/+2
#if 1 /* new with openssl 0.9.4 */ current code; #else obsolete code; #endif
2014-05-26tls_decrypt_ticket(): memory leak and uncleaned EVP_CIPHER_CTX upon error.miod2-2/+8
2014-05-26Make sure all error paths in dtls1_buffer_record() invoke SSLErr bymiod2-40/+24
factoring error handling. ok jsing@
2014-05-26There is no need to include <openssl/e_os2.h> here, except for the factjsing5-5/+2
that it brings in <openssl/opensslconf.h>, so just do that instead (currently via apps.h).
2014-05-26Update the aead regress to work with the improved EVP AEAD API.jsing1-22/+14
2014-05-26Implement an improved version of the EVP AEAD API. Thejsing10-212/+218
EVP_AEAD_CTX_{open,seal} functions previously returned an ssize_t that was overloaded to indicate success/failure, along with the number of bytes written as output. This change adds an explicit *out_len argument which is used to return the number of output bytes and the return value is now an int that is purely used to identify success or failure. This change effectively rides the last libcrypto crank (although I do not expect there to be many users of the EVP AEAD API currently). Thanks to Adam Langley for providing the improved code that this diff is based on. ok miod@
2014-05-26Use C99 initialisers for BIO_METHOD.jsing2-18/+18
2014-05-26KNF.jsing6-720/+958
2014-05-26repair some KNF missed by the script; ok jsingderaadt2-12/+20
2014-05-26KNF.jsing14-1076/+1312
2014-05-26KNF.jsing12-2886/+3110
2014-05-26move all stats collecting under MALLOC_STATS; ok krw@otto1-28/+33
2014-05-25Fix resource descriptor leaks.logan1-0/+4
CID: 966576 & 966577 OK from guenther@ and "Yup. looks good." from tedu@
2014-05-25-noout mentions a CRL, which is incorrect. Use "no output of encoded sessionlogan1-1/+1
info." instead. From Martin Kaiser. OK from tedu@
2014-05-25heartbearts->heartbeats fixlogan2-2/+2
From Marcos Marado: OK from tedu@
2014-05-25calloc instead of malloc/memset. from Benjamin Baiertedu26-80/+42