Commit Graph

57 Commits

Author SHA1 Message Date
Netscape Navigator e0d0739af6 Run rubocop 2020-04-25 10:11:25 -05:00
Netscape Navigator 8fed4dc0bc WIP. TODO: Make sure client is ingesting blobs in a bundle 2020-04-23 07:41:47 -05:00
Netscape Navigator eb1b9a9a97 Remove wonky draft API 2020-04-19 17:09:50 -05:00
Netscape Navigator 638ce7c9b0 Begin renaming database methods for consistency 2020-04-19 09:25:42 -05:00
Netscape Navigator 3dd47bfe5e Done with singleton removal 2020-04-18 10:30:35 -05:00
Netscape Navigator 49a3623b28 🤞 One failure left... 2020-04-18 10:19:06 -05:00
Netscape Navigator a24486e583 Start removing @db instance vars 2020-04-18 09:24:51 -05:00
Netscape Navigator d3ddc21de3 WIP, Need to fix saved drafts. 2020-04-18 08:51:54 -05:00
Netscape Navigator 780823ccaf [REALLY UNSTABLE] Started removal of Pigeon::Storage.current 2020-04-16 09:05:10 -05:00
Netscape Navigator 21ec42dbd7 Begin singleton removal 2020-04-15 07:46:49 -05:00
Netscape Navigator 9fba00c48b Add message size limit of 64 keys. 2020-04-15 07:31:18 -05:00
Netscape Navigator 975d7cde57 Done with lipmaalinks, but probably not partial verification. 2020-04-14 08:09:45 -05:00
Netscape Navigator f175c99067 [WIP][UNSTABLE] Gradually adding `lipmaa` header. 2020-04-12 09:38:52 -05:00
Netscape Navigator d6742bb9c0 Ready to write tests for Lipmaa linking 2020-04-11 09:53:22 -05:00
Netscape Navigator c82eb7a3c9 Cleanup ::Storage (make some public methods private) 2020-04-11 09:42:43 -05:00
Netscape Navigator 58926b4c68 [STABLE] Pass all message creation (even local messages) through the message lexer/parser for validation. 2020-04-09 08:12:23 -05:00
Netscape Navigator 8df1336702 Continuing fixes for ::Draft. 6 failures 2020-04-09 07:30:32 -05:00
Netscape Navigator a6a8634cab WIP. 7 tests failing. Refactor Pigeon::Draft / ::Message
Pigeon::Message was holding on to too many drafting responsibilities.
It also was possible for the local identity to inadvertantly author
malformed messages. This is because local messages were not passed
through the ::Lexer / ::Parser and thereby did not receive the same
scrutiny of remote messages.

To avoid security problems later, and for additional security,
I will only allow messages to be saved *after* passing through the
lexer/parser. This means moving much of Pigeon::Message's logic
into Pigeon::Draft.
2020-04-07 08:58:53 -05:00
Netscape Navigator d76f72ed88 Test case: ingesting malformed messages (whitespace keys and kind) 2020-04-07 08:13:28 -05:00
Netscape Navigator 492b2da385 WIP: Validate that `kind` and body keys dont contain whitespace 2020-04-06 07:52:32 -05:00
Netscape Navigator dd7456cc88 Rename .public_key attributes to .multihash for consistency 2020-04-06 07:22:24 -05:00
Netscape Navigator dd455ff1df [STABLE] Convert URLSafeb64 to Crockford32. 2020-04-05 20:21:50 -05:00
Netscape Navigator 30d6690b1c [UNSTABLE] Remove b64, add b32 2020-04-05 19:38:37 -05:00
Netscape Navigator b0181234af Test case: Verification / assertion error 2020-04-03 05:29:19 -05:00
Netscape Navigator 6b71044e86 Fix most failing tests. 2020-04-03 04:48:28 -05:00
Netscape Navigator 191a73c419 🎉🎉🎉 Bundle ingestion works!! 2020-03-31 07:09:42 -05:00
Netscape Navigator 3a03d1b589 Set `prev` to Pigeon::EMPTY_MESSAGE rather than `nil` 2020-03-30 08:51:05 -05:00
Netscape Navigator b5089bb905 Fix numerous indexing and type errors. TODO: Fix verification errors.
* Stricter "type checking"
 * Better error messages
 * Safer signature computation
 * Easier PStore debugging
