Commit Graph

243 Commits

Author SHA1 Message Date
Frank Denis
46f71fba9e Check for getpid(2) presence instead of checking for Visual Studio 2015-09-13 15:04:26 +02:00
Frank Denis
c1f749e68a Keep shell variables names consistent with their related C macros. 2015-09-04 15:37:31 +02:00
Matthijs van Duin
cfa9e95b6c improve test for unaligned access
check target attribute on ARM
2015-09-04 02:29:34 +02:00
Frank Denis
7fca230be8 Nits after pnacl merge 2015-08-02 13:53:22 +02:00
Frank Denis
f610f781f2 Merge remote-tracking branch 'arbinger/pnacl' into nacl
* arbinger/pnacl:
  removed comment
  Added .final and .nexe output files to CLEANFILES
  revert original hack
  Initial patch for Chrome NaCl implementation
  Added patch to obtain random bytes for Chrome NaCl via IRT -- allows build with NaCl SDK toolchain
2015-08-02 12:54:05 +02:00
Syrone Wong
4074470a31 Fix _FORTIFY_SOURCE redefined issue 2015-08-02 09:36:52 +08:00
James Robson
34a4931d9a Initial patch for Chrome NaCl implementation 2015-06-22 13:02:21 -05:00
Frank Denis
b5fff1fcf5 Version bump 2015-04-26 17:09:00 +02:00
Frank Denis
33357dc52e Running the JS tests requires the filesystem. 2015-01-18 00:46:48 +01:00
Frank Denis
98c96f4c99 No browser, no filesystem support required 2015-01-18 00:42:34 +01:00
Frank Denis
e7f410de10 Emscripten: don't use a memory init file any more.
It doesn't take that long to load the module, and it's going to make
users' life way easier.
2015-01-17 22:11:10 +01:00
Frank Denis
201821065d Reserve slots for function pointers 2015-01-17 18:33:25 +01:00
Frank Denis
2c15c81ba5 Revert 17932c782e
It broke compilation on OpenBSD.
2015-01-15 16:21:09 +01:00
Frank Denis
f20ecbed94 Skip sodium_utils{2,3} tests when the target is Javascript 2015-01-15 11:12:58 +01:00
Frank Denis
5b8c2de267 Version bump 2015-01-12 09:41:46 +01:00
Frank Denis
aaf5fbf2e5 + precomputed interface for crypto_box() 2015-01-06 17:52:42 +01:00
Jack Wink
f87ef76ee8 remove extra pie check 2014-12-28 13:19:07 -05:00
Jack Wink
1ce56adbef a second stab at detecting valid linker flags 2014-12-28 13:17:09 -05:00
Jack Wink
9c9d1edf74 check to see if '-Wl,-pie' is supported before using it 2014-12-28 12:59:53 -05:00
Jack Wink
6ebf4030f8 change '-pie' to '-Wl,-pie' to squash clang errors 2014-12-28 12:27:35 -05:00
Frank Denis
4c4d04bb2a Merge pull request #222 from stellar/master
Add libsodium-uninstalled.pc.in
2014-12-25 10:56:17 +01:00
Frank Denis
3a9c4f2c78 Merge branch 'master' of github.com:jedisct1/libsodium
* 'master' of github.com:jedisct1/libsodium:
  Warn that libtool might fail if the build directory contains whitespaces
2014-12-23 20:26:29 +01:00
Frank Denis
c6e93b9f79 Discourage use of --enable-blocking-random 2014-12-23 20:24:23 +01:00
Graydon Hoare
9ae403b489 Add libsodium-uninstalled.pc.in 2014-12-22 16:14:22 -08:00
Frank Denis
0b58f87fef Warn that libtool might fail if the build directory contains whitespaces 2014-12-21 09:51:32 +01:00
Frank Denis
9d71e18a22 Always generate libsodium.pc 2014-11-29 13:53:20 -08:00
Frank Denis
11ccb20512 If -fno-strict-overflow is available, don't add -fwrapv 2014-11-25 12:19:08 -08:00
Frank Denis
61620d7e42 Make 'make check' actually run the tests on Emscripten. 2014-11-25 09:51:39 -08:00
Frank Denis
69e3674c29 Include the test pre.js script only for tests. 2014-11-24 17:19:55 -08:00
Frank Denis
b421610110 AC_FUNC_MMAP assumes that mmap(2) is not available when cross-compiling
except on GNU systems. Just check for function presence instead.
2014-11-24 10:34:42 -08:00
Frank Denis
da2c9952db Check if mmap(2) works, not just the presence of MAP_ANON
In particular, mmap(2) doesn't return an aligner pointer on Emscripten.
2014-11-24 10:22:50 -08:00
Frank Denis
5aeebd880e Change EXEEXT to .js for Emscripten 2014-11-22 14:31:43 -08:00
Frank Denis
d0eab9323f Don't assume that madvise() is available even if related macros are defined. 2014-11-22 13:32:54 -08:00
Frank Denis
133118ca4d Skip mlock/mprotect/explicit_bzero when using Emscripten 2014-11-22 12:32:11 -08:00
Frank Denis
68b3191c90 Merge branch 'master' of github.com:jedisct1/libsodium
* 'master' of github.com:jedisct1/libsodium:
  Prevent first-run ./autogen.sh error due to ltmain.sh absence.
