Commit Graph

1598 Commits

Author SHA1 Message Date
gardners
55c9cff8cd added code to replace old-format SAS with new crypto_sign implementation
type on next use (so that people upgrading automatically get a new valid
SAS instead of continuing to try to use an invalid one -- this is only
a reasonable course of action since we have made no formal releases of
the code). #17
2012-10-18 17:26:49 +10:30
gardners
499c4018bf Imported ref10/ implementation of crypto_sign from supercop-20120525
as recommended a while back by Dan Bernstein as offering the fastest
implementation of the crypto_sign() primitives for ARM.
Indeed this implementation IS faster. See comparison below for a
Rock 500 handset (800MHz(?) ARM6, no NEON):

Original ref/ implementation on an R500 stock rom (non-rooted)::
mean signature generation time = 96.80ms
mean signature verification time = 272.20ms

ref10/ implementations on an R500 stock rom (non-rooted):
mean signature generation time = 4.00ms
mean signature verification time = 13.00ms

Approximately 20x speed up, just like that :)
2012-10-18 17:26:48 +10:30
gardners
7b8c1337dd call stack errors made fatal and better explained. 2012-10-18 16:12:34 +10:30
gardners
b67ee5d4c5 made non-xpf wrapper for serval_packetvisualise, and added
missing header.
2012-10-18 16:11:25 +10:30
gardners
b758366cc3 fixed bug with mkstemp() on Linux (format must be 6x X, not 5x X). 2012-10-18 16:11:24 +10:30
Andrew Bettison
8ab7cc79b5 Improve debug logging from watch(), schedule() etc.
Use new '__whence' mechanism.
2012-10-16 17:00:03 +10:30
Andrew Bettison
259b9a9d24 Logging/debug improvements: __WHENCE__, __whence
Introduce __WHENCE__ macro and a block comment in log.h explaining it.

In "primitive" kinds of functions, rename 'whence' arguments to '__whence' and
use WHYF(), WARNF(), DEBUGF() macros instead of calling logMessage() directly.
2012-10-16 17:00:03 +10:30
Jeremy Lakeman
2bef619723 Fix - make sure we don't lose track of scheduled alarms 2012-10-16 14:54:28 +10:30
gardners
a82c8f2f41 Imported Jonathan Lahav's updates to openwrt-makefile.
Replaced "dna" everywhere with "servald". #26
2012-10-15 22:28:37 +10:30
Andrew Bettison
52ccd07020 Issue #17, improve speed of "rhizome extract manifest"
In the case that the MANIFESTS 'author' column is not NULL, do not perform a
full bundle secret verification in order to clear the '.readonly' flag, just
check whether the author's SID is present in the keyring with a proper-size
rhizome secret.
2012-10-15 18:33:44 +10:30
Andrew Bettison
f6d9e6cb0e Issue #17, improve "rhizome extract manifest" logic
Do not store negatives in the MANIFESTS 'author' column, just positives, so
that newly-unlocked identities are still checked.

Comment in rhizome_database.c about the semantics of the MANIFESTS.author
column.
2012-10-15 18:08:31 +10:30
Andrew Bettison
c43a7ba8e6 Issue #17, improve "rhizome extract manifest" command
Add ".readonly" output field, add logic to detect bundle author and update
MANIFESTS table 'author' column accordingly.

Add two 'rhizomeops' test cases to deal with authorless logic.

Rename some 'rhizomeops' test cases for consistency and to help filtering.
2012-10-15 16:48:04 +10:30
Paul Gardner-Stephen
37495e4794 fix interface detection on solaris. 2012-10-15 15:58:42 +10:30
Paul Gardner-Stephen
dd3a5ae62d Fix compile errors and some warnings on solaris. 2012-10-15 15:36:36 +10:30
Andrew Bettison
eff3e9ec8f Issue #17, fix new 'rhizomeops' test
Was incorrectly supplying bundle secret to "rhizome add" command.
2012-10-15 14:01:48 +10:30
Jeremy Lakeman
b7201a75b2 Ensure paths decay and eventually expire 2012-10-12 14:22:26 +10:30
Andrew Bettison
3f1f495d68 Issue #17, overhaul manifest author crypto logic
Add test case for new feature of the "rhizome add" command: if the author SID
is not specified (empty arg) then it searches the keyring for the author.

Removed "authorSid" argument from several functions that also take a struct
rhizome_manifest * arg, since the author, if known, is now supplied in the
struct.

Improve return value handling and refactored some rhizome crypto code.
2012-10-11 17:58:24 +10:30
Andrew Bettison
f4d0b7a16a Fix some minor bugs in recent commits 2012-10-10 18:13:31 +10:30
Jeremy Lakeman
b22e3f1964 Add hop count to mdp ping
- Allow mdp client to specify ttl
- Copy ttl into and out of overlay frame
2012-10-10 16:22:31 +10:30
Jeremy Lakeman
4658251ebe Only allow abreviated SID's in route announcements 2012-10-10 15:29:36 +10:30
Jeremy Lakeman
4b2b8f1783 Store keyring identity pointer for local identities in subscriber tree 2012-10-10 15:29:36 +10:30
Andrew Bettison
2a8cfb0404 Quieten Rhizome advertisement debug logging
Introduce DEBUG_RHIZOME_ADS and sqlite_set_debugmask(), use in
rhizome_packetformats.c advertisement mustering and processing code.
2012-10-10 13:22:30 +10:30
Andrew Bettison
04d50e0057 Typedef debugflags_t replaces (unsigned int) 2012-10-10 13:21:20 +10:30
Andrew Bettison
3678522872 Issue #17, add AUTHOR column to Rhizome MANIFESTS table
Replace ".selfsigned" column with ".author" and ".fromhere" columns in
output of "rhizome list" command.  (Note that a "sender" column is
already present.)

