summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Use platform-defined method of printing a pointer.bcook2014-12-081-2/+2
| | | | | | Casting a pointer to an unsigned long discards bits on an LLP64 system. ok deraadt@
* Move Windows OS-specific functions to make porting easier.bcook2014-12-032-24/+89
| | | | | | | | | 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@
* We're not supporting 16-bit Windows, remove cast.bcook2014-12-031-3/+2
| | | | ok jsing@ deraadt@
* remove superflous gettimeofday wrapper.bcook2014-11-261-9/+2
| | | | ok beck@ tedu@ miod@ guenther@ doug@ deraadt@
* memset like a normal human.bcook2014-11-261-10/+10
| | | | ok beck@ tedu@ miod@
* normalize set/getsockopt usage.bcook2014-11-263-45/+27
| | | | | | | | | | 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@
* Linux has had IP_MTU since 2005, don't force it.bcook2014-11-261-8/+4
| | | | ok beck@ miod@ tedu@ deraadt@
* MPE support, begone. ok teduderaadt2014-11-211-2/+2
|
* f{read,write} take a number of items and an item size as arguments, andmiod2014-11-112-14/+7
| | | | | | | | | | | | | | | | | | | | | 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@
* Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().jsing2014-10-221-4/+4
| | | | | | | | 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@
* The return value on success of fcntl(F_SETFL) is not actually specified,bcook2014-10-131-3/+3
| | | | | | only that it returns -1 on failure. pointed out by guenther@
* Use O_NONBLOCK over FIONBIO.bcook2014-10-131-2/+8
| | | | | | | | | 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@
* Include <sys/time.h> to get struct timevalbcook2014-08-241-1/+2
| | | | | | | | | 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@
* BIO_free() returns immediately when the sole input is NULL.doug2014-07-252-8/+5
| | | | | | Remove unnecessary NULL check. ok miod@
* Mark the format string argument to BIO_*printf as not being allowed to be NULLguenther2014-07-201-5/+7
| | | | ok bcook@
* do not need a variable to track locking, since all code paths have itderaadt2014-07-161-5/+2
| | | | locked throughout.
* The bell tolls for BUF_strdup - Start the migration to usingbeck2014-07-133-8/+8
| | | | | | intrinsics. This is the easy ones, a few left to check one at a time. ok miod@ deraadt@
* unbreak build this needed to be an and..beck2014-07-131-2/+2
| | | | ok jsing@
* Take out __bounded__ in the include files we use it in when not on OpenBSD.beck2014-07-131-2/+4
| | | | | | | 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@
* Fix a memory leak in BIO_free() which no current BIO can trigger; OpenSSLmiod2014-07-111-4/+3
| | | | PR #3439 via OpenSSL trunk
* Missing calloc() return value check in dgram_sctp_ctrl(); from Kurt Roeckx viamiod2014-07-111-11/+21
| | | | OpenSSL trunk
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-1117-47/+40
| | | | | | | | 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-103-3/+10
| | | | | | | | | 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.
* Simplify realloc() usage; ok tedu@miod2014-07-101-15/+6
|
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-1012-39/+57
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* delete some casts. ok miodtedu2014-07-101-2/+2
|
* replace getservbyname_r with getaddrinfo for portabilitybcook2014-07-101-6/+11
| | | | ok jsing@
* include <limits.h> for LONG_MIN/LONG_MAX.bcook2014-07-091-2/+2
| | | | | | | Also remove <sys/filio.h> added from previous commit. This was the wrong way to get FIONBIO. ok jsing@
* add <sys/filio.h> header for FIONBIObcook2014-07-091-1/+2
| | | | ok beck@
* Pretty much everything has SO_REUSEADDR - nuke the #ifdefs.jsing2014-07-081-5/+1
| | | | ok beck@
* We have EAI_FAMILY - remove the #ifdefs.jsing2014-07-081-5/+1
| | | | ok beck@
* More KNF.jsing2014-07-081-11/+21
|
* Avoid locking in BIO_get_port() by using getservbyname_r() instead ofjsing2014-07-081-31/+31
| | | | | | getservbyname(). While here, provide a common/single return path. ok deraadt@
* Simplify various BIO_sock_* fuctions - less code, better variable names,jsing2014-07-081-27/+12
| | | | | | correct types and fewer casts. ok deraadt@ miod@
* Replace 48 lines of code with a single inet_pton() call. The previousjsing2014-06-241-48/+3
| | | | | | | | | | | | | 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@
* Actually make BIO_set_tcp_ndelay() work - TCP_NODELAY will not magicallyjsing2014-06-241-16/+3
| | | | | | appear by itself. ok beck@ miod@
* BIO_sock_init() no longer does anything, so stop calling it.jsing2014-06-221-10/+1
|
* Just use SOMAXCONN and IPPROTO_TCP, since we know we have them.jsing2014-06-221-14/+4
|
* In BIO_get_port(), use strol() with appropriate range checks rather thanjsing2014-06-223-34/+50
| | | | | | | an atoi() followed by an unsigned short cast. This stops things like "-1" and "66536" from being considered to be "valid" port numbers. ok beck@ deraadt@
* tags as requested by miod and teduderaadt2014-06-1221-21/+22
|
* Tsk. Tsk. Someone forgot to compile test the other half.jsing2014-06-111-2/+2
|
* Provide support for non-funopen systems.deraadt2014-06-111-8/+30
| | | | ok beck
* c-file-style hints, begone; ok beckderaadt2014-06-111-1/+1
|
* Stop using DSO_global_lookup to reach getaddrinfo() and friendsderaadt2014-06-081-40/+3
| | | | discussed with tedu, ok jsing
* Fix memory leak.logan2014-06-031-0/+1
| | | | | | (From Martin Brejcha) OK from tedu@, miod@ and deraadt@
* Remove __bio_h__attr__ wrapper around __attribute__, since earlier statementsmiod2014-06-011-10/+4
| | | | | | in this file directly use __attribute__. ok deraadt@
* Fix some more nasty stringyness in here by using asprintf instead of cruft.beck2014-05-301-10/+7
| | | | gets rid of the second last use of the awful DECIMAL_SIZE.
* more: no need for null check before freederaadt2014-05-308-41/+19
| | | | ok tedu guenther
* remove CONST_STRICT. ok beck deraadttedu2014-05-301-7/+0
|
* Everything sane has stdio, and FILE *. we don't need ifdefs for this.beck2014-05-292-8/+0
| | | | ok to firebomb from tedu@