2014-11-02 19:24:29 -08:00
Frank Denis
25e467bdea Check that -D_FORTIFY_SOURCE=2 doesn't trigger a compiler bug 2014-11-02 19:24:08 -08:00
Phillip Mienk
2f5a4bd019 Prevent first-run ./autogen.sh error due to ltmain.sh absence. 2014-11-02 16:49:17 -08:00
Frank Denis
84972cbf9c Version bump 2014-10-08 22:01:12 -07:00
Frank Denis
2c61530133 1.0.0 2014-09-24 00:18:44 -07:00
Frank Denis
05f46af70e Version bump 2014-09-18 22:47:11 -07:00
Frank Denis
82c806ec07 Capitalize Android 2014-09-14 13:56:02 -07:00
Frank Denis
41ed891d56 Use -fstack-protector for all.
Might be replaced by -fstack-protector-strong later on.
2014-09-14 13:25:29 -07:00
Frank Denis
61449686ee Version bump 2014-08-15 16:52:01 -07:00
Frank Denis
473e1718cc Add sodium_{malloc,allocarray,free}() and sodium_mprotect_*()
ptr = sodium_malloc(size) returns a pointer from which exactly "size" bytes
can be accessed.

ptr = sodium_allocarray(count, size) allocates enough storage space for
"count" pointers or scalars of unit size "size".

In both cases, the region is immediately followed by a guard page.
As a result, any attempt to access a memory location after ptr[size - 1] will
immediately trigger a segmentation fault.

The allocated region is mlock()ed and filled with 0xd0 bytes.

A read-only page with the size, a guard page, as well as a canary are
placed before the returned pointer.

The canary is checked by sodium_free(); as a result, altering data right
before ptr is likely to cause sodium_free() to kill the process.

sodium_free() munlock()s the region and fills it with zeros before
actually calling free().

sodium_mprotect_noaccess(), sodium_mprotect_readonly() and
sodium_mprotect_readwrite() can be used to change the protection on the set
of allocated pages.

