Commit Graph

3631 Commits

Author SHA1 Message Date
Jeremy Lakeman
88f77b61c4 Errors while unpacking keyring entries should be soft errors
The keyring can have any random data that might pass any number of consistency checks
2016-09-27 10:37:02 +09:30
Jeremy Lakeman
b927af79a8 Introduce new typedef for signing keys to expose their internal structure 2016-09-27 10:28:46 +09:30
Andrew Bettison
d572da2529 Fix Android build with SQLite 3.14.2 2016-09-23 12:57:52 +09:30
Andrew Bettison
e34141a2a5 Upgrade to SQLite 3.14.2
Ignores a variety of warnings when compiling sqlite3.c.

Uses the new sqlite3_trace_v2() function for logging SQL statements, now
that sqlite3_trace() and sqlite3_profile() are deprecated.

Fixes a rhizomeops test failure caused because SQLite 3.12 increased the
default block size from 1024 to 4096, causing the fixed overhead of an
empty Rhizome db to exceed 32KB.  This caused the test to fail because
the first "file add" failed.  Now the test fixture adapts to the fixed
overhead.

Deletes the SQLite 3.10.2 source amalgamation.
2016-09-21 22:47:35 +09:30
Andrew Bettison
8199048191 Import SQLite 3.14.2 source code amalgamation 2016-09-21 18:47:49 +09:30
Andrew Bettison
d9c9d465df Add approximate scaled format functions
Used to produce human-readable values in logs, reports etc.
Eg: 1,073,741,824 -> "1.07g" (SI) and "1.00G" (binary).
2016-09-21 18:47:49 +09:30
Andrew Bettison
cea2221f47 Format scaled integers using strbuf
Replaces uint32_scaled_to_str() with strbuf_append_uint32_scaled().
2016-09-21 18:47:49 +09:30
Andrew Bettison
5dfb7c1b68 Un-inline a function in "rhizome_types.h" 2016-09-21 18:47:49 +09:30
Andrew Bettison
a10207f471 Remove unnecessary #includes from "rhizome.h" 2016-09-21 18:47:49 +09:30
Andrew Bettison
6e65a2399f Add missing #include "str.h" 2016-09-21 18:47:49 +09:30
Andrew Bettison
5a77008aa8 Move URI primitives from "str.h" to "uri.h" 2016-09-21 18:47:49 +09:30
Andrew Bettison
5b3d997896 Move Base64 conversions from "str.h" to "base64.h" 2016-09-21 18:47:49 +09:30
Andrew Bettison
cd766cd480 Move numeric conversions from "str.h" to "numeric_str.h" 2016-09-21 18:47:49 +09:30
Andrew Bettison
0bf7c5ccea Update copyright messages in documentation 2016-09-21 18:31:31 +09:30
Andrew Bettison
7e39698234 Improve libsodium dev documentation 2016-09-21 18:15:34 +09:30
Jeremy Lakeman
adf0a880bc Any identity could be the main one, check for any valid route 2016-09-21 17:27:39 +09:30
Andrew Bettison
298b83f97b Fix a failing keyringrestful test
The recent randomising of keyring slots broke an assumption
about the order of the 'keyring list' output.  Now the test's
assertions do not assume any order.
2016-09-21 12:16:50 +09:30
Jeremy Lakeman
f615a1deca Fix signed / unsigned warning 2016-09-21 09:33:08 +09:30
Jeremy Lakeman
a531c0e960 Use a random walk to find free keyring slots
Always round the file size up to the nearest 16 slots
2016-09-20 16:47:30 +09:30
Jeremy Lakeman
4e50b1716c Test reachable bit flags about ourself 2016-09-20 15:04:28 +09:30
Jeremy Lakeman
275c99bc4e Add cli option for changing an entry pin 2016-09-20 10:00:02 +09:30
Andrew Bettison
2f61c447a9 Add a new rhizomerestful test case: update a bundle to empty payload 2016-09-19 14:30:04 +09:30
Andrew Bettison
9a5ee2eded Update INSTALL.md dates and compiler versions 2016-09-19 13:46:51 +09:30
Andrew Bettison
0657e27dea Fix a failing meshmsrestful test
On OS-X, "sed" is BSD sed(1); must use $SED instead to get GNU sed(1).
2016-09-15 17:17:34 +09:30
Andrew Bettison
fc8fce5595 Improve build-libsodium.sh 2016-09-15 16:55:59 +09:30
Jeremy Lakeman
ecb79d818f Refactor storage of binary values to enable reuse 2016-09-13 15:25:39 +09:30
Andrew Bettison
b94d2f7007 Minor improvements to README.md 2016-09-13 10:44:12 +09:30
Andrew Bettison
2c0b8a5ef4 Change #include "sodium.h" to <sodium.h> 2016-09-12 15:25:08 +09:30
Andrew Bettison
21679e3865 Fix rhizomeprotocol test on OS-X 2016-09-12 15:09:46 +09:30
Andrew Bettison
11b091a33b Update doco for OS-X installation and development 2016-09-12 15:09:46 +09:30
Andrew Bettison
c45e92b731 Fix OS-X build with libsodium
Add a new 'build-libsodium.sh' script and instructions in
doc/Development.md.  Update the configure.in script to check for
libsodium headers and library, and print helpful messages if not
present.
2016-09-12 15:09:41 +09:30
Andrew Bettison
43bd0bd33f Fix a failing keyring test
The in-memory identity creation test was failing intermittently because
the server only creates the in-memory identity on the first tick, and
under load the server sometimes does not tick for a while, leading to a
race with the "servald id self" command.

