summaryrefslogtreecommitdiff
path: root/lib/libcrypto/bio
AgeCommit message (Collapse)Author
2015-12-23remove NULL-checks before free()Michael McConville
2015-10-30Pull in <sys/types.h> to get ssize_t or <stdint.h> to get uint32_t, instead ofMiod Vallat
relying upon previously included headers to do this, to enhance portability; from Pascal Cuoq, libressl github pull request #52
2015-07-20Correct #if/else logic in BIO's dgram_ctrl.Doug Hogan
Coverity issue 72741 noticed that ret is being overwritten before use. The actual issue is that the #if/else logic is guarding the wrong lines. Besides impacting ret, this also made the case's break logic wrong because it was in the wrong location. ok bcook@ beck@
2015-07-19Drop stupid (int) casts for the arguments of malloc() and friends. This isMiod Vallat
not 16-bit MS-DOS anymore. ok bcook@ tedu@
2015-07-19Fix Coverity 72742 - ret is overwritten immediately after this.Bob Beck
ok doug@
2015-07-18Dead code, Coverity 78798Bob Beck
ok bcook@ doug@
2015-06-20Fix warning on vax due to old gcc.Doug Hogan
Old gcc warns when parameters have the same names as functions. Noticed by deraadt@. ok deraadt@ jsing@
2015-04-23Do not need to buf[0] = 0 before strlcpy(buf, ...Theo de Raadt
2015-03-21Fix indentation that incorrectly implies a different control flow.Doug Hogan
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@
2015-02-12If you do not support POSIX I/O then you're not tall enough to ride...Joel Sing
ok tedu@
2015-02-10Remove more IMPLEMENT_STACK_OF noops that have been hiding for the lastJoel Sing
15 years.
2015-02-09Jettison SCTP support in BIO dgram.Joel Sing
OpenBSD does not have SCTP support and it sees little use in the wild. OPENSSL_NO_SCTP is already specified via opensslfeatures.h, hence this is a code removal only and symbols should remain unchanged. ok beck@ miod@ tedu@
2015-02-07Delete a lot of #if 0 code in libressl.Doug Hogan
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@
2015-01-12Fix a memory leak in bss_dgram.Doug Hogan
Free data->saved_message.data. Based on OpenSSL commit: 41cd41c4416f545a18ead37e09e437c75fa07c95 except this version sets a->ptr to NULL to avoid accidental reuse and handles malloc failing. ok beck@, input + ok miod@
2015-01-03Fix incorrect OPENSSL_assert() usage.Doug Hogan
Instead of asserting, return an error code for I/O errors. This is based on OpenSSL commit 2521fcd8527008ceb3e4748f95b0ed4e2d70cfef. Added checks for two calloc()s while I'm here. ok miod@
2014-12-08Use platform-defined method of printing a pointer.Brent Cook
Casting a pointer to an unsigned long discards bits on an LLP64 system. ok deraadt@
2014-12-03Move Windows OS-specific functions to make porting easier.Brent Cook
Several functions that need to be redefined for a Windows port are right in the middle of other code that is relatively portable. This patch isolates the functions that need Windows-specific implementations so they can be built conditionally in the portable tree. ok jsing@ deraadt@
2014-12-03We're not supporting 16-bit Windows, remove cast.Brent Cook
ok jsing@ deraadt@
2014-11-26remove superflous gettimeofday wrapper.Brent Cook
ok beck@ tedu@ miod@ guenther@ doug@ deraadt@
2014-11-26memset like a normal human.Brent Cook
ok beck@ tedu@ miod@
2014-11-26normalize set/getsockopt usage.Brent Cook
Remove the remaining random casts on optval. Fixups for this can be handled by the portability layer all in once place. Remove remaining fake socklen_t unions, though beck@ points out that this also removes support for socklen_t changing its length at runtime. RIP. ok tedu@ beck@ miod@ deraadt@
2014-11-26Linux has had IP_MTU since 2005, don't force it.Brent Cook
ok beck@ miod@ tedu@ deraadt@
2014-11-21MPE support, begone. ok teduTheo de Raadt
2014-11-11f{read,write} take a number of items and an item size as arguments, andMiod Vallat
return the number of items read of written. When you intend to return the number of bytes actually processed, it is wise to pass 1 as the item size and the size as the number of items. But in *some* places, the OpenSSL does the opposite, and has extra logic to change a successful return of 1 (item processed) into the real size. And, guess why it does that? Because of old VMS, for they (used to) have a substandard stdio implementation. Note that this change causes the return values of BIO_dump_fp() and BIO_dump_indent_fp() to no longer be useless (actual number of callback calls), but actual bytes output. Given the irrelevance of the return value before, it is unlikely that anything depends upon it (and if something does, it probably has other problems in need for a fix...) ok tedu@ beck@ jsing@
2014-10-22Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().Joel Sing
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@
2014-10-13The return value on success of fcntl(F_SETFL) is not actually specified,Brent Cook
only that it returns -1 on failure. pointed out by guenther@
2014-10-13Use O_NONBLOCK over FIONBIO.Brent Cook
Prefer this because it is the POSIX standard and has consistent behavior across platforms. Use BIO_socket_nbio consistently across the tree. from Jonas 'Sortie' Termansen, ok deraadt@
2014-08-24Include <sys/time.h> to get struct timevalBrent Cook
The crypto/bio/bss_dgram.c file assumes that another file indirectly includes <stdlib.h> that includes <sys/time.h>. from Jonas 'Sortie' Termansen ok deraadt@ tedu@
2014-07-25BIO_free() returns immediately when the sole input is NULL.Doug Hogan
Remove unnecessary NULL check. ok miod@
2014-07-20Mark the format string argument to BIO_*printf as not being allowed to be NULLPhilip Guenther
ok bcook@
2014-07-16do not need a variable to track locking, since all code paths have itTheo de Raadt
locked throughout.
2014-07-13The bell tolls for BUF_strdup - Start the migration to usingBob Beck
intrinsics. This is the easy ones, a few left to check one at a time. ok miod@ deraadt@
2014-07-13unbreak build this needed to be an and..Bob Beck
ok jsing@
2014-07-13Take out __bounded__ in the include files we use it in when not on OpenBSD.Bob Beck
while we can take it out in portable at compile time, it is still a problem when we install this header file on a system that doesn't support __bounded__ if this is unguarded. ok miod@ bcook@
2014-07-11Fix a memory leak in BIO_free() which no current BIO can trigger; OpenSSLMiod Vallat
PR #3439 via OpenSSL trunk
2014-07-11Missing calloc() return value check in dgram_sctp_ctrl(); from Kurt Roeckx viaMiod Vallat
OpenSSL trunk
2014-07-11Only import cryptlib.h in the four source files that actually need it.Joel Sing
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@
2014-07-10Explicitly include <openssl/opensslconf.h> in every file that referencesJoel Sing
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.
2014-07-10Simplify realloc() usage; ok tedu@Miod Vallat
2014-07-10Stop including standard headers via cryptlib.h - pull in the headers thatJoel Sing
are needed in the source files that actually require them. ok beck@ miod@
2014-07-10delete some casts. ok miodTed Unangst
2014-07-10replace getservbyname_r with getaddrinfo for portabilityBrent Cook
ok jsing@
2014-07-09include <limits.h> for LONG_MIN/LONG_MAX.Brent Cook
Also remove <sys/filio.h> added from previous commit. This was the wrong way to get FIONBIO. ok jsing@
2014-07-09add <sys/filio.h> header for FIONBIOBrent Cook
ok beck@
2014-07-08Pretty much everything has SO_REUSEADDR - nuke the #ifdefs.Joel Sing
ok beck@
2014-07-08We have EAI_FAMILY - remove the #ifdefs.Joel Sing
ok beck@
2014-07-08More KNF.Joel Sing
2014-07-08Avoid locking in BIO_get_port() by using getservbyname_r() instead ofJoel Sing
getservbyname(). While here, provide a common/single return path. ok deraadt@
2014-07-08Simplify various BIO_sock_* fuctions - less code, better variable names,Joel Sing
correct types and fewer casts. ok deraadt@ miod@
2014-06-24Replace 48 lines of code with a single inet_pton() call. The previousJoel Sing
handrolled version could not even make use of sscanf(), since that would not work with a certain antiquated compiler. It is worth noting that there is a tiny change in behaviour - previously calling BIO_get_host_ip() with something that looked like it might be a valid IP address (for example, "1." or even ".") would result in it returning failure rather than trying a BIO_gethostbyname() - now we'll always try a BIO_gethostbyname() if it was not a valid IPv4 address. ok beck@ miod@ deraadt@