aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_sock.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean away needless VMS checkRichard Levitte2017-05-111-3/+0
| | | | | | | | 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)
* Copyright consolidation 09/10Rich Salz2016-05-171-54/+6
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Handle malloc failures in BIO_acceptMatt Caswell2016-05-041-4/+14
| | | | | | | | | 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>
* Make BIO_sock_error return a proper error code when getsockopt failsRichard Levitte2016-04-281-2/+2
| | | | | | | | | | | 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>
* Rename int_*() functions to *_int()Matt Caswell2016-04-131-1/+1
| | | | | | | | | | 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>
* Rename lots of *_intern or *_internal function to int_*Matt Caswell2016-04-131-1/+1
| | | | | | | | 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>
* Deprecate BIO_sock_cleanup() and make it a no-opMatt Caswell2016-04-131-1/+1
| | | | | | | | 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>
* Remove Netware and OS/2Rich Salz2016-03-171-23/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make the BIO_ADDR param optional.Rich Salz2016-02-141-11/+4
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Make sure a socklen_t can compare with a sizeof() resultRichard Levitte2016-02-141-1/+1
| | | | | | | | | | 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>
* GH620: second diff from rt-2275, adds error codeRich Salz2016-02-111-0/+32
| | | | | | | clean up and apply patches from RT-2275 Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* bio/b_sock.c: cleanup obsolete stuff.Andy Polyakov2016-02-081-12/+0
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH601: Various spelling fixes.FdaSilvaYY2016-02-051-1/+1
| | | | | Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* Refactoring BIO: reimplement old socket handling functions with new onesRichard Levitte2016-02-031-435/+90
| | | | Reviewed-by: Kurt Roeckx <kurt@openssl.org>
* Temporary pragma to have GCC quiet down about deprecated functionsRichard Levitte2016-02-031-0/+6
| | | | | | | 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>
* Refactoring BIO: new socket-handling functions, deprecate older onesRichard Levitte2016-02-031-0/+36
| | | | | | | | | | | | | | | | | | | | | 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>
* Refactoring BIO: add wrappers around sockaddr et alRichard Levitte2016-02-031-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove /* foo.c */ commentsRich Salz2016-01-261-1/+0
| | | | | | | | | | | | 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>
* Rename some BUF_xxx to OPENSSL_xxxRich Salz2015-12-161-1/+1
| | | | | | | | | 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>
* Explicitly cast INVALID_SOCKET to (int) to address warnings on Windows.Andy Polyakov2015-10-051-10/+10
| | | | | | | | | | | 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>
* Identify and move common internal libcrypto header filesRichard Levitte2015-05-141-1/+1
| | | | | | | | | | | | | 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>
* memset, memcpy, sizeof consistency fixesRich Salz2015-05-051-1/+1
| | | | | | | | 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>
* free null cleanup finaleRich Salz2015-05-011-2/+1
| | | | | | Don't check for NULL before calling OPENSSL_free Reviewed-by: Richard Levitte <levitte@openssl.org>
* realloc of NULL is like mallocRich Salz2015-04-281-5/+2
| | | | | | ANSI C, and OpenSSL's malloc wrapper do this, also. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Dead code removal: #if 0 bio, comp, randRich Salz2015-01-291-218/+2
| | | | | | | The start of removing dead code. A remaining #if 0 in bss_conn.c needs more thought. Reviewed-by: Richard Levitte <levitte@openssl.org>
* More comment realignmentmaster-post-reformatMatt Caswell2015-01-221-7/+7
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* Re-align some comments after running the reformat script.Matt Caswell2015-01-221-7/+7
| | | | | | | This should be a one off operation (subsequent invokation of the script should not move them) Reviewed-by: Tim Hudson <tjh@openssl.org>
* Run util/openssl-format-source -v -c .Matt Caswell2015-01-221-854/+839
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* RT3548: Remove unsupported platformsRich Salz2015-01-121-2/+1
| | | | | | | 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>
* Further comment amendments to preserve formatting prior to source reformatMatt Caswell2015-01-061-1/+2
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* RT3548: Remove some obsolete platformsRich Salz2014-12-171-4/+0
| | | | | | This commit removes BEOS. Reviewed-by: Richard Levitte <levitte@openssl.org>
* Undo a90081576c94f9f54de1755188a00ccc1760549aRich Salz2014-08-091-1/+11
| | | | Undo unapproved commit that removed DJGPP and WATT32
* Remove DJGPP (and therefore WATT32) #ifdef's.Rich Salz2014-08-081-11/+1
| | | | | | 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.
* b_sock.c: make getsockopt work in cases when optlen is 64-bit value.Andy Polyakov2012-06-111-3/+4
|
* OPENSSL_NO_SOCK fixes.Andy Polyakov2012-04-161-1/+1
| | | | | PR: 2791 Submitted by: Ben Noordhuis
* PR: 2512Dr. Stephen Henson2011-05-251-0/+4
| | | | | | | 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.
* After some adjustments, apply the changes OpenSSL 1.0.0d on OpenVMSRichard Levitte2011-03-191-1/+24
| | | | submitted by Steven M. Schweda <sms@antinode.info>
* fix PR#2261 in a different wayDr. Stephen Henson2010-05-311-0/+7
|
* http://cvs.openssl.org/chngview?cn=19053 made me wonder if bind() andAndy Polyakov2010-01-071-5/+8
| | | | | | | 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...
* b_sock.c: correct indirect calls on WinSock platforms.Andy Polyakov2009-12-301-3/+14
| | | | | PR: 2130 Submitted by: Eugeny Gostyukhin
* b_sock.c: fix compiler warning.Andy Polyakov2009-11-151-1/+2
|
* Combat gcc 4.4.1 aliasing rules.Andy Polyakov2009-10-061-46/+67
|
* PR: 2047Dr. Stephen Henson2009-09-201-5/+15
| | | | | | | Submitted by: David Lee <live4thee@gmail.com>, steve@openssl.org Approved by: steve@openssl.org Fix for IPv6 handling in BIO_get_accept_socket().
* PR: 2005Dr. Stephen Henson2009-08-261-7/+2
| | | | | | | | | 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.
* Improve readability of bio/b_sock.cAndy Polyakov2009-04-261-8/+8
|
* Updates from 1.0.0-stableDr. Stephen Henson2009-04-041-1/+1
|
* Netware support.Dr. Stephen Henson2008-01-031-7/+15
| | | | Submitted by: Guenter Knauf <eflash@gmx.net>
* Change submitted by Doug Kaufman. He writes:Richard Levitte2007-12-031-1/+1
| | | | | | | | | | | | I just compiled the 9.9-dev version from the 12022007 tarball under DJGPP. There were only 2 changes needed, one for b_sock.c, since DJGPP with WATT32 doesn't define socklen_t and one for testtsa to handle DOS style path separators. I also noted what seems to be a typographical error in ts.pod. The test suite passes. The patch is attached. Since I am in the US, I have sent notifications to the Bureau of Industry and Security and to the NSA.
* It's inappropraite to override application signal, nor is it appropriateAndy Polyakov2007-09-161-9/+1
| | | | | to shut down Winsock unless we know it won't be used [and we never do]. PR: 1439
* Add BeOS support.Ulf Möller2006-04-111-1/+10
| | | | | | PR: 1312 Submitted by: Oliver Tappe <zooey@hirschkaefer.de> Reviewed by: Ulf Moeller