The test case now waits for the server to emit a tick before running the
"id self" command.  This necessitated a new DEBUG() statement and a new
debug flag 'overlaytick'.

Also disabled Rhizome for all the keyring tests, as unnecessary Rhizome
DB creation was slowing down the fixtures.
2016-09-06 15:00:21 +09:30
Andrew Bettison
2cfdafdb56 Add some MDP client DEBUG trace statements 2016-09-06 13:31:38 +09:30
Andrew Bettison
7f0fef2209 Fix an intermittent server test failure
The quit-on-monitor-client-disconnect test was non-deterministic
depending on load (eg, other concurrently running tests).  Under load,
it was likely that the server did not process the "monitor quit" command
before checking for disconnect, so the server did not terminate.

The fix was to make the monitor interface read and process all queued
input from the client before checking for HUP or ERR condition on the
socket.  With this fix, the "sleep 1" kludges before and after the echo
"monitor quit" to the console command are no longer needed.

In the process the monitor interface code was modernised: eg, now it
calls read_nonblock() instead of read(2).
2016-09-06 12:33:29 +09:30
Andrew Bettison
64286bd5e6 Absorb ENOTRECOVERABLE in read_nonblock()
Already absorbs EINTR and EAGAIN.  The monitor interface ignores this
error code for reasons unexplained, and now that it uses read_nonblock()
instead of read(), this preserves its behaviour.
2016-09-06 12:07:00 +09:30
Andrew Bettison
0869470d96 Add DEBUG_cli_parsed() statements to monitor commands 2016-09-06 11:19:45 +09:30
Andrew Bettison
fc47bc541f Fix the DEBUG_cli_parsed() macro
Was logging a blank line instead of "parsed `key`=`value`..."
2016-09-06 11:18:59 +09:30
Andrew Bettison
c3a94a7ac3 Formalise dependency on libsodium
./configure now fails if libsodium is not present.
Added libsodium to the list of dependencies in INSTALL.md.
Add a Debian apt-get command to doc/Development.md.
2016-09-05 17:04:22 +09:30
Jeremy Lakeman
05da181541 Return PAYLOAD_STATUS_NEW if file is now missing from the store 2016-09-05 15:13:09 +09:30
Jeremy Lakeman
7beab7e5d8 Bias rhizome transfer based on route to recipient 2016-09-05 15:12:36 +09:30
Jeremy Lakeman
73b151a3e4 Remove unused variable 2016-09-05 12:31:22 +09:30
Jeremy Lakeman
67b9aeeb4e Add simple meshmb find command 2016-08-29 11:06:53 +09:30
Jeremy Lakeman
6a0b7a1da6 Allow for arbitrary extra manifest fields on broadcast messages 2016-08-24 16:33:39 +09:30
Jeremy Lakeman
e13b9c3c94 Reduce redundant reading of message ply's 2016-08-23 14:28:13 +09:30
Jeremy Lakeman
ce36e6f2c6 Fix assert on DB lock while flushing data 2016-08-22 11:13:29 +09:30
Jeremy Lakeman
b2eb3a2199 Begin broadcast messaging service 2016-08-16 15:04:15 +09:30
Jeremy Lakeman
97fd66faf7 Don't assert if file not found 2016-08-16 12:23:20 +09:30
Jeremy Lakeman
9697b0991b Tweak message ply internals 2016-08-16 12:22:23 +09:30
Jeremy Lakeman
b6256ea89a Add identity_t type & rename signing key api to identity. 2016-08-16 12:22:13 +09:30
Jeremy Lakeman
dc7226b6a5 Remove file hash command 2016-08-16 12:22:13 +09:30