aboutsummaryrefslogtreecommitdiff
path: root/include (follow)
Commit message (Collapse)AuthorAgeFilesLines
* enable libtls by defaultBrent Cook2015-03-191-2/+0
| | | | | | | | The API/ABI for the LibreSSL 2.1.x series is now fixed, so we can safely enable libtls it by default. This is useful for new OpenNTPD and OpenSMTPD releases as well. ok deraadt@ beck@ sthen@
* add strsep fallback for libtlsBrent Cook2015-02-141-0/+4
|
* include 'struct iovec' for WindowsBrent Cook2015-01-312-0/+18
| | | | this is used for in-memory cert loading
* add support for building libtlsBrent Cook2014-12-061-0/+6
| | | | | | | | Use './configure --enable-libtls' to build the library and install the associated manpages. Note that the API and ABI of this library may change still, though feedback is welcome. ok deraadt@ jsing@ tedu@
* monkey patch more POSIX-like behavior out of winsock 2Brent Cook2014-12-033-8/+176
| | | | | | | | | | | | | | | | | | | | | | Windows sockets functions look on the outside like they behave similarly to POSIX functions, but there are many subtle and glaring differences, including errors reported via WSAGetLastError, read, write, and close do not work on sockets, setsockopt takes a (char *) rather than (void *), etc. This header implements wrappers that coerce more POSIX-like behavior from these functions, making portable code easier to develop. BENEFITS: One does not necessarily need to sprinkle #ifdefs around code to handle the Windows and non-Windows behavior when porting code. CAVEATS: There may be performance implications with the 'mother-may-I' approach to determining if a descriptor is a socket or a file. The errno mappings are not 100% what one might expect compared to POSIX since there were not always good 1:1 equivalents from the WSA errors.
* add minimal winsock->BSD networking header shimsBrent Cook2014-12-0320-2/+205
| | | | also add license header to existing shims
* add minimal poll(2) implementation for WindowsBrent Cook2014-12-031-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This provides sufficient functionality to run openssl(1) from a Windows console. This is based on the original select-based version from from songdongsheng@live.cn. Changes: * use nfds_t directly for iterating the fds. * add WSAGetLastError -> errno mappings * handle POLLHUP and the OOB data cases for revents * handle sparse arrays of fds correctly * KNF style updates * teach poll how to handle file handles as well as sockets This handles the socket/non-socket issue by alternating a loop between WaitForMultipleObjects for non-sockets and and select for sockets. One would think this would be terrible for performance, but as of this writing, poll consumes about 6% of the time doing a bulk transfer between a Linux box and 'openssl.exe s_server'. I tried to implement this all in terms of WaitForMultipleObjects with a select 'poll' at the end to get extra specific socket status. However, the cost of setting up an event handle for each socket, setting the WSAEventSelect attributes, and cleaning them up reliably was pretty high. Since the event handle associated with a socket is also global, creating a new one cancels the previous one or can be disabled externally. In addition, the 'FD_WRITE' status of a socket event handle does not behave in an expected fashion, being triggered by an edge on a write event rather than being level triggered. Another fun horror story is how stdin in windows might be a console, it might be a pipe, it might be something else. If these all worked in the same way, it would be great. But, since a console-stdin can also signal on a mouse or window event, it means we can easily get stuck in a blocking read (you can't make stdin non-blocking) if the non-character events are not filtered out. So, poll does that too. See here for various additional horror stories: http://www.postgresql.org/message-id/4351.1336927207@sss.pgh.pa.us
* Use _WIN32 instead of __WIN32.宋冬生2014-11-181-1/+1
| | | | ok bcook@
* Improve and simplify function and header detection logic.Brent Cook2014-10-304-14/+15
| | | | | | | | | Simplify autoconf checks by using AC_CHECK_FUNCS/HEADERS. Clarify some ambiguous dependencies around strnlen/strndup. Unconditionally enable pidwraptest for all arc4random implementations. Remove HAVE_VASPRINTF conditional, since asprintf requires vasprintf. ok @doug
* update string.h for include strings.h for HPUX environmentkinichiro2014-10-221-2/+2
|
* update stdio.h for including stdarg.hinoguchi2014-08-121-0/+1
| | | | | | | | | | | | | | it seems that including stdarg.h is needed for defining va_list environment is hpux 11.31(ia64) with gcc 4.7.1. without stdarg.h, I got compilation error like this. "error: 'va_list' undeclared (first use in this function)" I checked with gcc -E, then I noticed that __va_list is defined but va_list is not. "typedef __gnuc_va_list __va_list;" with including stdarg.h, va_list is defined. "typedef __gnuc_va_list va_list;"
* conditionally build strnlen if needed.Brent Cook2014-08-021-0/+2
| | | | | | it is only used by strndup prodded by Sortie@
* define MAP_ANON for systems with MAP_ANONYMOUSBrent Cook2014-07-301-3/+3
| | | | switch the sense of this check
* merge endian definitions between AIX/HP-UX/SolarisBrent Cook2014-07-301-7/+1
|
* update include/machine/endian.h for hpux portability.inoguchi2014-07-301-0/+3
| | | | ok bcook@
* add sys/mman.h shim to define MAP_ANON if neededBrent Cook2014-07-292-0/+15
| | | | | | thanks to kinichiro for pointing this out ok deraadt@ beck@
* add asprintf / vasprintf from OpenSSH portableBrent Cook2014-07-292-0/+12
| | | | ok deraadt@ beck@
* Update endian.h for AIX/IRIXpgmassey2014-07-291-0/+8
| | | | | | Added AIX/IRIX compatibility for endian detection. ok bcook@ deraadt@ beck@
* Guard individual compatibility header prototypes.Brent Cook2014-07-283-1/+27
| | | | | | | | This is to avoid redefining prototypes from the libc headers. Also, simplify the autoconf function checks and remove some copy/paste errors checking for 'write'. ok wouter@
* add strndup/strnlen compat functions from OpenBSDBrent Cook2014-07-281-0/+4
|
* include system headers for err.h compat macrosBrent Cook2014-07-281-0/+4
|
* build openbsd memmem implementation for explicit_bzero testBrent Cook2014-07-211-0/+3
| | | | | | memmem is not always available, and not all memmem's work the same way ok beck@ guenther@
* include err.h shimBrent Cook2014-07-212-1/+26
| | | | | | Includes compatible replacements, or uses system err.h if available. ok beck@ guenther@
* update guard, add win32 support for endian.hBrent Cook2014-07-201-6/+22
| | | | | | Thanks to Jonas 'Sortie' Termansen for pointing the guard inconsistency out. ok beck@
* include <_bsd_types.h> on MinGWBrent Cook2014-07-201-0/+4
| | | | ok beck@
* axe unneeded solaris compatibility definitionsBrent Cook2014-07-101-5/+0
|
* better fix for __bounded removalBrent Cook2014-07-101-0/+4
|
* Make things build again - add some missing headersCharlie Root2014-07-101-1/+6
| | | | ok bcook@
* initial top-level import of subdirectoriesBrent Cook2014-07-107-0/+85