2020-03-29 11:51:57 -05:00
Netscape Navigator f3373863a6 Rename KeyPair to LocalIdentity to disambiguate (were dealing with peers now). 2020-03-24 07:39:32 -05:00
Netscape Navigator 31daf90cdc We have BUNDLE CREATION 🎉 🎉 🎉 2020-03-15 11:51:13 -05:00
Netscape Navigator afa160c2d2 Convert `".sig.ed25519"` literals to constants. Update README. 2020-03-13 22:09:31 -05:00
Netscape Navigator ef569d3fb4 Use multihash (instead of hex) for blob notation 2020-03-13 21:59:13 -05:00
Netscape Navigator 3c9b653f7c Change Message.from_draft to Message.publish
This mmakes it more obvious that the method can only be
used on *your* messages rather than the messages of peers.
2020-03-13 07:42:44 -05:00
Netscape Navigator ff1c7cee00 test to verify message signatures 2020-03-13 07:39:44 -05:00
Netscape Navigator 18d82f30f7 TODO: Fix scratchpad.sh, write test to verify message signatures 2020-03-12 08:07:13 -05:00
Netscape Navigator 3b2f4ea5d0 Minor cleanup of ::KeyPair 2020-03-12 07:47:42 -05:00
Netscape Navigator f6032dac18 Add tests to verify accuracy of hash chain. NEXT: Tests to verify accuracy of signatures 2020-03-11 08:44:52 -05:00
Netscape Navigator c27db9ae71 TODO: Verify accuracy of signature chain.
Also todo:
 * Use URL safe base64 for blob multihash?
 * Replicate/verify signatures of SSB messages for backwards compat.
2020-03-09 08:56:45 -05:00
Netscape Navigator 6a345bbb90 Remove superfluous whitespace. Add scratchpad* to ignore. 2020-03-09 08:07:55 -05:00
Netscape Navigator a14089143a [INCOMPLETE] Wrote tests for message linkage, but there is a problem
Observe the messages below:

=== BEGIN SAMPLE
	author @sqTnBVTpnkzptZ2Ek7U7IfBKbQdWfe4HfsBd-9fcyDg=.ed25519
	kind unit_test
	prev NONE
	depth 0

	description:"Message number 1"

	signature oBZcedW6JFqWVVqVHSjKeJWzd2uQtkBi2ATtF9meLzwrgf59DcjFQ5n0W6ZcCQkCSCpXECoBwF8BdnPej9XCBw==.sig.ed25519
	author @sqTnBVTpnkzptZ2Ek7U7IfBKbQdWfe4HfsBd-9fcyDg=.ed25519
	kind unit_test
	prev oBZcedW6JFqWVVqVHSjKeJWzd2uQtkBi2ATtF9meLzwrgf59DcjFQ5n0W6ZcCQkCSCpXECoBwF8BdnPej9XCBw==.sig.ed25519
	depth 1

	description:"Message number 2"

	signature MB52WQfouTRP_cKHnaMR8iL0EEXFDWrKghBbC8DQ_QxKzS8PFDSXCxbZFr2bfEbCzBrd_bCxP1q9uK4ndQwkCQ==.sig.ed25519
	author @sqTnBVTpnkzptZ2Ek7U7IfBKbQdWfe4HfsBd-9fcyDg=.ed25519
	kind unit_test
	prev MB52WQfouTRP_cKHnaMR8iL0EEXFDWrKghBbC8DQ_QxKzS8PFDSXCxbZFr2bfEbCzBrd_bCxP1q9uK4ndQwkCQ==.sig.ed25519
	depth 2

	description:"Message number 3"

	signature jEIN2yYSWmg-fnontgoZQS3Cw7KJIzhxuH6Gz-bE5pRat9zjP6vFJOlbNjADif_sPTxdye-kZdy52gTspDmdBw==.sig.ed25519
=== END EXAMPLE

Notice that the `signature` is identical to the `prev` value.
This is wrong.
The signature value is fine as it is, but the `prev` value needs to be a traditional message.
That is to say it should be a URL safe base64 string that starts with a "%" character.
You can't just copy/paste the signature like that.

For more info visit:
  https://spec.scuttlebutt.nz/feed/datatypes.html#multihash-encoding
  https://spec.scuttlebutt.nz/print.html#json-encoding
2020-03-08 11:39:49 -05:00
Netscape Navigator c621e5c070 DRY up storage initialization / reset code 2020-03-08 11:18:05 -05:00
Netscape Navigator be5dfc982a 🎉 100% coverage. NEXT: Verify message chain creation via tests.
Currently, it is not working correctly.
Take a look at scratchpad.sh. The `prev:` values are wrong.

It is probably as simple as updating local indexes when
Pigeon::Storage#save_message is called. Re run the indexes
at that time. Or heck, add a map/reduce ability?
2020-03-07 09:56:03 -06:00
Netscape Navigator f4b6ddbf51 (99.44% coverage) TODO: Need to reset current draft when a draft is signed/committed to the log 2020-03-06 08:42:19 -06:00
Netscape Navigator 17bd8e7927 Factor Pigeon::Message into two smaller classes: Pigeon::Message and Pigeon::Draft 2020-03-05 08:32:22 -06:00
Netscape Navigator f68e004e53 TODO: Create message index 2019-12-29 20:16:42 -06:00
Netscape Navigator 61460a4ae5 Clear old instances out via `#reset` 2019-12-27 22:44:10 -06:00
Netscape Navigator dab113961a TODO: Make these tests pass 2019-12-10 21:52:43 -06:00
Netscape Navigator 0ca6ea0fb8 Fix tests for Message#redner 2019-12-08 21:57:29 -06:00
Netscape Navigator 1b6abf6927 Add more tests 2019-12-05 21:28:21 -06:00
Netscape Navigator 77a5ba27de TODO: Tests for Message#sign 2019-12-04 22:11:04 -06:00