Reverting the protection to read+write is not required before calling
sodium_free().
2014-08-14 21:41:05 -07:00
Frank Denis
55bb50b855 Bump major 2014-08-06 10:09:21 -07:00
Frank Denis
ed76b41369 Rephrase 2014-08-04 16:29:13 -07:00
Frank Denis
2b0c8e40aa Keep IA-32 asm on MingW/Cygwin, check for Windows during the x86-64 test. 2014-08-04 16:24:11 -07:00
Frank Denis
b9be5fbd45 Do not pass -fPIC on Windows. Add msys as a host_os value to detect Windows as well. 2014-08-04 14:30:07 -07:00
Frank Denis
857c772853 Rephrase 2014-07-31 22:13:45 -07:00
Frank Denis
aae1ae5005 MSVC: Define NATIVE_LITTLE_ENDIAN / inline as __inline / UNICODE & _UNICODE 2014-07-29 08:57:17 -07:00
Frank Denis
990fad3060 librt and libm are not needed any more.
Thanks to Raúl Sánchez Siles for the heads up.
2014-07-21 16:00:47 -07:00
Frank Denis
1dca7edfab --enable-minimal should compile only what is required for the high-level API
This doesn't include aes128ctr.
2014-07-14 18:43:46 -07:00
Frank Denis
412f3edf8c Get ready for 0.6.1 2014-07-12 21:15:46 -07:00
Frank Denis
f6519378b4 + --enable-minimal to build a smaller library without less-used functions. 2014-07-09 20:24:04 -07:00
Frank Denis
c7059e88ec Always install the .pc file even if pkg-config is not available.
And make sure that "make uninstall" gets rid of it, too.
2014-07-05 15:10:36 -07:00
Frank Denis
28d6eeaad7 Next package version will be 0.6.0
The library itself doesn't need a major version bump.
2014-06-26 16:13:46 -07:00
Frank Denis
957315035a Use weak symbols to prevent LTO if this is an option.
Idea from Matthew Dempsky.
2014-06-20 21:11:53 -07:00
Frank Denis
098bad385b Disable memset_s test for now.
Targeting OSX < 10.9 with -macosx-version-min doesn't work as expected:
memset_s is detected as present even though it won't actually work on
OSX <= 10.8
2014-06-18 17:49:28 -07:00
GraxRabble
ccf915dc14 prevented 128 bit integers from compiling with emscripten 2014-05-20 13:53:31 -04:00
xantares
041f920341 Link memset_s presence test 2014-05-19 19:14:49 +02:00
Frank Denis
35467bc0b7 Bump minor 2014-05-15 01:20:10 -07:00
Frank Denis
4653471cad Check for SSSE3 instructions set 2014-05-14 22:34:27 -07:00
Frank Denis
f3034d38fc Align library version ASCII art 2014-05-12 14:07:48 -07:00
Frank Denis
4ea26f0b8c Stricter autoconf checks for MMX/SSE2/SSE3 2014-05-09 22:01:15 -07:00
Frank Denis
90d270f7c5 Check for memset_s availability the hard way. 2014-05-09 13:23:15 -07:00
Frank Denis
bfeec26358 Use explicit_bzero if available 2014-05-09 13:06:39 -07:00
Frank Denis
d12b563520 Bump library version major 2014-05-08 21:13:12 -07:00
Frank Denis
394e654c40 Unbreak cpuid check in autoconf 2014-05-06 12:31:08 -07:00
Frank Denis
20088ca5e2 Remove HAVE_CPUID conditional 2014-05-06 12:26:53 -07:00
Frank Denis
dc5dbae12f Sync autoconf cpuid detection code 2014-05-02 21:24:31 -07:00
Frank Denis
ced8034901 Test only for cpu features we actually use for now, add MMX. 2014-05-02 15:39:49 -07:00
Frank Denis
cb4f3e4f06 Use SSE2 or portable scrypt implementation according to what the CPU supports. 2014-05-02 15:20:34 -07:00
Frank Denis
cb8544715b Check for SSE2/SSE3/NEON support at runtime. 2014-05-02 14:40:39 -07:00
Frank Denis
3cefff9e52 Goodbye poly1305-53 and its genius fp wizardry. 2014-05-01 21:51:02 -07:00
Frank Denis
5df1a09f9a Do not try to directly include <avxintrin.h> 2014-05-01 13:51:05 -07:00
Frank Denis
488cb28953 Do not use functions that aren't fully supported by Emscripten yet. 2014-04-22 18:12:49 -07:00
Frank Denis
53f3784a18 Also check for VirtualLock() 2014-04-16 18:04:45 -07:00
Frank Denis
7533cca9c7 Check for mlock() 2014-04-16 18:04:09 -07:00
Frank Denis
a06b00ecf4 Initial import of scrypt 2014-04-10 18:25:16 -07:00
Frank Denis
9f2e0ba803 Use memset_s() if available 2014-03-02 19:05:14 -08:00
Simon Levermann
cd2fabb8f5 Repair broken sonames 2014-02-23 02:07:52 +01:00
Simon Levermann
d889492173 Add ./configure option to disable toggle versions
I consider this way cleaner than setting some environment
variable in the build script. Per default, sonames are generated.
If ./configure is run with "--disable-soname-versions", no soname
versions will be generated. This is mainly useful for android, but
it might find some use for other environments without soname versioning
2014-02-20 17:54:05 +01:00
Frank Denis
0e6723c83c Append to LIBTOOL_EXTRA_FLAGS in case it is not empty 2014-02-17 01:23:23 -08:00
Frank Denis
b70aa80cc6 Check for posix_memalign() presence 2014-01-01 12:57:25 +01:00
Frank Denis
3aa856474a Distribute the dist-build directory 2013-12-31 16:16:29 +01:00
Frank Denis
bf72ee931e Make crypto_scalarmult_curve25519.h architecture-independent 2013-12-11 20:17:09 -08:00
Frank Denis
5133638024 Make crypto_stream_salsa20.h architecture-independent.
Move implementation-specific functions to compat.c
2013-12-11 19:45:11 -08:00
Frank Denis
2c4f936715 Compile separately and use lipo(1) to build universal binaries. 2013-10-24 12:27:50 -07:00
Frank Denis
5ae0dbc579 Drop support for universal binaries. 2013-10-24 11:51:09 -07:00
Jose Pedro Oliveira
7101eb6a3f Downgrade the minimal pkg-config version from 0.25 to 0.23 (which is
the pkg-config version shipped in Red Hat Enterprise Linux 6).
2013-10-23 17:19:08 +01:00
Frank Denis
abb7f74e5d 0.4.5 2013-10-22 02:56:36 -07:00
Frank Denis
afb89c7e16 Some systems have arc4random() but not arc4random_buf() 2013-10-22 02:54:45 -07:00
Frank Denis
08e37807ae Bump version to 0.4.4 2013-10-21 20:43:44 -07:00
Frank Denis
875f4210ef Check for arc4random() 2013-10-06 15:40:03 -07:00
Frank Denis
008808742b Bump library minor 2013-10-05 14:14:18 -07:00
Frank Denis
b9b293c0ab Add msvc scripts to the tarballs 2013-09-30 13:36:31 -07:00
Frank Denis
30026fbbfe Check for inline vs __inline for MSVC 2013-09-24 13:23:48 -07:00
Frank Denis
656d8d6495 Disable donna_c64 on big endian architectures for now 2013-09-21 20:07:50 -07:00
Frank Denis
48f46304ce Crank library minor 2013-09-09 22:21:53 -07:00
Frank Denis
38d0a4d1ca Disable asm on x86_64-*-cygwin*, thanks to neheb@ 2013-09-09 00:01:55 -07:00