Add 'author' field to struct rhizome_manifest.

Log all fully rendered SQL statements on DEBUG_RHIZOME.

Update 'rhizomeops' test cases and improve the assert_rhizome_list()
test function to be able to assert authorship of files.
2012-10-09 17:48:06 +10:30
Jeremy Lakeman
1de2bc8f23 Fix replying to broadcast mdp ping 2012-10-09 17:03:17 +10:30
Jeremy Lakeman
5d553538e7 Remove dead code 2012-10-09 16:20:44 +10:30
Jeremy Lakeman
1f379ea209 Add and preserve QOS bit flags in packet header 2012-10-09 16:17:07 +10:30
Jeremy Lakeman
e28deeb6d5 Move requested payload queue into frame structure 2012-10-09 15:44:37 +10:30
Jeremy Lakeman
9842e22353 Add multi-hop routing test 2012-10-09 14:49:24 +10:30
Andrew Bettison
aca4e8eda9 Fix shell 'eval' metacharacter bug in test defs 2012-10-09 14:03:59 +10:30
Andrew Bettison
3433b0fbb5 Move is_sid_broadcast() and is_sid_any() macros into serval.h
From overlay_mdp.c.  is_sid_broadcast() was defined as is_broadcast().

Also clean up the signature and implementation of is_all_matching().
2012-10-09 13:49:23 +10:30
Andrew Bettison
5a6a42f36d Improve test defs: extract_stdout_keyvalue()
The extract_stdout_keyvalue() function now accepts an optional delimiter
argument, to override its default of ':'.  This makes it useful for extracting
the output of "servald config get" commands.
2012-10-09 13:35:00 +10:30
Jeremy Lakeman
275aa49903 Change route announcement format, add please explain support 2012-10-09 12:57:11 +10:30
Jeremy Lakeman
6e45f264e9 Send both original packet source and transmitter id's in olsr payloads 2012-10-09 12:57:11 +10:30
Andrew Bettison
7ee5266998 Issue #25, fix sed(1) statement for Mac OS X
Seems that OS X sed(1) does not support the compound '{cmd;cmd}' syntax in the
same way as GNU sed(1).
2012-10-09 10:05:00 +10:30
Andrew Bettison
6954325b04 Server process no longer becomes a zombie on Android
Fixes #21.  The problem was caused when the double-fork logic used in "servald
start" was clobbered in 5103176.  This meant that the servald daemon process on
Android no longer had a PPID=1, but the PID of the long-lived
"org.servalproject" parent process which called the JNI entry point.  Killing
the servald process then caused it to become a zombie process, since the
org.servalproject does not habitually call wait(2).  That caused the "servald
stop" logic to send five SIGHUPs to the zombie without any error, making it
appear that the process was not dying.

Reinstated the double-fork logic and added a new test case to ensure that the
daemon process does not become a zombie on being killed prematurely.
2012-10-08 17:20:19 +10:30
Andrew Bettison
4ecb996909 Issue #21, INFO message on unlink a stale pidfile 2012-10-08 17:20:19 +10:30
Andrew Bettison
8483276494 Fix compiler warning on Linux gcc 4.7.1
Function defined but not used.  Commented out the function definition for the
time being.
2012-10-08 17:20:19 +10:30
Jeremy Lakeman
8b9505670d Fix handling of socket closure on OSX 2012-10-08 16:53:52 +10:30
Jeremy Lakeman
c47e99d097 Fix issue #23, regression in 'id' command 2012-10-08 14:59:58 +10:30
gardners
164e9a7b87 removed dependency on -lm log2 to make Android building easier. 2012-10-08 10:46:56 +10:30
Jeremy Lakeman
7af919b02b Merge commit 'ad3b31677540b638430eba0242457d788e8e5915'
Work on devices without sdcards
2012-10-08 09:40:43 +10:30
Andrew Bettison
6e7805d9d5 Fix two 'dnahelper' tests broken by 62f8d223ea 2012-10-06 14:42:22 +09:30
Andrew Bettison
89343c69cd Merge branch 'rhizomedirect' into 'master' 2012-10-05 17:45:30 +09:30
Andrew Bettison
b4c92a289e Fix SEGV bugs on Solaris
Revealed by 'rhizomeprotocol' tests FileTransferDelete, DirectPush and
DirectSync.
2012-10-05 15:49:36 +09:30
Andrew Bettison
063fe6d467 Fix compile warning on Solaris 2012-10-05 15:09:10 +09:30
gardners
d685953ff5 Fixed storage of signatures with manifests in a codepath that
was missed in commit 1c72778c50.
2012-10-05 05:53:11 +02:00
Jeremy Lakeman
48c9a7067e keyring_get_nm_bytes doesn't need to know about port numbers 2012-10-05 09:14:24 +09:30
Romain Vimont (®om)
ad3b316775 Do not try to open rhizome database if rhizome is disabled 2012-10-04 12:34:49 +02:00
Andrew Bettison
d470ac730b Cosmetic improvement for better self-documentation 2012-10-04 18:11:16 +09:30