summaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_sock.c
AgeCommit message (Collapse)Author
2018-01-09Update copyright years on all files merged since Jan 1st 2018Richard Levitte
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5038)
2018-01-07Remove remaining NETWARE ifdef'sRich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5028)
2017-10-18Remove parentheses of return.KaoruToda
Since return is inconsistent, I removed unnecessary parentheses and unified them. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4541)
2017-10-09Since return is inconsistent, I removed unnecessary parentheses andKaoruToda
unified them. - return (0); -> return 0; - return (1); -> return 1; - return (-1); -> return -1; Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4500)
2017-08-21Remove OPENSSL_assert() from various crypto/bio filesMatt Caswell
bss_dgram.c is deferred until later due to ongoing discussions. Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3740)
2017-05-11Clean away needless VMS checkRichard Levitte
BIO_socket_ioctl is only implemented on VMS for VMS version 7.0 and up, but since we only support version 7.1 and up, there's no need to check the VMS version. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3448)
2016-05-17Copyright consolidation 09/10Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-05-04Handle malloc failures in BIO_acceptMatt Caswell
The old BIO_accept() function can encounter errors during malloc. We need to ensure we properly clean up if that occurs. GH Issue #817 Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-28Make BIO_sock_error return a proper error code when getsockopt failsRichard Levitte
BIO_sock_error() returned 1 when getsockopt() fails when it should return the error code for that failure. Additionally, the optlen parameter to getsockopt() has to point at the size of the area that the optval parameter points at rather than zero. Some systems may forgive it being zero, but others don't. Reviewed-by: Matt Caswell <matt@openssl.org>
2016-04-13Rename int_*() functions to *_int()Matt Caswell
There is a preference for suffixes to indicate that a function is internal rather than prefixes. Note: the suffix is only required to disambiguate internal functions and public symbols with the same name (but different case) Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-13Rename lots of *_intern or *_internal function to int_*Matt Caswell
There was a lot of naming inconsistency, so we try and standardise on one form. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-13Deprecate BIO_sock_cleanup() and make it a no-opMatt Caswell
BIO_sock_cleanup() should not be called expicitly - we should leave auto-deinit to clean this up instead. Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-17Remove Netware and OS/2Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-14Make the BIO_ADDR param optional.Rich Salz
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-14Make sure a socklen_t can compare with a sizeof() resultRichard Levitte
Most of the times, it seems that socklen_t is unsigned. Unfortunately, this isn't always the case, and it doesn't compare with a size_t without warning. A cast resolves the issue. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-11GH620: second diff from rt-2275, adds error codeRich Salz
clean up and apply patches from RT-2275 Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-08bio/b_sock.c: cleanup obsolete stuff.Andy Polyakov
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-05GH601: Various spelling fixes.FdaSilvaYY
Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-03Refactoring BIO: reimplement old socket handling functions with new onesRichard Levitte
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-03Temporary pragma to have GCC quiet down about deprecated functionsRichard Levitte
Future commits will change our use to newer functions and the pragmas will go away at that time. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-03Refactoring BIO: new socket-handling functions, deprecate older onesRichard Levitte
Added functions: BIO_socket BIO_connect BIO_listen BIO_accept_ex BIO_closesocket BIO_sock_info These get deprecated: BIO_gethostbyname BIO_get_port BIO_get_host_ip BIO_get_accept_socket BIO_accept Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-03Refactoring BIO: add wrappers around sockaddr et alRichard Levitte
Because different platforms have different levels of support for IPv6, different kinds of sockaddr variants, and some have getaddrinfo et al while others don't, we could end up with a mess if ifdefs, duplicate code and other maintainance nightmares. Instead, we're introducing wrappers around the common form for socket communication: BIO_ADDR, closely related to struct sockaddr and some of its variants. BIO_ADDRINFO, closely related to struct addrinfo. With that comes support routines, both convenient creators and accessors, plus a few utility functions: BIO_parse_hostserv, takes a string of the form host:service and splits it into host and service. It checks for * in both parts, and converts any [ipv6-address] syntax to ust the IPv6 address. BIO_lookup, looks up information on a host. All routines handle IPv4 (AF_INET) and IPv6 (AF_INET6) addresses, and there is support for local sockets (AF_UNIX) as well. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-01-26Remove /* foo.c */ commentsRich Salz
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>
2015-12-16Rename some BUF_xxx to OPENSSL_xxxRich Salz
Rename BUF_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} to OPENSSL_{strdup,strlcat,strlcpy,memdup,strndup,strnlen} Add #define's for the old names. Add CRYPTO_{memdup,strndup}, called by OPENSSL_{memdup,strndup} macros. Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-10-05Explicitly cast INVALID_SOCKET to (int) to address warnings on Windows.Andy Polyakov
Even though SOCKET is effectively declared as (void *) on Windows, it's not actually a pointer, but an index within per-process table of kernel objects. The table size is actually limited and its upper limit is far below upper limit for signed 32-bit integer. This is what makes cast in question possible. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-05-14Identify and move common internal libcrypto header filesRichard Levitte
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>
2015-05-05memset, memcpy, sizeof consistency fixesRich Salz
Just as with the OPENSSL_malloc calls, consistently use sizeof(*ptr) for memset and memcpy. Remove needless casts for those functions. For memset, replace alternative forms of zero with 0. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-05-01free null cleanup finaleRich Salz
Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-28realloc of NULL is like mallocRich Salz
ANSI C, and OpenSSL's malloc wrapper do this, also. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-29Dead code removal: #if 0 bio, comp, randRich Salz
The start of removing dead code. A remaining #if 0 in bss_conn.c needs more thought. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-22More comment realignmentmaster-post-reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Re-align some comments after running the reformat script.Matt Caswell
This should be a one off operation (subsequent invokation of the script should not move them) Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-12RT3548: Remove unsupported platformsRich Salz
This last one for this ticket. Removes WIN16. So long, MS_CALLBACK and MS_FAR. We won't miss you. Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-01-06Further comment amendments to preserve formatting prior to source reformatMatt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2014-12-17RT3548: Remove some obsolete platformsRich Salz
This commit removes BEOS. Reviewed-by: Richard Levitte <levitte@openssl.org>
2014-08-09Undo a90081576c94f9f54de1755188a00ccc1760549aRich Salz
Undo unapproved commit that removed DJGPP and WATT32
2014-08-08Remove DJGPP (and therefore WATT32) #ifdef's.Rich Salz
DJGPP is no longer a supported platform. Remove all #ifdef, etc., cases that refer to it. DJGPP also #define'd WATT32, so that is now removed as well.
2012-06-11b_sock.c: make getsockopt work in cases when optlen is 64-bit value.Andy Polyakov
2012-04-16OPENSSL_NO_SOCK fixes.Andy Polyakov
PR: 2791 Submitted by: Ben Noordhuis
2011-05-25PR: 2512Dr. Stephen Henson
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de> Reviewed by: steve Fix BIO_accept so it can be bound to IPv4 or IPv6 sockets consistently.
2011-03-19After some adjustments, apply the changes OpenSSL 1.0.0d on OpenVMSRichard Levitte
submitted by Steven M. Schweda <sms@antinode.info>
2010-05-31fix PR#2261 in a different wayDr. Stephen Henson
2010-01-07http://cvs.openssl.org/chngview?cn=19053 made me wonder if bind() andAndy Polyakov
connect() are as finicky as sendto() when it comes to socket address length. As it turned out they are, therefore the fix. Note that you can't reproduce the problem on Linux, it was failing on Solaris, FreeBSD, most likely on more...
2009-12-30b_sock.c: correct indirect calls on WinSock platforms.Andy Polyakov
PR: 2130 Submitted by: Eugeny Gostyukhin
2009-11-15b_sock.c: fix compiler warning.Andy Polyakov
2009-10-06Combat gcc 4.4.1 aliasing rules.Andy Polyakov
2009-09-20PR: 2047Dr. Stephen Henson
Submitted by: David Lee <live4thee@gmail.com>, steve@openssl.org Approved by: steve@openssl.org Fix for IPv6 handling in BIO_get_accept_socket().
2009-08-26PR: 2005Dr. Stephen Henson
Submitted by: steve@openssl.org Some systems have broken IPv6 headers and/or implementations. If OPENSSL_USE_IPV6 is set to 0 IPv6 is not used, if it is set to 1 it is used and if undefined an attempt is made to detect at compile time by checking if AF_INET6 is set and excluding known problem platforms.
2009-04-26Improve readability of bio/b_sock.cAndy Polyakov