Commit Graph

30 Commits

Author SHA1 Message Date
kinichiro
0308b63cbf Add support for HP-UX
tested on: HP-UX 11.31 ia64,
               gcc 4.7.1(HP AllianceOne version)
               gcc 4.2.3(http://hpux.connect.org.uk)
	       HP C/aC++

HP-UX defaults to use LP32 and it treats long as 32 bit (= 4 bytes).
This build forces LP64 for treating long as 64 bit.
2015-01-06 17:47:16 -06:00
Brent Cook
d2342f36bc allow Windows DLLs to be built
based on a patch from Jan Engelhardt
2014-12-14 16:59:35 -06:00
Brent Cook
9c685415ab disable inline assembly on Windows for now
There are issues building with inline assembly on Windows 64-bit.
2014-12-07 18:02:06 -06:00
Brent Cook
03cd45e2c7 Enable optimized crypto operations for x86_64
This adds initial support for assembly crypto acceleration on x86_64 for
ELF (Linux, *BSD, Solaris) and Mach-O (OS-X) systems.

The build method is a little different than OpenSSL and OpenBSD.  All
the .s files are generated ahead of time when the tarball is generated,
so there are no complicated makefile rules at configure/build time. This
also means the builds are faster and perl is not required on the build
system.

Thanks to Wouter Clarie for providing the initial cleanup and patch
that this is based on.
2014-12-07 16:26:28 -06:00
Brent Cook
976f64d932 read all library versions directly from files
This makes building and testing easier because the library Makefile.am
files are use directly rather than as templates. Thanks to Wouter Clarie
for the idea.
2014-12-06 18:59:25 -06:00
Brent Cook
29804a73cc simplify packaging for libcrypto.
Remove a lot of complex shell code. Upstream churn has slowed down, so
it is now easier to maintain this directly as automake files. This is
also needed to start integrating CPU-specific acceleration support.

Since we are deriving the copy list from the Makefile.am files, we can
now get rid of copy_src/copy_crypto.
2014-12-06 17:48:03 -06:00
Brent Cook
58fcd3c39c Add conditional compilation for windows and posix functions.
This adds a Windows-specific versions of several symbols from libcrypto
and openssl(1).
2014-12-03 17:02:29 -06:00
Brent Cook
2103690cbf improve readability of generated Makefile.am files 2014-11-23 08:33:56 -06:00
宋冬生
648e913627 Use _WIN32 instead of __WIN32.
ok bcook@
2014-11-18 07:41:08 -06:00
Brent Cook
0aeb93b9fc override native arc4random_buf on FreeBSD
The FreeBSD-native arc4random_buf implementation falls back to weak
sources of entropy if the sysctl fails. Remove these dangerous fallbacks
by overriding locally.

Unfortunately, pthread_atfork() is broken on FreeBSD (at least 9 and 10)
if a program does not link to -lthr. Callbacks registered with
pthread_atfork() simply fail silently. So, it is not always possible to
detect a PID wraparound. I wish we could do better.

This improves arc4random_buf's safety compared to the native FreeBSD
implementation. Tested on FreeBSD 9 and 10.

ok beck@ deraadt@
2014-11-03 01:19:36 -06:00
Brent Cook
a2373f7007 wrap arc4random header
ok @doug
2014-10-30 19:15:20 -05:00
Brent Cook
a4cc953911 Improve and simplify function and header detection logic.
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
2014-10-30 19:15:11 -05:00
Brent Cook
00b51d5c25 conditionally build strnlen if needed.
it is only used by strndup

prodded by Sortie@
2014-08-02 21:59:36 -05:00
Brent Cook
b9ff0728e1 harmonize asprintf with OpenSSH
* use the original name for the file from OpenSSH (remove duplicate version)
 * add va_copy/__va_copy checks to configure
 * incorporate proposed fixes to openssh version:
   + include more system headers directly for various definitions
   + limit the scope of va_copy/va_end to their affected vsnprintf calls
   + simplify error handling, removing a dead assignment
2014-07-30 06:53:02 -05:00
Brent Cook
a07e337020 include comment on windows services 2014-07-29 18:21:58 -05:00
Brent Cook
983103b0db stub win32 issetugid implementation
ok deraadt@ beck@
2014-07-29 11:17:44 -05:00
Brent Cook
d328203f63 produce a error if platform has no arc4random hook
ok deraadt@ beck@
2014-07-29 11:17:27 -05:00
Brent Cook
35e2d8d048 add asprintf / vasprintf from OpenSSH portable
ok deraadt@ beck@
2014-07-29 11:17:22 -05:00
Brent Cook
0a74a4d464 add strndup/strnlen compat functions from OpenBSD 2014-07-28 07:07:23 -05:00
Brent Cook
6383a0722c remove thread_private.h, no longer needed 2014-07-27 06:09:51 -05:00
Brent Cook
f425f564d5 test for and use system explicit_bzero if it exists
ok beck@ guenther@
2014-07-21 19:54:07 -05:00
Brent Cook
edebb7a66e remove thread_private.h defines, moved to arc4random_*.h 2014-07-19 10:49:08 -05:00
Brent Cook
1b1bce16b1 update to newly-refactored arc4random compatibility shims
the thread-private bits can move next

ok beck@
2014-07-18 09:19:23 -05:00
Brent Cook
d697fdb4af initial underpinnings for mingw/cross compilation support
Use canonical host rather than target so that this works:
 CC=i686-w64-mingw32-gcc ./configure --host=i686-w64-mingw32

 Conditionally compile Linux issetugid compatibility function

ok beck@
2014-07-18 09:19:17 -05:00
Brent Cook
32d9eeeecf register the atfork handler from arc4random
From kettenis@

People have suggested using pthread_atfork(3) before, but discarded
the idea because it involves linking with -lpthread, which has other
undesirable consequences.  However:

* Most systems actually have pthread_atfork(3) in libc.  I verified
  this on OS X and Solaris.  I believe this is the case on Linux
  systems that use musl as well.

* On Linux systems that use glibc, this isn't the case.  However,
  those systems have __register_atfork(3), which is fully documented
  in the "Linux Standard Base Core Specification".

ok kettenis@ deraadt@ beck@
2014-07-15 14:50:05 -05:00
Brent Cook
65944782c3 add platform libraries to libcompat's LIBADD list
ok beck@
2014-07-12 03:34:08 -05:00
Bob Beck
c1f7374df0 We're probably gonna need this for solaris 10 2014-07-12 09:15:11 -06:00
Brent Cook
8b125f31bb build strtonum directly into apps/openssl
it is not needed as a library export

ok beck@
2014-07-11 04:47:03 -05:00
Charlie Root
abe7bee360 Make things build again - add some missing headers
ok bcook@
2014-07-10 08:36:47 -06:00
Brent Cook
2b6dbc39ef initial top-level import of subdirectories 2014-07-10 06:22:54 -05:00