summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_sock.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Hide symbols in asn1 and biobeck2023-07-051-1/+9
| | | | ok jsing@
* in case of failure, always report the error with BIOerror();schwarze2022-12-221-4/+14
| | | | OK tb@
* Restore the old behavior when a port number without a host name isbluhm2018-02-071-10/+12
| | | | | | passed to BIO_get_accept_socket(). This is part of the API and it fixes "openssl ocsp -port 12345" in server mode. from markus@; OK jsing@ beck@
* Do not call freeaddrinfo() with a NULL parameter.bluhm2018-02-061-2/+3
| | | | OK jsing@
* No original OpenSSL code remains in this file. Relicensebeck2017-04-301-54/+13
|
* Make BIO_get_host_ip just yet another getaddrinfo wrapperbeck2017-04-301-27/+20
|
* Rework BIO_accept to be more like modern code.beck2017-04-301-54/+19
| | | | ok jsing@
* Microsoft Windows hates BIO_get_accept_socket in portable. Fix it tobeck2017-04-301-115/+35
| | | | | | not be awful or have any claims on supporting ipv6 when it does so very badly ok jsing@
* Send the function codes from the error functions to the bit bucket,beck2017-01-291-19/+15
| | | | | | as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@
* Delete completely useless crap and just use getaddrinfo. Fix man pagebeck2016-12-201-44/+7
| | | | | | | while we're at it. Note for the nostalgic, since "wais" is still an alias in /etc/services it will continue to work.. ok deraadt@ millert@ krw@
* Move Windows OS-specific functions to make porting easier.bcook2014-12-031-24/+1
| | | | | | | | | 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@
* normalize set/getsockopt usage.bcook2014-11-261-3/+2
| | | | | | | | | | 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@
* 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@
* 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-131-2/+2
| | | | | | intrinsics. This is the easy ones, a few left to check one at a time. ok miod@ deraadt@
* Only import cryptlib.h in the four source files that actually need it.jsing2014-07-111-3/+3
| | | | | | | | 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@
* Simplify realloc() usage; ok tedu@miod2014-07-101-15/+6
|
* Stop including standard headers via cryptlib.h - pull in the headers thatjsing2014-07-101-1/+2
| | | | | | are needed in the source files that actually require them. ok beck@ miod@
* 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-221-32/+46
| | | | | | | 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-121-1/+1
|
* Stop using DSO_global_lookup to reach getaddrinfo() and friendsderaadt2014-06-081-40/+3
| | | | discussed with tedu, ok jsing
* more: no need for null check before freederaadt2014-05-301-2/+1
| | | | ok tedu guenther
* Sort and group includes.jsing2014-05-051-9/+8
|
* Repair BIO_socket_nbio operation.jsing2014-05-051-2/+3
| | | | ok miod@
* Replace all use of ERR_add_error_data with ERR_asprintf_error_data.beck2014-04-261-5/+5
| | | | | | | | This avoids a lot of ugly gymnastics to do snprintfs before sending the bag of strings to ERR, and eliminates at least one place in dso_dlfctn.c where it was being called with the incorrect number of arguments and using random things off the stack as addresses of strings. ok krw@, jsing@
* The usual idiom to cope with systems not defining socklen_t is to add amiod2014-04-231-35/+5
| | | | | | | | | | | | | | | | | | #define socklen_t int somewhere (or a typedef, whatever gives you an integer type of the size your system expects as the 3rd argument of accept(2), really). OpenSSL here is a bit more creative by using an union of an int and a size_t, and extra code if sizeof(int) != sizeof(size_t) in order to recover the proper size. With a comment mentioning that this has no chance to work on a platform with a stack growing up and accept() returning an int, fortunately this seems to work on HP-UX. Switch to the light side of the force and declare and use socklen_t variables, period. If your system does not define socklen_t, consider bringing it back to your vendor for a refund. ok matthew@ tedu@
* close socket in failure cases tootedu2014-04-231-0/+3
|
* if realloc failed, BIO_accept would leak memory and return NULL, causingtedu2014-04-231-2/+11
| | | | caller to crash. Fix leak and return an error instead. from Chad Loder
* We'll interpret a (void) cast on snprintf() to mean it's been verified thatguenther2014-04-191-2/+2
| | | | | | truncation is either desirable, not an issue, or is detected and handled later ok deraadt@
* unifdef NO_SOCKtedu2014-04-181-2/+0
|
* Put the final pieces from e_os.h in the required places, and remove it.deraadt2014-04-181-12/+1
| | | | | "dance on it's grave" says beck ok guenther beck
* unistd.h for protos where neededderaadt2014-04-181-0/+1
|
* more windows/netware leftoverstedu2014-04-171-18/+3
|
* delete if 0 codetedu2014-04-171-28/+0
|
* Mostly gut e_os.h:deraadt2014-04-171-7/+4
| | | | | | | | USE_SOCKETS is unrelated to using sockets, but just pulls in .h files. It makes every file buy a kitchen sink, because 11 files forgot to. EXIT() is really exit(), a gentle surprise but... OPENSSL_EXIT() is really just return(), because noone compiles the openssl command non-monolithic anymore
* Change library to use intrinsic memory allocation functions instead ofbeck2014-04-171-4/+4
| | | | | | | | OPENSSL_foo wrappers. This changes: OPENSSL_malloc->malloc OPENSSL_free->free OPENSSL_relloc->realloc OPENSSL_freeFunc->free